結果

問題 No.629 グラフの中に眠る門松列
ユーザー Bioinfo_KBioinfo_K
提出日時 2018-01-05 22:40:22
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 546 bytes
コンパイル時間 148 ms
コンパイル使用メモリ 10,896 KB
実行使用メモリ 8,964 KB
最終ジャッジ日時 2023-08-24 21:00:16
合計ジャッジ時間 2,381 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,616 KB
testcase_01 AC 19 ms
8,620 KB
testcase_02 AC 18 ms
8,504 KB
testcase_03 AC 18 ms
8,480 KB
testcase_04 AC 18 ms
8,624 KB
testcase_05 AC 18 ms
8,512 KB
testcase_06 AC 18 ms
8,556 KB
testcase_07 AC 17 ms
8,508 KB
testcase_08 AC 18 ms
8,648 KB
testcase_09 AC 18 ms
8,648 KB
testcase_10 AC 17 ms
8,552 KB
testcase_11 AC 17 ms
8,556 KB
testcase_12 AC 18 ms
8,560 KB
testcase_13 AC 18 ms
8,556 KB
testcase_14 WA -
testcase_15 AC 17 ms
8,568 KB
testcase_16 AC 18 ms
8,560 KB
testcase_17 AC 17 ms
8,552 KB
testcase_18 AC 18 ms
8,560 KB
testcase_19 AC 18 ms
8,596 KB
testcase_20 AC 18 ms
8,552 KB
testcase_21 WA -
testcase_22 AC 20 ms
8,708 KB
testcase_23 AC 20 ms
8,764 KB
testcase_24 AC 22 ms
8,684 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 23 ms
8,924 KB
testcase_28 WA -
testcase_29 AC 22 ms
8,760 KB
testcase_30 AC 23 ms
8,912 KB
testcase_31 AC 24 ms
8,868 KB
testcase_32 AC 24 ms
8,904 KB
testcase_33 WA -
testcase_34 AC 22 ms
8,760 KB
testcase_35 AC 22 ms
8,772 KB
testcase_36 AC 23 ms
8,964 KB
testcase_37 WA -
testcase_38 AC 23 ms
8,908 KB
testcase_39 AC 22 ms
8,868 KB
testcase_40 WA -
testcase_41 AC 20 ms
8,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,collections
from operator import itemgetter
sys.setrecursionlimit(10**7)
def Is(): return [int(x) for x in sys.stdin.readline().split()]
def Ss(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

n,m = Is()
As = Is()
g = [[] for i in range(n+1)]
for i in range(m):
    u,v = Is()
    g[u].append(v)
    g[v].append(u)
for i,a in enumerate(As):
    if len(g[i+1]) >= 2:
        if min([a]+g[i+1]) == a or max([a]+g[i+1]) == a:
            print("YES")
            exit()
print("NO")
0