Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://inf-ege.sdamgia.ru/problem?id=78049
- s = open('24_78049.txt').readline()
- s = s.replace('6', '!')
- s = s.replace('7', '!')
- s = s.replace('8', '!')
- s = s.replace('9', '!')
- s = s.split('!')
- answ = 0
- for e in s:
- for l in range(len(e)):
- for r in range(l, len(e)):
- S = e[l:r+1]
- if (S[0] != '-') and ('--' not in S) and ('**' not in S) and ('*-' not in S):
- try:
- eval(S)
- except Exception:
- pass #ничего не делать
- else:
- if len(S) > answ:
- answ = len(S)
- print(answ)
Advertisement
Add Comment
Please, Sign In to add comment