結果
| 問題 | No.870 無敵囲い | 
| コンテスト | |
| ユーザー |  asterisk_tenhou | 
| 提出日時 | 2019-10-31 20:07:43 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 30 ms / 300 ms | 
| コード長 | 616 bytes | 
| コンパイル時間 | 75 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-06-29 06:26:59 | 
| 合計ジャッジ時間 | 1,309 ms | 
| ジャッジサーバーID (参考情報) | judge5 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
ソースコード
N = int(input())
list = []
for i in range(N):
    n = input()    
    m = n.split()
    p = [int(i) for i in m]
    list.append(p)
else:
    a = [2, 8]
    b = [3, 9]
    c = [7, 9]
    while len(list) != 0:
        r = list[0]
        q = r[0:2]
        if a == q:
            a = r[2:4]
            del list[0]
        elif b == q:
            b = r[2:4]
            del list[0]
        elif c == q:
            c = r[2:4]
            del list[0]
        else:
            del list[0]
    else:
        if a == [5, 8] and b == [4, 8] and c == [6, 8]:
            print("YES")
        else:
            print("NO")
            
            
            
        