結果

問題 No.819 Enjapma game
ユーザー convexineqconvexineq
提出日時 2021-03-23 05:53:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 341 bytes
コンパイル時間 640 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 76,124 KB
最終ジャッジ日時 2023-08-16 09:16:13
合計ジャッジ時間 5,348 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,352 KB
testcase_01 AC 72 ms
71,412 KB
testcase_02 AC 71 ms
71,168 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 69 ms
71,412 KB
testcase_06 AC 68 ms
71,236 KB
testcase_07 AC 70 ms
71,172 KB
testcase_08 WA -
testcase_09 AC 72 ms
71,100 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 77 ms
75,880 KB
testcase_14 AC 76 ms
75,704 KB
testcase_15 WA -
testcase_16 AC 76 ms
75,788 KB
testcase_17 WA -
testcase_18 AC 77 ms
75,868 KB
testcase_19 AC 77 ms
75,832 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 80 ms
75,840 KB
testcase_23 AC 77 ms
75,936 KB
testcase_24 AC 78 ms
76,036 KB
testcase_25 WA -
testcase_26 AC 76 ms
75,872 KB
testcase_27 AC 76 ms
75,776 KB
testcase_28 AC 78 ms
75,868 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h,w = map(int,input().split())
b = [input() for _ in range(h)]
r = [0,0]
cnt = 0
for i in range(h):
    for j in range(w):
        if b[i][j] == "o":
            cnt += 1
            r[(i+j)%2] += 1
if cnt==1:
    print("NO")
elif cnt%2:
    print("YES" if r[0]==0 or r[1]==0 else "NO")
else:
    print("NO" if r[0]==0 or r[1]==0 else "YES")
0