Advertisement
nq1s788

5 (с двоичной)

Jan 17th, 2024
755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. answ = 1000000 #текущий наименьший найденый ответ
  2. for n in range(1000000):
  3.     s = bin(n)[2:]
  4.     if s.count('1') % 2 == 0:
  5.         s += '00'
  6.     else:
  7.         s += '11'
  8.     r = int(s, 2)
  9.     if r > 114:
  10.         answ = min(answ, r)
  11. print(answ)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement