結果

問題 No.1941 CHECKER×CHECKER(1)
ユーザー hiragnhiragn
提出日時 2022-11-09 09:08:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 521 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 10,888 KB
実行使用メモリ 8,104 KB
最終ジャッジ日時 2023-09-29 21:22:00
合計ジャッジ時間 1,559 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 15 ms
8,008 KB
testcase_02 AC 15 ms
7,956 KB
testcase_03 WA -
testcase_04 AC 15 ms
7,912 KB
testcase_05 AC 15 ms
8,064 KB
testcase_06 AC 14 ms
7,912 KB
testcase_07 AC 15 ms
8,056 KB
testcase_08 AC 15 ms
7,996 KB
testcase_09 AC 15 ms
7,872 KB
testcase_10 AC 16 ms
7,980 KB
testcase_11 AC 15 ms
7,952 KB
testcase_12 AC 15 ms
8,008 KB
testcase_13 AC 15 ms
7,880 KB
testcase_14 AC 15 ms
8,080 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools


def main():
    field = []
    for _ in range(3):
        field.append(input())

    dx = [1, 0, -1, 0, 1, -1, -1, 1]
    dy = [0, 1, 0, -1, 1, 1, -1, -1]
    for i, j in itertools.product(range(3), range(3)):
        for k in range(4):
            x, y = i + dx[k], j + dy[k]
            if x < 0 or x > 2 or y < 0 or y > 2:
                continue
            if field[x][y] == field[i][j]:
                print("No")
                exit()
    print("yes")


if __name__ == "__main__":
    main()
0