broadbringer

Untitled

Feb 25th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.48 KB | None | 0 0
  1. with open('input.txt', 'r') as InputFile:
  2.          a, b = InputFile.read().split()
  3. a = int(a); b=int(b)
  4. max = 1
  5. i = 1
  6. while(b!=0):
  7.     if(a==b):
  8.         i+=1
  9.     elif(a!=b):
  10.         if(i>max):
  11.             max=i
  12.             i=1
  13.         else:
  14.             i=1
  15.     a=b
  16.     b = InputFile.read()
  17. if(max>i):
  18.     with open('output.txt', 'w') as OutputFile:
  19.         OutputFile.write(str(max))
  20. else:
  21.     with open('output.txt', 'w') as OutputFile:
  22.         OutputFile.write(str(i))
Advertisement
Add Comment
Please, Sign In to add comment