cpl-python3

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

View the Project on GitHub yaumu3/cpl-python3

:heavy_check_mark: test/aoj/GRL_1_B.test.py

Code

# noqa: E501 # verify-helper: PROBLEM https://onlinejudge.u-aizu.ac.jp/courses/library/5/GRL/1/GRL_1_B
from cpl import INF
from cpl.graph.bellman_ford import bellman_ford


def main() -> None:
    V, _, r, *std = map(int, open(0).read().split())
    graph = [[] for _ in range(V)]
    for s, t, d in zip(*[iter(std)] * 3):
        graph[s].append((t, d))
    cost = bellman_ford(graph, r)
    if cost:
        print("\n".join(map(str, cost)).replace(str(INF), "INF"))
    else:
        print("NEGATIVE CYCLE")


if __name__ == "__main__":
    main()
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/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 "/opt/hostedtoolcache/Python/3.9.2/x64/lib/python3.9/site-packages/onlinejudge_verify/languages/python.py", line 96, in bundle
    raise NotImplementedError
NotImplementedError
Back to top page