結果
| 問題 |
No.2939 Sigma Popcount Problem
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-11-14 20:04:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 256 bytes |
| コンパイル時間 | 426 ms |
| コンパイル使用メモリ | 82,440 KB |
| 実行使用メモリ | 138,572 KB |
| 最終ジャッジ日時 | 2024-11-14 20:04:43 |
| 合計ジャッジ時間 | 41,278 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 5 TLE * 13 |
ソースコード
def popcount(n):
return bin(n).count('1')
num = int(input()) # テストケースの数
for _ in range(num):
a = int(input()) # 各テストケースのN
result = 0
for i in range(1, a+1):
result += popcount(i)
print(result)