結果

問題 No.2939 Sigma Popcount Problem
コンテスト
ユーザー あるふぁ
提出日時 2026-09-20 19:45:41
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 86 ms / 2,000 ms
+ 323µs
コード長 308 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 14,012 ms
コンパイル使用メモリ 190,660 KB
実行使用メモリ 10,032 KB
最終ジャッジ日時 2026-09-20 19:46:08
合計ジャッジ時間 8,362 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use proconio::input;

fn main(){
    input!{
        t: usize,
        ns: [i64; t],
    }

    for n in ns{
        let mut bit = 0_i64;
        for i in 0..40{
            bit += n/(2_i64<<i)*(1_i64<<i);
            bit += 0.max((n%(2_i64<<i))-(1_i64<<i)+1);
        }
        println!("{}", bit);
    }
}
0