結果

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

ソースコード

diff #

N = int(input())
A = "2 8"
B = "3 9"
C = "7 9"

for i in range(N):
    S =input()
    if A == S[:3]:
        A = S[4:]
    if B == S[:3]:
        B = S[4:]
    if C == S[:3]:
        C = S[4:]

if A == "5 8" and B == "4 8" and C == "6 8":
    print("YES")
else:
    print("NO")
0