結果

問題 No.2674 k-Walk on Bipartite
ユーザー hiro1729hiro1729
提出日時 2024-03-15 22:26:34
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 393 bytes
コンパイル時間 179 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 97,868 KB
最終ジャッジ日時 2024-03-15 22:26:41
合計ジャッジ時間 7,001 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
53,460 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 358 ms
89,944 KB
testcase_09 WA -
testcase_10 AC 387 ms
92,920 KB
testcase_11 WA -
testcase_12 AC 362 ms
90,240 KB
testcase_13 WA -
testcase_14 AC 102 ms
83,340 KB
testcase_15 WA -
testcase_16 AC 295 ms
94,644 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 210 ms
92,532 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 39 ms
53,460 KB
testcase_33 AC 40 ms
53,460 KB
testcase_34 WA -
testcase_35 AC 40 ms
53,460 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 AC 41 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
N, M = map(int, input().split())
s, t, k = map(int, input().split())
s -= 1
t -= 1
g = [[] for _ in range(N)]
for _ in range(M):
	u, v = map(int, input().split())
	u -= 1
	v -= 1
	g[u].append(v)
	g[v].append(u)
d = [10 ** 9] * N
d[s] = 0
q = deque([s])
while q:
	u = q.popleft()
	for v in g[u]:
		if d[u] + 1 < d[v]:
			d[v] = d[u] + 1
			q.append(v)
print("Yes")
0