結果
| 問題 | No.2939 Sigma Popcount Problem |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2026-01-09 01:31:23 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 665 ms / 2,000 ms |
| コード長 | 263 bytes |
| 記録 | |
| コンパイル時間 | 216 ms |
| コンパイル使用メモリ | 82,252 KB |
| 実行使用メモリ | 77,528 KB |
| 最終ジャッジ日時 | 2026-01-09 01:31:31 |
| 合計ジャッジ時間 | 8,069 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
def solve():
N = int(input())
res = 0
for i in range(1, 60):
d, m = divmod(N+1, 2 ** i)
res += d * (2**(i-1))
res += max(0, m - 2**(i-1))
return res
T = int(input())
for i in range(T):
ans = solve()
print(ans)
norioc