結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 AC 213 ms
93,120 KB
testcase_10 RE -
testcase_11 AC 275 ms
89,772 KB
testcase_12 RE -
testcase_13 AC 197 ms
89,460 KB
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 AC 138 ms
85,084 KB
testcase_19 AC 236 ms
91,524 KB
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 481 ms
97,868 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
testcase_27 AC 42 ms
53,460 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 41 ms
53,460 KB
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 RE -
testcase_37 RE -
testcase_38 RE -
権限があれば一括ダウンロードができます

ソースコード

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)
if d[t] < 10 ** 9:
	assert(False)
else:
	print("Unknown")
0