Advertisement
nq1s788

24 соседние различные

Nov 9th, 2024
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. #https://inf-ege.sdamgia.ru/problem?id=27421
  2. s = open('24_demo.txt').readline()
  3. answ = 1
  4. cnt = 1 #длина тек строки
  5. for i in range(1, len(s)):
  6.     if s[i] != s[i - 1]:
  7.         cnt += 1
  8.         answ = max(answ, cnt)
  9.     else:
  10.         cnt = 1
  11. print(answ)
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement