Advertisement
nq1s788

сколько ip-адресов с кол-вом единиц не кратным 5

Sep 19th, 2024
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.16 KB | None | 0 0
  1. #https://inf-ege.sdamgia.ru/problem?id=70540
  2. cnt = 0
  3. for x in range(0, 2048):
  4.     s = bin(x)[2:]
  5.     if (s.count('1') + 8) % 5 != 0:
  6.         cnt += 1
  7. print(cnt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement