結果
問題 | No.2939 Sigma Popcount Problem |
ユーザー |
![]() |
提出日時 | 2024-10-18 22:36:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 344 ms / 2,000 ms |
コード長 | 210 bytes |
コンパイル時間 | 451 ms |
コンパイル使用メモリ | 82,380 KB |
実行使用メモリ | 76,528 KB |
最終ジャッジ日時 | 2024-10-18 22:52:49 |
合計ジャッジ時間 | 4,814 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
for _ in range(int(input())): n = int(input()) ans = n&1 for i in range(1, 41): ans += (1 << (i-1))*(n >> i) if n >> i & 1: ans += (n & ((1 << i) - 1)) + 1 print(ans)