結果
| 問題 | No.3430 Flip the Grid |
| コンテスト | |
| ユーザー |
urectanc
|
| 提出日時 | 2026-01-12 16:16:20 |
| 言語 | Rust (1.92.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 110 ms / 2,000 ms |
| コード長 | 469 bytes |
| 記録 | |
| コンパイル時間 | 26,417 ms |
| コンパイル使用メモリ | 416,092 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-01-12 16:16:50 |
| 合計ジャッジ時間 | 28,827 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
use proconio::input;
fn main() {
input! {
h: usize, w: usize,
a: [[u8; w]; h],
}
let mut cnt_row = vec![0; h];
let mut cnt_col = vec![0; w];
for i in 0..h {
for j in 0..w {
cnt_row[i] ^= a[i][j];
cnt_col[j] ^= a[i][j];
}
}
let x = cnt_row.iter().filter(|&&x| x == 1).count();
let y = cnt_col.iter().filter(|&&x| x == 1).count();
let ans = x.max(y);
println!("{ans}");
}
urectanc