結果
問題 | No.819 Enjapma game |
ユーザー |
![]() |
提出日時 | 2019-04-21 19:50:16 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 713 bytes |
コンパイル時間 | 89 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-10-07 06:22:36 |
合計ジャッジ時間 | 1,918 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 11 WA * 15 |
ソースコード
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 == 1: print('YES') else: print('NO') else: if odd == 1: print('NO') else: print('YES') else: if even % 2 == 1: if odd == 0: print('NO') else: print('YES') else: if odd == 0: print('YES') else: print('NO')