結果
| 問題 | No.1805 Approaching Many Typhoon |
| ユーザー |
👑 Kazun
|
| 提出日時 | 2022-01-12 21:53:26 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 480 bytes |
| 記録 | |
| コンパイル時間 | 180 ms |
| コンパイル使用メモリ | 85,348 KB |
| 実行使用メモリ | 70,528 KB |
| 最終ジャッジ日時 | 2026-05-10 12:51:24 |
| 合計ジャッジ時間 | 2,742 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 30 WA * 5 |
ソースコード
from collections import deque
N,M=map(int,input().split())
S,G=map(int,input().split())
E=[[] for _ in range(N+1)]
for _ in range(M):
F,T=map(int,input().split())
E[F].append(T)
E[T].append(F)
U=int(input())
I=list(map(int,input().split()))
P=[0]*(N+1)
for i in I:
P[i]=1
Q=deque([S])
X=[0]*(N+1); X[S]=1
while Q:
u=Q.popleft()
for v in E[u]:
if P[v]==0 and X[v]==0:
X[v]=1
Q.append(v)
print("Yes" if X[T] else "No")
Kazun