結果
問題 | No.923 オセロきりきざむたん |
ユーザー |
![]() |
提出日時 | 2025-03-26 16:00:07 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 683 bytes |
コンパイル時間 | 525 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 87,008 KB |
最終ジャッジ日時 | 2025-03-26 16:01:17 |
合計ジャッジ時間 | 8,924 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 39 WA * 45 |
ソースコード
H, W = map(int, input().split())grid = []for _ in range(H):line = input().strip()grid.append([int(c) for c in line])# Calculate the desired flip counts (f_ij = 1 - A_ij)total = 0column_sums = [0] * Wfor i in range(H):for j in range(W):f = 1 - grid[i][j]total += fcolumn_sums[j] += ftotal_mod = total % 2possible = True# Check total conditionif total_mod != 0:possible = Falseelse:# Check each column's conditionfor j in range(W):sum_col = column_sums[j] % 2expected = (H - 1) % 2if sum_col != expected:possible = Falsebreakprint("YES" if possible else "NO")