結果

問題 No.870 無敵囲い
コンテスト
ユーザー yuki2006
提出日時 2019-08-30 22:20:18
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 96 ms / 300 ms
コード長 562 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 423 ms
コンパイル使用メモリ 20,568 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2026-03-18 16:17:46
合計ジャッジ時間 3,042 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# 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