mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-05-10 16:20:27 +08:00
20 lines
233 B
Python
20 lines
233 B
Python
import math
|
|
|
|
N = int(input())
|
|
|
|
count = 0
|
|
e = 1
|
|
|
|
while True:
|
|
t = 1 << e
|
|
if t > N:
|
|
break
|
|
Q = N // t
|
|
if Q == 0:
|
|
e += 1
|
|
continue
|
|
m = math.isqrt(Q)
|
|
cnt += (m + 1) // 2
|
|
e += 1
|
|
|
|
print(cnt) |