結果
| 問題 | No.1219 Mancala Combo |
| コンテスト | |
| ユーザー |
ikd
|
| 提出日時 | 2020-09-04 23:00:59 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,051 bytes |
| 記録 | |
| コンパイル時間 | 11,915 ms |
| コンパイル使用メモリ | 395,316 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-26 20:55:24 |
| 合計ジャッジ時間 | 13,077 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 14 WA * 12 |
ソースコード
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"
}
);
}
ikd