結果

問題 No.737 PopCount
ユーザー 特命ログイン特命ログイン
提出日時 2018-09-28 23:18:57
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 527 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 158,368 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-20 12:03:04
合計ジャッジ時間 914 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 1 ms
6,944 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::{stdin, Read};

fn main() {
    let mut buf = String::new();
    stdin().read_to_string(&mut buf).unwrap();
    let mut tok = buf.split_whitespace();
    let mut get = || tok.next().unwrap();
    macro_rules! get {
        ($t:ty) => (get().parse::<$t>().unwrap());
        () => (get!(i64));
    }
    
    let n = get!();
    let mut ans = 0;
    for i in 0..63 {
        let x = 1 << i;
        ans += n / x;
        ans %= 1_000_000_007;
    }
    ans *= n;
    ans %= 1_000_000_007;
    println!("{}", ans);
}
0