Advertisement
nq1s788

24

Jun 8th, 2025
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.51 KB | None | 0 0
  1. #24 https://kpolyakov.spb.ru/school/ege/gen.php?action=viewVar&select=7FFFFFF&answers=on&varId=91034
  2. s = open('24.txt').readline()
  3. alph = '1234567890ABCDEF'
  4. c = ''
  5. answ = 0
  6. for e in s:
  7.     if e not in alph:
  8.         if len(c) != 0:
  9.             if '0' in c:
  10.                 lst0 = c.rindex('0')
  11.                 c = c[:lst0 + 1]
  12.                 while len(c) > 0 and c[0] == '0':
  13.                     c = c[1:]
  14.                 answ = max(answ, len(c))
  15.             c = ''
  16.     else:
  17.         c += e
  18. print(answ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement