結果
問題 | No.239 にゃんぱすー |
ユーザー |
![]() |
提出日時 | 2022-12-09 21:40:12 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 707 bytes |
コンパイル時間 | 27,439 ms |
コンパイル使用メモリ | 383,984 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-14 21:09:11 |
合計ジャッジ時間 | 18,364 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
fn main() {let mut n = String::new();std::io::stdin().read_line(&mut n).ok();let n: usize = n.trim().parse().unwrap();let mut xx = String::new();std::io::Read::read_to_string(&mut std::io::stdin(), &mut xx).ok();let xx: Vec<String> = xx.split_whitespace().flat_map(str::parse).collect();let mut answer = None;for i in 0..n {if (0..n).map(|j| &xx[j * n + i]).all(|g| g == "-" || g == "nyanpass"){if answer.is_some() {println!("-1");return;}answer = Some(i);}}answer.map_or_else(|| println!("-1"), |i| println!("{}", i + 1));}