結果

問題 No.870 無敵囲い
ユーザー stngstng
提出日時 2022-07-23 16:13:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 300 ms
コード長 373 bytes
コンパイル時間 260 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 52,096 KB
最終ジャッジ日時 2024-07-05 05:24:53
合計ジャッジ時間 1,824 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
xy = [[int(i) for i in input().split()] for j in range(n)]
a = [2,8]
b = [3,9]
c = [7,9]

for i in range(n):
    x1,y1,x2,y2 = xy[i]
    xy1 = [x1,y1]
    xy2 = [x2,y2]
    if xy1 == a:
        a = xy2
    elif xy1 == b:
        b = xy2
    elif xy1 == c:
        c = xy2

if a == [5,8] and b == [4,8] and c == [6,8]:
    print("YES")
else:
    print("NO")
0