結果

問題 No.1805 Approaching Many Typhoon
ユーザー 👑 KazunKazun
提出日時 2022-01-12 21:53:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 480 bytes
コンパイル時間 147 ms
コンパイル使用メモリ 81,884 KB
実行使用メモリ 70,448 KB
最終ジャッジ日時 2024-04-27 12:58:22
合計ジャッジ時間 2,553 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,980 KB
testcase_01 AC 39 ms
54,548 KB
testcase_02 AC 35 ms
53,904 KB
testcase_03 AC 35 ms
54,144 KB
testcase_04 WA -
testcase_05 AC 35 ms
54,048 KB
testcase_06 AC 37 ms
54,748 KB
testcase_07 WA -
testcase_08 AC 36 ms
54,428 KB
testcase_09 AC 36 ms
54,768 KB
testcase_10 AC 36 ms
54,760 KB
testcase_11 AC 36 ms
55,076 KB
testcase_12 AC 37 ms
53,696 KB
testcase_13 WA -
testcase_14 AC 36 ms
54,060 KB
testcase_15 AC 36 ms
53,864 KB
testcase_16 AC 37 ms
53,772 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 35 ms
53,960 KB
testcase_20 AC 37 ms
54,220 KB
testcase_21 AC 35 ms
55,444 KB
testcase_22 AC 36 ms
54,284 KB
testcase_23 AC 37 ms
54,076 KB
testcase_24 AC 35 ms
54,112 KB
testcase_25 AC 38 ms
54,516 KB
testcase_26 AC 36 ms
53,880 KB
testcase_27 AC 37 ms
54,624 KB
testcase_28 AC 58 ms
70,216 KB
testcase_29 AC 58 ms
69,816 KB
testcase_30 AC 60 ms
69,700 KB
testcase_31 AC 60 ms
70,448 KB
testcase_32 AC 38 ms
55,148 KB
testcase_33 AC 37 ms
54,724 KB
testcase_34 AC 39 ms
55,616 KB
testcase_35 AC 44 ms
56,912 KB
testcase_36 AC 48 ms
63,468 KB
testcase_37 AC 37 ms
53,528 KB
testcase_38 AC 37 ms
53,716 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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)
    E[T].append(F)

U=int(input())
I=list(map(int,input().split()))

P=[0]*(N+1)
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[T] else "No")
0