結果

問題 No.629 グラフの中に眠る門松列
ユーザー syunsukesyunsuke
提出日時 2019-06-06 00:17:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 475 ms / 4,000 ms
コード長 460 bytes
コンパイル時間 807 ms
コンパイル使用メモリ 81,788 KB
実行使用メモリ 76,520 KB
最終ジャッジ日時 2023-10-23 20:29:50
合計ジャッジ時間 5,634 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,520 KB
testcase_01 AC 35 ms
53,520 KB
testcase_02 AC 35 ms
53,520 KB
testcase_03 AC 34 ms
53,520 KB
testcase_04 AC 34 ms
53,520 KB
testcase_05 AC 39 ms
53,520 KB
testcase_06 AC 35 ms
53,520 KB
testcase_07 AC 38 ms
53,520 KB
testcase_08 AC 36 ms
53,520 KB
testcase_09 AC 34 ms
53,520 KB
testcase_10 AC 35 ms
53,520 KB
testcase_11 AC 35 ms
53,520 KB
testcase_12 AC 34 ms
53,520 KB
testcase_13 AC 34 ms
53,520 KB
testcase_14 AC 34 ms
53,520 KB
testcase_15 AC 35 ms
53,520 KB
testcase_16 AC 35 ms
53,520 KB
testcase_17 AC 35 ms
53,520 KB
testcase_18 AC 34 ms
53,520 KB
testcase_19 AC 34 ms
53,520 KB
testcase_20 AC 35 ms
53,520 KB
testcase_21 AC 78 ms
68,260 KB
testcase_22 AC 92 ms
70,352 KB
testcase_23 AC 89 ms
72,948 KB
testcase_24 AC 471 ms
76,360 KB
testcase_25 AC 475 ms
76,252 KB
testcase_26 AC 377 ms
76,116 KB
testcase_27 AC 92 ms
76,472 KB
testcase_28 AC 50 ms
63,844 KB
testcase_29 AC 88 ms
76,256 KB
testcase_30 AC 92 ms
76,508 KB
testcase_31 AC 94 ms
76,396 KB
testcase_32 AC 91 ms
76,520 KB
testcase_33 AC 88 ms
76,312 KB
testcase_34 AC 89 ms
76,256 KB
testcase_35 AC 89 ms
76,520 KB
testcase_36 AC 92 ms
76,352 KB
testcase_37 AC 84 ms
76,268 KB
testcase_38 AC 102 ms
76,520 KB
testcase_39 AC 87 ms
76,256 KB
testcase_40 AC 77 ms
74,624 KB
testcase_41 AC 83 ms
76,256 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M=map(int,input().split())
a=list(map(int,input().split()))
a=[0]+a

L=[[]for i in range(N+1)]

for i in range(M):
    u,v=map(int,input().split())
    L[u].append(v)
    L[v].append(u)
ans=0
for i in range(1,N+1):
    for j in L[i]:
        for k in L[j]:
            for l in L[k]:
                if a[k]>a[j]>a[l] or a[k]>a[l]>a[j] or a[j]>a[l]>a[k] or a[l]>a[j]>a[k]:
                    ans+=1
if ans==0:
    print("NO")
else:
    print("YES")
        
0