verify/graph/dynamic/bellmanford_grl1b_test.nim

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

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

Depends on

Code

# verification-helper: PROBLEM https://onlinejudge.u-aizu.ac.jp/courses/library/5/GRL/all/GRL_1_B
import sequtils
import cplib/graph/graph
import cplib/graph/bellmanford
import cplib/utils/constants
proc scanf(formatstr: cstring){.header: "<stdio.h>", varargs.}
proc ii(): int {.inline.} = scanf("%lld\n", addr result)

var v, e, r = ii()
var g = initWeightedDirectedGraph(v, int)
for i in 0..<e:
    var s, t, d = ii()
    g.add_edge(s, t, d)
var cost = bellmanford(g, r)
if cost.min == -INF64:
    echo "NEGATIVE CYCLE"
else:
    for i in 0..<v:
        if cost[i] == INF64: echo "INF"
        else: echo cost[i]
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