Guest User

Untitled

a guest
Jul 17th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. #!/usr/bin/env python
  2. f = open('input.txt', 'r')
  3. o = open('output.txt', 'w')
  4. with f,o:
  5.     prevnum = int(f.readline().strip())
  6.     m = 1
  7.     j = 1
  8.     while(1):
  9.         s = f.readline().strip()
  10.         if not s:
  11.             o.write("%s\n" % str(m))
  12.             break
  13.         num = int(s)
  14.         if num < prevnum:
  15.             j += 1
  16.         elif j > m:
  17.             m = j
  18.             j = 1
  19.         prevnum = num
Add Comment
Please, Sign In to add comment