結果

問題 No.1805 Approaching Many Typhoon
ユーザー irumo8202irumo8202
提出日時 2022-01-27 11:13:17
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 562 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 86,948 KB
実行使用メモリ 76,788 KB
最終ジャッジ日時 2023-08-26 05:24:46
合計ジャッジ時間 4,308 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,440 KB
testcase_01 AC 67 ms
71,524 KB
testcase_02 AC 65 ms
71,136 KB
testcase_03 AC 67 ms
71,348 KB
testcase_04 WA -
testcase_05 AC 65 ms
71,320 KB
testcase_06 AC 65 ms
71,236 KB
testcase_07 AC 65 ms
71,328 KB
testcase_08 AC 64 ms
71,484 KB
testcase_09 WA -
testcase_10 AC 64 ms
71,360 KB
testcase_11 AC 66 ms
71,240 KB
testcase_12 WA -
testcase_13 AC 65 ms
71,208 KB
testcase_14 AC 63 ms
71,248 KB
testcase_15 WA -
testcase_16 AC 63 ms
71,244 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 66 ms
71,420 KB
testcase_21 AC 66 ms
71,208 KB
testcase_22 AC 69 ms
71,240 KB
testcase_23 AC 63 ms
71,156 KB
testcase_24 AC 63 ms
71,280 KB
testcase_25 AC 65 ms
71,120 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 87 ms
76,788 KB
testcase_29 AC 86 ms
76,604 KB
testcase_30 AC 87 ms
76,688 KB
testcase_31 AC 87 ms
76,532 KB
testcase_32 AC 65 ms
71,056 KB
testcase_33 AC 69 ms
71,316 KB
testcase_34 AC 73 ms
71,356 KB
testcase_35 AC 74 ms
71,552 KB
testcase_36 AC 81 ms
75,588 KB
testcase_37 AC 68 ms
71,464 KB
testcase_38 AC 66 ms
71,468 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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])
0