結果
| 問題 |
No.1805 Approaching Many Typhoon
|
| ユーザー |
|
| 提出日時 | 2022-01-27 11:13:17 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 562 bytes |
| コンパイル時間 | 597 ms |
| コンパイル使用メモリ | 81,664 KB |
| 実行使用メモリ | 69,248 KB |
| 最終ジャッジ日時 | 2024-12-24 20:06:11 |
| 合計ジャッジ時間 | 3,521 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 26 WA * 9 |
ソースコード
N, M = map(int, input().split())
S, G = map(lambda x: int(x) - 1, input().split())
graph = [[] for _ in range(N)]
for _ in range(M):
f, t = map(lambda x: int(x) - 1, input().split())
graph[f].append(t)
input()
dont_use = set(map(lambda x: int(x) - 1, input().split()))
que = [S]
visited = [False] * N
visited[S] = True
while que:
v = que.pop()
for nx in graph[v]:
if visited[nx]:
continue
if nx in dont_use:
continue
visited[nx] = True
que.append(nx)
print("YNeos"[1 ^ visited[G] :: 2])