結果

問題 No.1805 Approaching Many Typhoon
ユーザー irumo8202irumo8202
提出日時 2022-01-27 11:16:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 586 bytes
コンパイル時間 427 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 76,880 KB
最終ジャッジ日時 2023-08-26 05:28:35
合計ジャッジ時間 4,559 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,056 KB
testcase_01 AC 65 ms
71,216 KB
testcase_02 AC 66 ms
71,352 KB
testcase_03 AC 64 ms
71,260 KB
testcase_04 AC 65 ms
71,072 KB
testcase_05 AC 70 ms
71,204 KB
testcase_06 AC 67 ms
71,292 KB
testcase_07 AC 63 ms
71,348 KB
testcase_08 AC 66 ms
71,120 KB
testcase_09 AC 67 ms
71,544 KB
testcase_10 AC 68 ms
71,244 KB
testcase_11 AC 68 ms
71,440 KB
testcase_12 AC 66 ms
71,108 KB
testcase_13 AC 66 ms
71,120 KB
testcase_14 AC 65 ms
71,336 KB
testcase_15 AC 64 ms
71,256 KB
testcase_16 AC 66 ms
71,332 KB
testcase_17 AC 67 ms
71,180 KB
testcase_18 AC 66 ms
71,492 KB
testcase_19 AC 66 ms
71,240 KB
testcase_20 AC 67 ms
71,544 KB
testcase_21 AC 67 ms
71,340 KB
testcase_22 AC 66 ms
71,428 KB
testcase_23 AC 65 ms
71,328 KB
testcase_24 AC 66 ms
71,268 KB
testcase_25 AC 65 ms
71,472 KB
testcase_26 AC 64 ms
71,056 KB
testcase_27 AC 66 ms
71,256 KB
testcase_28 AC 90 ms
76,880 KB
testcase_29 AC 88 ms
76,860 KB
testcase_30 AC 87 ms
76,828 KB
testcase_31 AC 87 ms
76,860 KB
testcase_32 AC 66 ms
71,420 KB
testcase_33 AC 66 ms
71,336 KB
testcase_34 AC 68 ms
71,096 KB
testcase_35 AC 74 ms
71,532 KB
testcase_36 AC 78 ms
75,900 KB
testcase_37 AC 67 ms
71,252 KB
testcase_38 AC 66 ms
71,336 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)
    graph[t].append(f)

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