結果
| 問題 | No.2939 Sigma Popcount Problem |
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2024-10-18 22:32:40 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 313 ms / 2,000 ms |
| コード長 | 219 bytes |
| 記録 | |
| コンパイル時間 | 391 ms |
| コンパイル使用メモリ | 85,072 KB |
| 実行使用メモリ | 81,244 KB |
| 最終ジャッジ日時 | 2026-05-05 15:48:56 |
| 合計ジャッジ時間 | 4,362 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
T=int(input())
exp2=[2**i for i in range(71)]
for _ in range(T):
N=int(input())
ans=0
for i in range(70):
tmp=(N+1)%exp2[i+1]
ans+=((N+1)-tmp)//2+max(0,(N+1)%exp2[i+1]-exp2[i])
print(ans)
nikoro256