結果

問題 No.1941 CHECKER×CHECKER(1)
ユーザー DrDrpilotDrDrpilot
提出日時 2022-05-26 18:47:36
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 139 ms
コンパイル使用メモリ 11,888 KB
実行使用メモリ 10,044 KB
最終ジャッジ日時 2023-10-20 19:31:12
合計ジャッジ時間 1,194 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,044 KB
testcase_01 AC 27 ms
10,044 KB
testcase_02 AC 26 ms
10,044 KB
testcase_03 AC 27 ms
10,044 KB
testcase_04 AC 26 ms
10,044 KB
testcase_05 AC 26 ms
10,044 KB
testcase_06 AC 27 ms
10,044 KB
testcase_07 AC 26 ms
10,044 KB
testcase_08 AC 26 ms
10,044 KB
testcase_09 AC 26 ms
10,044 KB
testcase_10 AC 25 ms
10,044 KB
testcase_11 AC 26 ms
10,044 KB
testcase_12 AC 26 ms
10,044 KB
testcase_13 AC 27 ms
10,044 KB
testcase_14 AC 27 ms
10,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

g=[input() for _ in range(3)]
def check(i,j):
    f=True
    dy=[1,0,-1,0];dx=[0,1,0,-1]
    for k in range(4):
        y=i+dy[k];x=j+dx[k]
        if 0<=y<3 and 0<=x<3:
            if g[i][j]==g[y][x]:
                f=False
    return f
ans=True
for i in range(3):
    for j in range(3):
        ans=ans and check(i,j)
print('Yes' if ans else 'No')
0