結果

問題 No.870 無敵囲い
ユーザー yuki2006
提出日時 2019-08-30 22:20:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 300 ms
コード長 562 bytes
コンパイル時間 84 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-06-29 06:20:22
合計ジャッジ時間 1,446 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

# yukicoder@python3
N = int(input())

A = 28
B = 39
C = 79

mat = [[0 for j in range(1, 11)] for i in range(1, 11)]
mat[2][8] = 1
mat[3][9] = 2
mat[7][9] = 3

for i in range(N):
    A = input().split()
    x1, y1, x2, y2 = map(int, A)
    # print(i,A)

    if mat[x1][y1] == 0:
        mat[x1][y1] = 10

    # if mat[x2][y2] > 0:
    #     print(mat[x2][y2])
    assert mat[x1][y1] > 0
    assert mat[x2][y2] <= 0
    mat[x2][y2] = mat[x1][y1]
    mat[x1][y1] = -1
if mat[5][8] == 1 and mat[4][8] == 2 and mat[6][8] == 3:
    print("YES")
else:
    print("NO")

0