結果

問題 No.629 グラフの中に眠る門松列
ユーザー Bioinfo_KBioinfo_K
提出日時 2018-01-05 22:46:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 586 bytes
コンパイル時間 798 ms
コンパイル使用メモリ 10,828 KB
実行使用メモリ 8,992 KB
最終ジャッジ日時 2023-08-24 21:03:53
合計ジャッジ時間 3,236 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
8,512 KB
testcase_01 AC 18 ms
8,572 KB
testcase_02 AC 18 ms
8,560 KB
testcase_03 AC 18 ms
8,620 KB
testcase_04 AC 19 ms
8,640 KB
testcase_05 AC 19 ms
8,552 KB
testcase_06 AC 19 ms
8,676 KB
testcase_07 AC 18 ms
8,608 KB
testcase_08 AC 18 ms
8,676 KB
testcase_09 AC 19 ms
8,492 KB
testcase_10 AC 18 ms
8,476 KB
testcase_11 AC 19 ms
8,576 KB
testcase_12 AC 19 ms
8,492 KB
testcase_13 AC 19 ms
8,620 KB
testcase_14 WA -
testcase_15 AC 18 ms
8,576 KB
testcase_16 AC 18 ms
8,544 KB
testcase_17 AC 18 ms
8,512 KB
testcase_18 AC 18 ms
8,552 KB
testcase_19 AC 18 ms
8,556 KB
testcase_20 AC 18 ms
8,500 KB
testcase_21 WA -
testcase_22 AC 20 ms
8,688 KB
testcase_23 AC 21 ms
8,752 KB
testcase_24 AC 23 ms
8,736 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 24 ms
8,924 KB
testcase_28 WA -
testcase_29 AC 23 ms
8,880 KB
testcase_30 AC 25 ms
8,844 KB
testcase_31 AC 25 ms
8,892 KB
testcase_32 AC 25 ms
8,824 KB
testcase_33 WA -
testcase_34 AC 22 ms
8,832 KB
testcase_35 AC 22 ms
8,744 KB
testcase_36 AC 24 ms
8,916 KB
testcase_37 WA -
testcase_38 AC 24 ms
8,992 KB
testcase_39 AC 23 ms
8,868 KB
testcase_40 WA -
testcase_41 AC 21 ms
8,688 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:
        lis = [a] + g[i+1]
        if (min(lis) == a or max(lis) == a) and min(lis) != max(lis):
            print("YES")
            exit()
print("NO")
0