結果

問題 No.1372 Median of Submasks
ユーザー tonyu0
提出日時 2021-02-05 21:51:47
言語 Rust
(1.83.0 + proconio)
結果
MLE  
実行時間 -
コード長 399 bytes
コンパイル時間 13,247 ms
コンパイル使用メモリ 376,708 KB
実行使用メモリ 796,672 KB
最終ジャッジ日時 2024-07-02 12:23:33
合計ジャッジ時間 13,601 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 MLE * 1 -- * 16
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::*;

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let mut a = Vec::new();
    let mut bit = n;
    while bit > 0 {
        a.push(bit);
        bit = (bit - 1) & n;
    }
    a.sort();
    println!("{}", a[a.len() / 2]);
}
0