結果

問題 No.629 グラフの中に眠る門松列
ユーザー convexineqconvexineq
提出日時 2021-03-03 18:22:40
言語 PyPy3
(7.3.13)
結果
WA  
実行時間 -
コード長 375 bytes
コンパイル時間 313 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 77,064 KB
最終ジャッジ日時 2023-07-26 20:57:11
合計ジャッジ時間 5,641 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,324 KB
testcase_01 AC 72 ms
71,324 KB
testcase_02 AC 71 ms
71,488 KB
testcase_03 AC 70 ms
71,480 KB
testcase_04 AC 69 ms
71,552 KB
testcase_05 WA -
testcase_06 AC 69 ms
71,428 KB
testcase_07 AC 69 ms
71,616 KB
testcase_08 AC 68 ms
71,324 KB
testcase_09 WA -
testcase_10 AC 69 ms
71,316 KB
testcase_11 AC 70 ms
71,512 KB
testcase_12 WA -
testcase_13 AC 71 ms
71,628 KB
testcase_14 WA -
testcase_15 AC 67 ms
71,516 KB
testcase_16 AC 66 ms
71,476 KB
testcase_17 AC 68 ms
71,380 KB
testcase_18 AC 68 ms
71,548 KB
testcase_19 AC 67 ms
71,408 KB
testcase_20 AC 69 ms
71,544 KB
testcase_21 WA -
testcase_22 AC 80 ms
75,272 KB
testcase_23 AC 87 ms
75,504 KB
testcase_24 AC 98 ms
77,020 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 89 ms
76,968 KB
testcase_28 WA -
testcase_29 AC 92 ms
76,908 KB
testcase_30 AC 94 ms
76,888 KB
testcase_31 AC 94 ms
77,064 KB
testcase_32 AC 94 ms
76,932 KB
testcase_33 WA -
testcase_34 AC 91 ms
76,788 KB
testcase_35 AC 90 ms
76,788 KB
testcase_36 AC 93 ms
77,060 KB
testcase_37 WA -
testcase_38 AC 93 ms
76,696 KB
testcase_39 AC 92 ms
76,676 KB
testcase_40 WA -
testcase_41 AC 94 ms
76,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
*a, = map(int,input().split())
g = [[] for _ in range(n)]
for _ in range(m):
    x,y = map(int,input().split())
    g[x-1].append(y-1)
    g[y-1].append(x-1)
for x in range(n):
    le = mo = 0
    for v in g[x]:
        if a[v] < x: le += 1
        if a[v] > x: mo += 1
    if le >= 2 or mo >= 2:
        print("YES")
        exit()
print("NO")
0