結果

問題 No.1805 Approaching Many Typhoon
ユーザー 330Xs330Xs
提出日時 2022-01-30 15:10:14
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 629 bytes
コンパイル時間 292 ms
コンパイル使用メモリ 87,024 KB
実行使用メモリ 78,316 KB
最終ジャッジ日時 2023-09-02 01:38:17
合計ジャッジ時間 5,629 ms
ジャッジサーバーID
(参考情報)
judge16 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 88 ms
71,508 KB
testcase_01 AC 90 ms
71,652 KB
testcase_02 WA -
testcase_03 AC 89 ms
71,780 KB
testcase_04 AC 91 ms
71,664 KB
testcase_05 WA -
testcase_06 AC 92 ms
71,556 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 91 ms
71,552 KB
testcase_11 AC 92 ms
71,568 KB
testcase_12 AC 92 ms
71,780 KB
testcase_13 AC 93 ms
71,728 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 92 ms
71,652 KB
testcase_18 WA -
testcase_19 AC 95 ms
71,820 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 92 ms
71,808 KB
testcase_23 AC 92 ms
71,408 KB
testcase_24 AC 92 ms
71,860 KB
testcase_25 AC 95 ms
71,716 KB
testcase_26 AC 97 ms
71,804 KB
testcase_27 WA -
testcase_28 AC 121 ms
78,216 KB
testcase_29 AC 117 ms
78,316 KB
testcase_30 AC 120 ms
78,128 KB
testcase_31 AC 119 ms
78,096 KB
testcase_32 AC 95 ms
71,884 KB
testcase_33 AC 93 ms
71,552 KB
testcase_34 AC 99 ms
72,452 KB
testcase_35 AC 103 ms
72,444 KB
testcase_36 WA -
testcase_37 AC 93 ms
71,772 KB
testcase_38 AC 93 ms
71,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n,m = map(int,input().split())
a,b = map(int,input().split())
to = [[] for _ in range(n)]
for _ in range(m):
    f,t = map(int,input().split())
    to[f-1].append(t-1)
    to[t-1].append(f-1)
    
u = int(input())
if(u != 0):
    i = set(map(int,input().split()))
else:
    i = set()

visited = [False] * n
que = deque()
que.append(a-1)
visited[a-1] = True
while(que):
    c = que.popleft()
    for v in to[c]:
        if((visited[v] == False) & (v not in i)):
            visited[v] = True
            que.append(v)
            
if(visited[b-1]):
    print('Yes')
else:
    print('No')
            
0