結果
問題 | No.2939 Sigma Popcount Problem |
ユーザー |
![]() |
提出日時 | 2024-10-18 21:34:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 543 ms / 2,000 ms |
コード長 | 167 bytes |
コンパイル時間 | 229 ms |
コンパイル使用メモリ | 82,456 KB |
実行使用メモリ | 76,364 KB |
最終ジャッジ日時 | 2024-10-18 22:22:37 |
合計ジャッジ時間 | 6,215 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
for _ in range(int(input())): N=int(input())+1 ans=0 for i in range(50): tw=2**i cnt=N//(tw*2) amr=N%(tw*2) ans+=cnt*tw ans+=max(amr-tw,0) print(ans)