結果

問題 No.629 グラフの中に眠る門松列
ユーザー convexineqconvexineq
提出日時 2021-03-03 18:22:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 375 bytes
コンパイル時間 193 ms
コンパイル使用メモリ 82,468 KB
実行使用メモリ 72,024 KB
最終ジャッジ日時 2024-04-14 10:21:23
合計ジャッジ時間 4,090 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,380 KB
testcase_01 AC 39 ms
53,424 KB
testcase_02 AC 38 ms
52,500 KB
testcase_03 AC 39 ms
52,992 KB
testcase_04 AC 38 ms
52,256 KB
testcase_05 WA -
testcase_06 AC 38 ms
53,224 KB
testcase_07 AC 38 ms
53,140 KB
testcase_08 AC 39 ms
53,672 KB
testcase_09 WA -
testcase_10 AC 39 ms
53,152 KB
testcase_11 AC 38 ms
53,136 KB
testcase_12 WA -
testcase_13 AC 38 ms
52,588 KB
testcase_14 WA -
testcase_15 AC 38 ms
52,900 KB
testcase_16 AC 37 ms
52,924 KB
testcase_17 AC 38 ms
53,856 KB
testcase_18 AC 39 ms
53,708 KB
testcase_19 AC 40 ms
52,416 KB
testcase_20 AC 37 ms
52,780 KB
testcase_21 WA -
testcase_22 AC 54 ms
62,480 KB
testcase_23 AC 53 ms
62,504 KB
testcase_24 AC 68 ms
70,496 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 64 ms
70,528 KB
testcase_28 WA -
testcase_29 AC 64 ms
69,644 KB
testcase_30 AC 65 ms
71,224 KB
testcase_31 AC 65 ms
70,808 KB
testcase_32 AC 65 ms
70,596 KB
testcase_33 WA -
testcase_34 AC 65 ms
69,360 KB
testcase_35 AC 64 ms
69,148 KB
testcase_36 AC 65 ms
71,124 KB
testcase_37 WA -
testcase_38 AC 65 ms
71,712 KB
testcase_39 AC 64 ms
69,552 KB
testcase_40 WA -
testcase_41 AC 63 ms
69,028 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