結果

問題 No.819 Enjapma game
ユーザー poet_nayuta
提出日時 2019-04-21 19:58:49
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 729 bytes
コンパイル時間 79 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-10-07 06:35:21
合計ジャッジ時間 1,815 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 15 WA * 11
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, input().strip().split(' '))

odd = 0
even = 0

for i in range(H):
    row = input().strip()
    for j in range(W):
        if row[j] != 'o':
            continue

        state = H - i + j
        if state % 2 == 0:
            even += 1
        else:
            odd += 1

if odd % 2 == 1:
    if even % 2 == 1:
        if odd % 2 == 1:
            print('YES')
        else:
            print('NO')
    else:
        if odd % 2 == 1:
            print('NO')
        else:
            print('YES')
else:
    if even % 2 == 1:
        if odd % 2 == 0:
            print('NO')
        else:
            print('YES')
    else:
        if odd % 2 == 0:
            print('YES')
        else:
            print('NO')
0