結果

問題 No.629 グラフの中に眠る門松列
ユーザー pluto77pluto77
提出日時 2018-01-23 12:08:14
言語 Python2
(2.7.18)
結果
AC  
実行時間 25 ms / 4,000 ms
コード長 403 bytes
コンパイル時間 741 ms
コンパイル使用メモリ 6,500 KB
実行使用メモリ 6,300 KB
最終ジャッジ日時 2023-08-26 23:17:43
合計ジャッジ時間 3,009 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 10 ms
6,000 KB
testcase_01 AC 10 ms
5,884 KB
testcase_02 AC 10 ms
5,840 KB
testcase_03 AC 10 ms
6,004 KB
testcase_04 AC 10 ms
5,912 KB
testcase_05 AC 10 ms
5,996 KB
testcase_06 AC 10 ms
5,960 KB
testcase_07 AC 10 ms
5,852 KB
testcase_08 AC 10 ms
5,988 KB
testcase_09 AC 10 ms
5,840 KB
testcase_10 AC 10 ms
5,924 KB
testcase_11 AC 10 ms
5,924 KB
testcase_12 AC 10 ms
5,840 KB
testcase_13 AC 10 ms
5,924 KB
testcase_14 AC 11 ms
5,844 KB
testcase_15 AC 11 ms
6,008 KB
testcase_16 AC 10 ms
6,028 KB
testcase_17 AC 11 ms
5,860 KB
testcase_18 AC 11 ms
5,852 KB
testcase_19 AC 11 ms
5,924 KB
testcase_20 AC 9 ms
5,928 KB
testcase_21 AC 14 ms
6,080 KB
testcase_22 AC 15 ms
6,148 KB
testcase_23 AC 15 ms
5,988 KB
testcase_24 AC 21 ms
6,020 KB
testcase_25 AC 21 ms
6,084 KB
testcase_26 AC 22 ms
6,068 KB
testcase_27 AC 25 ms
6,252 KB
testcase_28 AC 12 ms
6,036 KB
testcase_29 AC 19 ms
6,228 KB
testcase_30 AC 24 ms
6,220 KB
testcase_31 AC 23 ms
6,184 KB
testcase_32 AC 23 ms
6,244 KB
testcase_33 AC 24 ms
6,252 KB
testcase_34 AC 20 ms
6,116 KB
testcase_35 AC 20 ms
6,228 KB
testcase_36 AC 23 ms
6,300 KB
testcase_37 AC 20 ms
6,232 KB
testcase_38 AC 23 ms
6,236 KB
testcase_39 AC 21 ms
6,280 KB
testcase_40 AC 16 ms
6,112 KB
testcase_41 AC 16 ms
6,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#yuki629

N,M=map(int,raw_input().split())
A=map(int,raw_input().split())
E=[[] for i in xrange(N)]
for i in xrange(M):
 a,b=map(int,raw_input().split())
 a,b=a-1,b-1
 E[a].append(b)
 E[b].append(a)
res='NO'
for cu in xrange(N):
 up=set()
 dn=set()
 for to in E[cu]:
  if A[cu]<A[to]:
   up.add(A[to])
  if A[cu]>A[to]:
   dn.add(A[to])
 if len(up)>=2:
  res='YES'
 if len(dn)>=2:
  res='YES'
print res
0