結果
問題 |
No.1805 Approaching Many Typhoon
|
ユーザー |
👑 ![]() |
提出日時 | 2022-01-12 22:02:43 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 481 bytes |
コンパイル時間 | 291 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 69,632 KB |
最終ジャッジ日時 | 2024-11-15 15:06:57 |
合計ジャッジ時間 | 3,717 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 26 WA * 9 |
ソースコード
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) P=[0]*(N+1) U=int(input()) if U>0: I=list(map(int,input().split())) 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[G] else "No")