結果

問題 No.1372 Median of Submasks
ユーザー Zihua Wu
提出日時 2022-01-13 17:59:51
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 500 bytes
コンパイル時間 12,879 ms
コンパイル使用メモリ 376,840 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-17 08:05:43
合計ジャッジ時間 14,078 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

fn read_items<T>() -> Vec<T>
where
    T: std::str::FromStr,
    <T as std::str::FromStr>::Err: std::fmt::Debug,
{
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    return line
        .trim()
        .split(" ")
        .filter(|&s| s.len() > 0)
        .map(|s| s.parse::<T>().unwrap())
        .collect();
}
fn main() {
    let n = read_items::<usize>()[0];

    let mut ans = 1;
    while ans * 2 <= n {
        ans *= 2;
    }

    println!("{}", ans);
}
0