competitive-programming-library

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

View the Project on GitHub yu-0811/competitive-programming-library

:warning: algorithm_library/python/graph/WarshallFloyd.py

Code

# タイプ数削減、余計なことを考えなくていいように、inf,N,G はグローバル変数
# グラフは 1-index

def WarshallFloyd():
  dist = [[inf]*(N+1) for _ in range(N+1)]
  for i in range(1,N+1): dist[i][i] = 0
  for i in range(1,N+1):
    for j,c in G[i]:
      if dist[i][j]>c: dist[i][j] = c
      if dist[j][i]>c: dist[i][j] = c
  
  for k in range(1,N+1):
    for i in range(1,N+1):
      for j in range(1,N+1):
        if i==j: continue
        if dist[i][j]>dist[i][k]+dist[k][j]:
          dist[i][j] = dist[i][k]+dist[k][j]
  
  return dist
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/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.11.0/x64/lib/python3.11/site-packages/onlinejudge_verify/languages/python.py", line 96, in bundle
    raise NotImplementedError
NotImplementedError
Back to top page