Advertisement
nq1s788

12

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