結果

問題 No.1607 Kth Maximum Card
ユーザー ああいいああいい
提出日時 2022-02-26 12:29:42
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 498 bytes
コンパイル時間 394 ms
コンパイル使用メモリ 86,980 KB
実行使用メモリ 104,004 KB
最終ジャッジ日時 2023-09-17 12:54:58
合計ジャッジ時間 11,090 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,616 KB
testcase_01 AC 94 ms
71,612 KB
testcase_02 AC 97 ms
71,828 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 98 ms
71,620 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 387 ms
97,964 KB
testcase_10 AC 490 ms
101,924 KB
testcase_11 AC 197 ms
83,788 KB
testcase_12 AC 401 ms
97,336 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 174 ms
81,304 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
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 AC 339 ms
92,068 KB
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M,K = map(int,input().split())
G = [[] for _ in range(N+1)]
_min = 10 ** 6
inf = 10 ** 6
for _ in range(M):
    a,b,c = map(int,input().split())
    G[a].append(b)
    G[b].append(a)
    if c < _min:
        _min = c
from collections import deque
q = deque()
q.append(1)
dist = [inf] * (N+1)
dist[1] = 0
while q:
    now = q.popleft()
    for v in G[now]:
        if dist[v] == inf:
            dist[v] = dist[now] + 1
            q.append(v)
if dist[-1] >= K:
    print(_min)
else:
    print(0)
0