serna37's Library

Logo

C++ アルゴリズムとデータ構造のライブラリ

View the Project on GitHub serna37/library-cpp

:heavy_check_mark: グラフ - WarshallFroydのテスト
(tests/graph.shortest_path.warshall_froyd.test.cpp)

Depends on

Code

#define PROBLEM                                                                \
    "https://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_1_C"
#include "template/template.hpp"
#include "library/graph/shortest_path/warshall_froyd.hpp"
#include "library/various/convert.hpp"
/**
 * @brief グラフ - WarshallFroydのテスト
 */
void solve() {
    int V, E;
    cin >> V >> E;
    Graph G(V);
    G.read(E, 0, true, true);
    auto [dis, negativeCycle] = warshall_froyd(G);
    if (negativeCycle) {
        print("NEGATIVE CYCLE");
        return;
    }
    vec2<string> ans = make_vec2<string>(V, V, "");
    for (int i = 0; i < V; ++i) {
        for (int j = 0; j < V; ++j) {
            ans[i][j] = dis[i][j] == INF ? "INF" : int_to_string(dis[i][j]);
        }
    }
    print(ans);
}
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/cplusplus.py", line 187, in bundle
    bundler.update(path)
  File "/home/runner/.local/lib/python3.12/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py", line 401, in update
    self.update(self._resolve(pathlib.Path(included), included_from=path))
  File "/home/runner/.local/lib/python3.12/site-packages/onlinejudge_verify/languages/cplusplus_bundle.py", line 400, in update
    raise BundleErrorAt(path, i + 1, "unable to process #include in #if / #ifdef / #ifndef other than include guards")
onlinejudge_verify.languages.cplusplus_bundle.BundleErrorAt: template/template.hpp: line 7: unable to process #include in #if / #ifdef / #ifndef other than include guards
Back to top page