結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
54,120 KB
testcase_01 AC 36 ms
54,788 KB
testcase_02 AC 34 ms
55,060 KB
testcase_03 AC 36 ms
53,932 KB
testcase_04 WA -
testcase_05 AC 36 ms
54,612 KB
testcase_06 AC 36 ms
55,052 KB
testcase_07 AC 35 ms
54,340 KB
testcase_08 AC 38 ms
54,684 KB
testcase_09 WA -
testcase_10 AC 38 ms
54,768 KB
testcase_11 AC 38 ms
54,468 KB
testcase_12 WA -
testcase_13 AC 36 ms
55,448 KB
testcase_14 AC 36 ms
55,004 KB
testcase_15 WA -
testcase_16 AC 35 ms
54,732 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 35 ms
54,316 KB
testcase_21 AC 35 ms
53,688 KB
testcase_22 AC 34 ms
54,484 KB
testcase_23 AC 35 ms
54,416 KB
testcase_24 AC 38 ms
53,540 KB
testcase_25 AC 38 ms
54,396 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 57 ms
69,808 KB
testcase_29 AC 59 ms
69,972 KB
testcase_30 AC 60 ms
69,660 KB
testcase_31 AC 58 ms
70,592 KB
testcase_32 AC 38 ms
56,328 KB
testcase_33 AC 38 ms
54,464 KB
testcase_34 AC 39 ms
55,424 KB
testcase_35 AC 44 ms
58,252 KB
testcase_36 AC 48 ms
64,748 KB
testcase_37 AC 35 ms
54,856 KB
testcase_38 AC 34 ms
54,092 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)

P=[0]*(N+1)

U=int(input())
if U>0:
    I=list(map(int,input().split()))
    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[G] else "No")
0