結果

問題 No.1805 Approaching Many Typhoon
ユーザー とりゐとりゐ
提出日時 2022-01-12 21:11:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 81,904 KB
実行使用メモリ 70,564 KB
最終ジャッジ日時 2024-04-27 12:57:36
合計ジャッジ時間 2,905 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
52,504 KB
testcase_01 AC 35 ms
53,076 KB
testcase_02 AC 37 ms
53,240 KB
testcase_03 AC 37 ms
53,132 KB
testcase_04 AC 36 ms
52,584 KB
testcase_05 AC 36 ms
53,916 KB
testcase_06 AC 36 ms
52,580 KB
testcase_07 AC 36 ms
52,048 KB
testcase_08 AC 36 ms
53,744 KB
testcase_09 AC 37 ms
52,896 KB
testcase_10 AC 36 ms
51,904 KB
testcase_11 AC 39 ms
52,476 KB
testcase_12 AC 37 ms
53,124 KB
testcase_13 AC 38 ms
52,488 KB
testcase_14 AC 37 ms
52,068 KB
testcase_15 AC 36 ms
52,204 KB
testcase_16 AC 37 ms
53,552 KB
testcase_17 AC 39 ms
52,292 KB
testcase_18 AC 35 ms
52,676 KB
testcase_19 AC 36 ms
52,948 KB
testcase_20 AC 36 ms
52,664 KB
testcase_21 AC 37 ms
52,316 KB
testcase_22 AC 37 ms
52,800 KB
testcase_23 AC 36 ms
52,824 KB
testcase_24 AC 37 ms
52,708 KB
testcase_25 AC 36 ms
53,140 KB
testcase_26 AC 36 ms
52,696 KB
testcase_27 AC 35 ms
52,884 KB
testcase_28 AC 64 ms
70,408 KB
testcase_29 AC 64 ms
69,076 KB
testcase_30 AC 64 ms
69,332 KB
testcase_31 AC 63 ms
70,564 KB
testcase_32 AC 38 ms
52,784 KB
testcase_33 AC 39 ms
54,584 KB
testcase_34 AC 42 ms
55,564 KB
testcase_35 AC 46 ms
55,972 KB
testcase_36 AC 53 ms
62,760 KB
testcase_37 AC 38 ms
52,684 KB
testcase_38 AC 38 ms
52,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

int1=lambda x:int(x)-1
n,m=map(int,input().split())
s,g=map(int1,input().split())
edge=[[] for i in range(n)]
for _ in range(m):
  u,v=map(int1,input().split())
  edge[u].append(v)
  edge[v].append(u)
u=int(input())
I=map(int1,input().split())
ng=[True]*n
for i in I:
  ng[i]=False
seen=[True]*n
d=[s]
while d:
  x=d.pop()
  if x==g:
    print('Yes')
    exit()
  seen[x]=False
  for i in edge[x]:
    if seen[i] and ng[i]:
      d.append(i)
print('No')
0