Advertisement
nq1s788

Untitled

Jan 11th, 2025
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. #https://inf-ege.sdamgia.ru/problem?id=45260
  2. data = open('107_26.txt').readlines()
  3. n = int(data[0])
  4. field = {}
  5. for i in range(1, n + 1):
  6.     x, y = map(int, data[i].split())
  7.     if x not in field:
  8.         field[x] = []
  9.     field[x].append(y)
  10. for e in field:
  11.     field[e].sort()
  12. answ = (0, 100001)
  13. for e in field: #e -- номер ряда
  14.     for i in range(1, len(field[e])):
  15.         if field[e][i] - field[e][i - 1] - 1 == 13:
  16.             if e > answ[0]: #если текущий номер ряда больше чем номер ряда в ответе
  17.                 answ = (e, field[e][i - 1] + 1)
  18. print(answ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement