結果
| 問題 | No.2692 How Many Times Reached? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-07-31 17:56:28 |
| 言語 | Rust (1.97.1 + proconio + num + itertools + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 0 ms / 2,000 ms |
| + 942µs | |
| コード長 | 569 bytes |
| 記録 | |
| コンパイル時間 | 759 ms |
| コンパイル使用メモリ | 186,556 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-24 18:07:23 |
| 合計ジャッジ時間 | 3,447 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 43 |
ソースコード
use std::io::Read;
fn j(c: Vec<char>) -> bool {
!c.contains(&'B') && c.iter().filter(|&&x| x == '.').count() == 1
}
fn main() {
let mut s = String::new();
std::io::stdin().read_to_string(&mut s).ok();
let c: Vec<Vec<_>> =
s.lines().skip(1).map(|l| l.chars().collect()).collect();
let n = c.len();
let mut a = 0;
a += j((0..n).map(|i| c[i][i]).collect()) as u8;
a += j((0..n).map(|i| c[i][n - i - 1]).collect()) as u8;
for i in 0..n {
a += j((0..n).map(|j| c[i][j]).collect()) as u8;
a += j((0..n).map(|j| c[j][i]).collect()) as u8;
}
println!("{a}")
}