結果
| 問題 |
No.1941 CHECKER×CHECKER(1)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-09-23 15:38:24 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 677 bytes |
| コンパイル時間 | 13,017 ms |
| コンパイル使用メモリ | 389,456 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-12-22 05:22:59 |
| 合計ジャッジ時間 | 14,000 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 12 |
ソースコード
fn main() {
let grid = (0..3).map(|_| {
let mut temp = String::new();
std::io::stdin().read_line(&mut temp).ok();
let temp = temp.trim();
temp.chars().collect::<Vec<_>>()
})
.collect::<Vec<_>>();
let odds = (0..3).map(|i| (0..3).filter(|&j| (i+j) % 2 == 1).fold(true, |x, y| x && (grid[0][1] == grid[i][y]))).fold(true, |x, y| x && y);
let evens = (0..3).map(|i| (0..3).filter(|&j| (i+j) % 2 == 0).fold(true, |x, y| x && (grid[0][0] == grid[i][y]))).fold(true, |x, y| x && y);
if odds && evens && (grid[0][0] != grid[0][1]) {
println!("Yes");
} else {
println!("No");
}
}