結果
問題 |
No.1805 Approaching Many Typhoon
|
ユーザー |
👑 ![]() |
提出日時 | 2022-01-12 21:58:32 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 461 bytes |
コンパイル時間 | 700 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 69,632 KB |
最終ジャッジ日時 | 2024-11-15 15:06:48 |
合計ジャッジ時間 | 2,899 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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) 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")