結果

問題 No.629 グラフの中に眠る門松列
ユーザー convexineqconvexineq
提出日時 2021-03-03 18:24:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 381 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 71,320 KB
最終ジャッジ日時 2024-04-14 10:22:22
合計ジャッジ時間 3,857 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,740 KB
testcase_01 WA -
testcase_02 AC 40 ms
52,316 KB
testcase_03 AC 40 ms
52,408 KB
testcase_04 AC 40 ms
52,412 KB
testcase_05 AC 39 ms
52,200 KB
testcase_06 AC 39 ms
53,144 KB
testcase_07 AC 39 ms
52,404 KB
testcase_08 AC 39 ms
52,200 KB
testcase_09 AC 39 ms
52,424 KB
testcase_10 AC 38 ms
52,068 KB
testcase_11 AC 38 ms
52,200 KB
testcase_12 AC 39 ms
51,880 KB
testcase_13 AC 39 ms
52,804 KB
testcase_14 WA -
testcase_15 AC 39 ms
52,868 KB
testcase_16 AC 39 ms
52,660 KB
testcase_17 AC 39 ms
52,860 KB
testcase_18 AC 39 ms
52,724 KB
testcase_19 AC 39 ms
52,212 KB
testcase_20 AC 39 ms
52,820 KB
testcase_21 WA -
testcase_22 AC 54 ms
62,516 KB
testcase_23 AC 56 ms
63,164 KB
testcase_24 AC 65 ms
71,012 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 69 ms
70,772 KB
testcase_28 WA -
testcase_29 AC 68 ms
69,592 KB
testcase_30 AC 68 ms
71,320 KB
testcase_31 AC 68 ms
70,660 KB
testcase_32 AC 68 ms
70,124 KB
testcase_33 WA -
testcase_34 AC 67 ms
69,952 KB
testcase_35 AC 68 ms
70,204 KB
testcase_36 AC 68 ms
71,072 KB
testcase_37 WA -
testcase_38 AC 67 ms
70,864 KB
testcase_39 AC 66 ms
70,304 KB
testcase_40 WA -
testcase_41 AC 66 ms
68,644 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] < a[x]: le += 1
        if a[v] > a[x]: mo += 1
    if le >= 2 or mo >= 2:
        print("YES")
        exit()
print("NO")
0