Accepted
Code
t = int(input())
for _ in range(t):
n = int(input())
k = 1
while(k*2<n):
k = k*2
ans = (n*(n-1))//2
while(k):
ans += k//2
k = k//2
print(ans)
Information
- Submit By
- Type
- Submission
- Problem
- P1026 LUFA cup 2024
- Language
- Python 3 (Python 3.12.3)
- Submit At
- 2024-01-14 09:22:34
- Judged At
- 2024-11-11 03:43:31
- Judged By
- Score
- 100
- Total Time
- 157ms
- Peak Memory
- 3.281 MiB