結果
| 問題 |
No.1805 Approaching Many Typhoon
|
| ユーザー |
|
| 提出日時 | 2022-01-18 14:26:15 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 37 ms / 2,000 ms |
| コード長 | 521 bytes |
| コンパイル時間 | 336 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-11-23 13:20:34 |
| 合計ジャッジ時間 | 2,588 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 35 |
ソースコード
n,m=map(int,input().split())
S,G=map(int,input().split())
g=[[] for _ in range(n+1)]
for _ in range(m):
f,t=map(int,input().split())
g[f].append(t)
g[t].append(f)
u=int(input())
I=list(map(int,input().split()))
for i in I:
g[i].clear()
visit=[False]*(n+1)
visit[S]=True
from collections import deque
q=deque()
q.append(S)
while q:
now=q.popleft()
for to in g[now]:
if visit[to]==False:
visit[to]=True
q.append(to)
if visit[G]:
print('Yes')
else:
print('No')