verify/graph/dynamic/shortest_path_test.nim

This documentation is automatically generated by online-judge-tools/verification-helper

:heavy_check_mark: verify/graph/dynamic/shortest_path_test.nim

Depends on

Code

# verification-helper: PROBLEM https://judge.yosupo.jp/problem/shortest_path
include cplib/tmpl/sheep
import cplib/graph/graph
import cplib/graph/restore_shortest_path_from_prev
import cplib/graph/dijkstra
var N, M, s, t = ii()
var G = initWeightedDirectedGraph(N)
for i in 0..<M:
    var a, b, c = ii()
    G.add_edge(a, b, c)
var (costs, prev) = G.restore_dijkstra(s)
if costs[t] == INF:
    echo -1
else:
    var path = prev.restore_shortestpath_from_prev(t)
    echo costs[t], " ", len(path)-1
    for i in 0..<len(path)-1:
        echo path[i], " ", path[i+1]
Traceback (most recent call last):
  File "/home/runner/.local/lib/python3.12/site-packages/onlinejudge_verify/documentation/build.py", line 71, in _render_source_code_stat
    bundled_code = language.bundle(stat.path, basedir=basedir, options={'include_paths': [basedir]}).decode()
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/.local/lib/python3.12/site-packages/onlinejudge_verify/languages/nim.py", line 86, in bundle
    raise NotImplementedError
NotImplementedError
Back to top page