結果
| 問題 |
No.2939 Sigma Popcount Problem
|
| コンテスト | |
| ユーザー |
nikoro256
|
| 提出日時 | 2024-10-18 22:32:40 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 626 ms / 2,000 ms |
| コード長 | 219 bytes |
| コンパイル時間 | 453 ms |
| コンパイル使用メモリ | 82,760 KB |
| 実行使用メモリ | 76,696 KB |
| 最終ジャッジ日時 | 2024-10-18 22:52:16 |
| 合計ジャッジ時間 | 6,789 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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