Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #https://inf-ege.sdamgia.ru/problem?id=63028
- answ = 0
- for x in range(0, 10):
- for y in range(0, 10):
- for z in range(0, 10):
- s = '0' + '1' * x + '2' * y + '3' * z + '0'
- while '00' not in s:
- s = s.replace('01', '220')
- s = s.replace('02', '1013')
- s = s.replace('03', '120')
- if s.count('1') == 13 and s.count('2') == 18:
- answ = max(answ, 2 + x + y + z)
- print(answ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement