結果

問題 No.1219 Mancala Combo
ユーザー ikdikd
提出日時 2020-09-04 23:00:59
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 1,051 bytes
コンパイル時間 10,730 ms
コンパイル使用メモリ 385,484 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-05-05 03:32:06
合計ジャッジ時間 12,021 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 WA -
testcase_02 AC 0 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 0 ms
5,376 KB
testcase_05 WA -
testcase_06 AC 1 ms
5,376 KB
testcase_07 WA -
testcase_08 AC 1 ms
5,376 KB
testcase_09 WA -
testcase_10 AC 1 ms
5,376 KB
testcase_11 WA -
testcase_12 AC 1 ms
5,376 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 1 ms
5,376 KB
testcase_16 AC 1 ms
5,376 KB
testcase_17 WA -
testcase_18 AC 15 ms
5,376 KB
testcase_19 WA -
testcase_20 AC 16 ms
5,376 KB
testcase_21 WA -
testcase_22 AC 13 ms
5,376 KB
testcase_23 WA -
testcase_24 AC 12 ms
5,376 KB
testcase_25 WA -
testcase_26 AC 15 ms
5,376 KB
testcase_27 WA -
testcase_28 AC 22 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

pub struct ProconReader<R: std::io::Read> {
    reader: R,
}

impl<R: std::io::Read> ProconReader<R> {
    pub fn new(reader: R) -> Self {
        Self { reader }
    }
    pub fn get<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .reader
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&byte| byte == b' ' || byte == b'\n' || byte == b'\r')
            .take_while(|&byte| byte != b' ' && byte != b'\n' && byte != b'\r')
            .collect::<Vec<_>>();
        std::str::from_utf8(&buf)
            .unwrap()
            .parse()
            .ok()
            .expect("Parse Error.")
    }
}

fn main() {
    let stdin = std::io::stdin();
    let mut rd = ProconReader::new(stdin.lock());

    let n: usize = rd.get();
    let a: Vec<i32> = (0..n).map(|_| rd.get()).collect();
    println!(
        "{}",
        if a.iter().zip(1..=(n as i32)).all(|(&x, i)| x <= i) {
            "Yes"
        } else {
            "No"
        }
    );
}
0