nq1s788

24 (макс кол-во букв после A)

Jun 4th, 2025
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. #https://inf-ege.sdamgia.ru/problem?id=55611
  2. data = open('24 (1).txt').readlines()
  3. CNT = {}
  4. for e in data:
  5.     cnt = {}
  6.     for i in range(1, len(e)):
  7.         if e[i - 1] == 'A':
  8.             if e[i] not in cnt:
  9.                 cnt[e[i]] = 0
  10.             cnt[e[i]] += 1
  11.     mx = max(cnt.values())
  12.     for c in cnt:
  13.         if cnt[c] == mx:
  14.             if c not in CNT:
  15.                 CNT[c] = 0
  16.             CNT[c] += 1
  17. print(max(CNT.values()))
Advertisement
Add Comment
Please, Sign In to add comment