結果
問題 | No.2939 Sigma Popcount Problem |
ユーザー |
|
提出日時 | 2024-10-18 21:27:37 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 535 ms / 2,000 ms |
コード長 | 242 bytes |
コンパイル時間 | 298 ms |
コンパイル使用メモリ | 82,268 KB |
実行使用メモリ | 76,468 KB |
最終ジャッジ日時 | 2024-10-18 22:00:22 |
合計ジャッジ時間 | 6,116 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 18 |
ソースコード
def slv(): n=int(input()) n+=1 ans=0 for i in range(60): ans+=(1<<i)*(n//(2<<i)) m=n%(2<<i) ans+=max(0,m-(1<<i)) # print(i,ans) print(ans) t=int(input()) while t: t-=1 slv()