fork(1) download
  1. '''import random
  2. f = open('input.txt','w')
  3. n = random.randint(1,100)
  4. n= 100000
  5. q = random.randint(1,100)
  6. q = 100000
  7. f.write(str(n)+' '+str(q)+'\n')
  8. x = 1000000
  9. for i in range(n):
  10. s = '1'
  11. y = random.randint(1,max(1,x-i-1))
  12. x-=y
  13. s += ''.join(random.choice('01') for _ in range(y-1))
  14. f.write(str(s)+'\n')
  15.  
  16. x = 100000
  17. for _ in range(q):
  18. l = random.randint(1,n)
  19. r = random.randint(1,n)
  20. if l>r:
  21. t = r
  22. r = l
  23. l = t
  24. s = '1'
  25. y = random.randint(1,max(1,x-i-1))
  26. x-=y
  27. s += ''.join(random.choice('01') for _ in range(y-1))
  28. f.write(str(l)+' '+str(r)+' '+s+'\n')'''
  29.  
  30.  
  31. import random
  32. f = open('input.txt','w')
  33. n= 10
  34. q = 100
  35. f.write(str(n)+' '+str(q)+'\n')
  36. for i in range(n):
  37. s = '1'
  38. s += ''.join(random.choice('01') for _ in range(9))
  39. f.write(str(s)+'\n')
  40. for _ in range(q):
  41. l = random.randint(1,n)
  42. r = random.randint(1,n)
  43. if l>r:
  44. t = r
  45. r = l
  46. l = t
  47. s = '1'
  48. s += ''.join(random.choice('01') for _ in range(9))
  49. f.write(str(l)+' '+str(r)+' '+s+'\n')
Runtime error #stdin #stdout #stderr 0s 32920KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "prog.py", line 32, in <module>
IOError: [Errno 13] Permission denied: 'input.txt'