結果

問題 No.47 ポケットを叩くとビスケットが2倍
ユーザー mtwtkman
提出日時 2019-10-14 19:16:07
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 404 bytes
コンパイル時間 21,952 ms
コンパイル使用メモリ 377,396 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 09:01:58
合計ジャッジ時間 23,375 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

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

fn read_stdin() -> Vec<String> {
    let mut buffer = String::new();
    io::stdin().read_to_string(&mut buffer).ok();
    buffer.trim().split('\n').map(|s| s.to_string()).collect()
}

fn main() {
    let input = read_stdin();
    let n = *&input[0].parse::<usize>().unwrap();

    let mut x: usize = 0;

    while n > 1 << x {
        x += 1;
    }

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