結果

問題 No.2939 Sigma Popcount Problem
ユーザー Tamiji153Tamiji153
提出日時 2024-11-28 22:21:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 794 ms / 2,000 ms
コード長 138 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 82,124 KB
実行使用メモリ 76,628 KB
最終ジャッジ日時 2024-11-28 22:21:58
合計ジャッジ時間 9,707 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,660 KB
testcase_01 AC 38 ms
52,952 KB
testcase_02 AC 43 ms
52,204 KB
testcase_03 AC 40 ms
53,016 KB
testcase_04 AC 39 ms
53,460 KB
testcase_05 AC 39 ms
52,208 KB
testcase_06 AC 38 ms
53,100 KB
testcase_07 AC 39 ms
53,072 KB
testcase_08 AC 720 ms
76,284 KB
testcase_09 AC 366 ms
76,088 KB
testcase_10 AC 449 ms
76,476 KB
testcase_11 AC 468 ms
76,264 KB
testcase_12 AC 400 ms
76,008 KB
testcase_13 AC 346 ms
76,296 KB
testcase_14 AC 297 ms
76,228 KB
testcase_15 AC 794 ms
75,964 KB
testcase_16 AC 68 ms
66,984 KB
testcase_17 AC 785 ms
76,084 KB
testcase_18 AC 736 ms
76,284 KB
testcase_19 AC 777 ms
76,628 KB
testcase_20 AC 46 ms
60,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t=int(input())
for _ in range(t):
	n=int(input())+1
	ans=0
	for i in range(60):
		ans+=n//2**(i+1)*2**i+max(0,n%2**(i+1)-2**i)
	print(ans)
0