結果

問題 No.923 オセロきりきざむたん
ユーザー gew1fw
提出日時 2025-06-12 21:43:12
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 380 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 82,076 KB
実行使用メモリ 80,240 KB
最終ジャッジ日時 2025-06-12 21:47:25
合計ジャッジ時間 6,770 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 35 WA * 49
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
grid = [input().strip() for _ in range(h)]

all_ones = True
count_zeros = 0

for row in grid:
    if '0' in row:
        all_ones = False
    count_zeros += row.count('0')

if all_ones:
    if (h * w) % 2 == 0:
        print("NO")
    else:
        print("YES")
else:
    if count_zeros % 2 == 0:
        print("YES")
    else:
        print("NO")
0