scripts/ege/Вариант/5.py

15 lines
295 B
Python
Raw Normal View History

2023-05-05 00:45:01 +03:00
def f(n):
bin_n = bin(n)[2:]
if len(bin_n) % 2 == 0:
nk = len(bin_n) // 2
bin_n = bin_n[:nk] + "000" + bin_n[nk:]
else:
bin_n = "1" + bin_n + "01"
return int(bin_n, 2)
for n in range(100):
if f(n) > 100:
print(n)
break