結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,336 KB
testcase_01 AC 74 ms
71,224 KB
testcase_02 AC 73 ms
71,312 KB
testcase_03 AC 73 ms
71,332 KB
testcase_04 AC 71 ms
71,308 KB
testcase_05 AC 71 ms
71,260 KB
testcase_06 AC 72 ms
71,312 KB
testcase_07 AC 72 ms
71,436 KB
testcase_08 AC 72 ms
71,276 KB
testcase_09 AC 72 ms
71,480 KB
testcase_10 AC 73 ms
71,228 KB
testcase_11 AC 73 ms
71,516 KB
testcase_12 AC 72 ms
71,424 KB
testcase_13 AC 73 ms
71,428 KB
testcase_14 AC 71 ms
71,512 KB
testcase_15 AC 73 ms
71,264 KB
testcase_16 AC 73 ms
71,076 KB
testcase_17 AC 71 ms
71,204 KB
testcase_18 AC 72 ms
71,284 KB
testcase_19 AC 72 ms
71,256 KB
testcase_20 AC 72 ms
71,120 KB
testcase_21 AC 75 ms
71,544 KB
testcase_22 AC 72 ms
71,224 KB
testcase_23 AC 73 ms
71,376 KB
testcase_24 AC 74 ms
71,456 KB
testcase_25 AC 74 ms
71,264 KB
testcase_26 AC 73 ms
71,348 KB
testcase_27 AC 73 ms
71,228 KB
testcase_28 AC 98 ms
76,884 KB
testcase_29 AC 99 ms
76,584 KB
testcase_30 AC 100 ms
76,700 KB
testcase_31 AC 100 ms
76,636 KB
testcase_32 AC 76 ms
71,260 KB
testcase_33 AC 74 ms
71,352 KB
testcase_34 AC 78 ms
71,240 KB
testcase_35 AC 81 ms
71,344 KB
testcase_36 AC 87 ms
76,072 KB
testcase_37 AC 71 ms
71,332 KB
testcase_38 AC 70 ms
71,520 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