dxnge

tsk 16

Nov 5th, 2021
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. with open('17.txt') as f:
  2.     a = [[x for x in (zip(s, s[1:], s[2:], s[3:]))] for s in [list(map(int, f.readlines()))]]
  3.     cnt, sm = 0, float('inf')
  4.     for i in a[0]:
  5.         if all(i[n] > i[n+1] for n in range(3)):
  6.             if max(i) - min(i) > 1000:
  7.                 cnt += 1
  8.                 if sm > sum(i):
  9.                     sm = sum(i)
  10. print(cnt, sm)
  11.  
Advertisement
Add Comment
Please, Sign In to add comment