結果
| 問題 | No.870 無敵囲い | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2019-09-26 14:27:14 | 
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 27 ms / 300 ms | 
| コード長 | 488 bytes | 
| コンパイル時間 | 135 ms | 
| コンパイル使用メモリ | 12,416 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-06-29 06:25:35 | 
| 合計ジャッジ時間 | 1,292 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 18 | 
ソースコード
N = int(input())
f = [[-1] * 9 for _ in range(9)]
d = []
for _ in range(N):
    x1, y1, x2, y2 = map(int, input().split())
    if f[y1 - 1][x1 - 1] == -1:
        f[y2 - 1][x2 - 1] = len(d) + 1
        d.append('{}{}'.format(x1 - 1, y1 - 1))
    else:
        f[y2 - 1][x2 - 1] = f[y1 - 1][x1 - 1]
    f[y1 - 1][x1 - 1] = 0
a = [x for x in f[7][3:6] if x > 0]
if len(a) == 3 and d[a[0] - 1] == '28' and d[a[1] - 1] == '17' and d[a[2] - 1] == '68':
    print('YES')
else:
    print('NO')
            
            
            
        