nq1s788

13 кол-во ip-адресов (ipaddress)

Jan 31st, 2026
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. from ipaddress import *
  2. answ = 1000000000000
  3. for mask in range(1, 21):
  4.     net = ip_network('113.188.14.51/' + str(mask), 0)
  5.     if ip_address('113.188.6.86') in net:
  6.         cnt = 0
  7.         for ip in net:
  8.             if f'{ip:b}'.count('1') == 17:
  9.                 cnt += 1
  10.         answ = min(answ, cnt)
  11. print(answ)
Advertisement
Add Comment
Please, Sign In to add comment