diff --git a/.verify-helper/timestamps.remote.json b/.verify-helper/timestamps.remote.json index 062553ae..6a1ce4ae 100644 --- a/.verify-helper/timestamps.remote.json +++ b/.verify-helper/timestamps.remote.json @@ -50,28 +50,28 @@ "tests/library_checker_aizu_tests/flow/dinic_aizu.test.cpp": "2024-11-17 14:04:03 -0600", "tests/library_checker_aizu_tests/flow/hungarian.test.cpp": "2024-11-17 14:04:03 -0600", "tests/library_checker_aizu_tests/flow/min_cost_max_flow.test.cpp": "2024-12-05 10:41:42 -0600", -"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp": "2025-07-08 19:09:51 -0600", -"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp": "2025-07-08 19:09:51 -0600", -"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp": "2025-07-08 19:09:51 -0600", -"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp": "2025-07-08 19:09:51 -0600", -"tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp": "2025-08-04 17:01:28 -0600", -"tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp": "2024-12-14 19:50:29 -0600", +"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp": "2025-08-06 15:33:00 -0600", +"tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp": "2025-08-06 15:33:00 -0600", +"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp": "2025-08-06 15:33:00 -0600", +"tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp": "2025-08-06 15:33:00 -0600", +"tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp": "2025-08-06 15:33:00 -0600", +"tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp": "2025-08-06 15:33:00 -0600", "tests/library_checker_aizu_tests/graphs/dijkstra_aizu.test.cpp": "2024-12-14 19:50:29 -0600", "tests/library_checker_aizu_tests/graphs/dijkstra_lib_checker.test.cpp": "2024-12-14 19:50:29 -0600", -"tests/library_checker_aizu_tests/graphs/directed_cycle.test.cpp": "2025-08-04 17:01:28 -0600", -"tests/library_checker_aizu_tests/graphs/enumerate_triangles.test.cpp": "2025-08-04 17:01:28 -0600", +"tests/library_checker_aizu_tests/graphs/directed_cycle.test.cpp": "2025-08-06 15:33:00 -0600", +"tests/library_checker_aizu_tests/graphs/enumerate_triangles.test.cpp": "2025-08-06 15:33:00 -0600", "tests/library_checker_aizu_tests/graphs/hopcroft_karp_aizu.test.cpp": "2025-02-10 23:30:47 -0700", "tests/library_checker_aizu_tests/graphs/hopcroft_karp_lib_checker.test.cpp": "2025-02-10 23:30:47 -0700", "tests/library_checker_aizu_tests/graphs/mst.test.cpp": "2024-11-17 14:04:03 -0600", -"tests/library_checker_aizu_tests/graphs/offline_incremental_scc.test.cpp": "2025-08-04 17:01:28 -0600", -"tests/library_checker_aizu_tests/graphs/strongly_connected_components_aizu.test.cpp": "2025-08-04 17:01:28 -0600", -"tests/library_checker_aizu_tests/graphs/strongly_connected_components_lib_checker.test.cpp": "2025-08-04 17:01:28 -0600", -"tests/library_checker_aizu_tests/graphs/two_edge_components.test.cpp": "2025-08-04 17:01:28 -0600", -"tests/library_checker_aizu_tests/handmade_tests/count_paths.test.cpp": "2025-08-06 13:48:07 -0600", +"tests/library_checker_aizu_tests/graphs/offline_incremental_scc.test.cpp": "2025-08-06 15:33:00 -0600", +"tests/library_checker_aizu_tests/graphs/strongly_connected_components_aizu.test.cpp": "2025-08-06 15:33:00 -0600", +"tests/library_checker_aizu_tests/graphs/strongly_connected_components_lib_checker.test.cpp": "2025-08-06 15:33:00 -0600", +"tests/library_checker_aizu_tests/graphs/two_edge_components.test.cpp": "2025-08-06 15:33:00 -0600", +"tests/library_checker_aizu_tests/handmade_tests/count_paths.test.cpp": "2025-08-06 15:30:13 -0600", "tests/library_checker_aizu_tests/handmade_tests/dsu_size.test.cpp": "2024-12-14 19:50:29 -0600", "tests/library_checker_aizu_tests/handmade_tests/edge_cd_small_trees.test.cpp": "2025-04-27 21:47:37 -0600", "tests/library_checker_aizu_tests/handmade_tests/fib_matrix_expo.test.cpp": "2024-12-14 19:50:29 -0600", -"tests/library_checker_aizu_tests/handmade_tests/functional_graph.test.cpp": "2025-08-04 17:01:28 -0600", +"tests/library_checker_aizu_tests/handmade_tests/functional_graph.test.cpp": "2025-08-06 15:28:49 -0600", "tests/library_checker_aizu_tests/handmade_tests/manacher.test.cpp": "2024-12-14 19:50:29 -0600", "tests/library_checker_aizu_tests/handmade_tests/merge_st_and_wavelet.test.cpp": "2025-08-04 17:01:28 -0600", "tests/library_checker_aizu_tests/handmade_tests/mobius.test.cpp": "2025-02-10 14:50:36 -0700", diff --git a/library/graphs/bridges_cuts/bcc_callback.hpp b/library/graphs/bcc_callback.hpp similarity index 100% rename from library/graphs/bridges_cuts/bcc_callback.hpp rename to library/graphs/bcc_callback.hpp diff --git a/library/graphs/strongly_connected_components/scc.hpp b/library/graphs/scc.hpp similarity index 100% rename from library/graphs/strongly_connected_components/scc.hpp rename to library/graphs/scc.hpp diff --git a/library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp b/library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp index 72e4e23c..c4d56556 100644 --- a/library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp +++ b/library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp @@ -1,5 +1,5 @@ #pragma once -#include "scc.hpp" +#include "../scc.hpp" //! https://codeforces.com/blog/entry/15102 //! Add minimum extra directed edges to directed graph to //! make it strongly connected. If the directed graph is diff --git a/library/graphs/strongly_connected_components/offline_incremental_scc.hpp b/library/graphs/strongly_connected_components/offline_incremental_scc.hpp index 4507acd2..2c5d623c 100644 --- a/library/graphs/strongly_connected_components/offline_incremental_scc.hpp +++ b/library/graphs/strongly_connected_components/offline_incremental_scc.hpp @@ -1,5 +1,5 @@ #pragma once -#include "scc.hpp" +#include "../scc.hpp" //! https://codeforces.com/blog/entry/91608 //! @code //! auto joins = offline_incremental_scc(eds, n); diff --git a/library/graphs/bridges_cuts/block_vertex_tree.hpp b/library/graphs/uncommon/block_vertex_tree.hpp similarity index 100% rename from library/graphs/bridges_cuts/block_vertex_tree.hpp rename to library/graphs/uncommon/block_vertex_tree.hpp diff --git a/library/graphs/bridges_cuts/bridge_tree.hpp b/library/graphs/uncommon/bridge_tree.hpp similarity index 100% rename from library/graphs/bridges_cuts/bridge_tree.hpp rename to library/graphs/uncommon/bridge_tree.hpp diff --git a/library/graphs/bridges_cuts/bridges.hpp b/library/graphs/uncommon/bridges.hpp similarity index 100% rename from library/graphs/bridges_cuts/bridges.hpp rename to library/graphs/uncommon/bridges.hpp diff --git a/library/graphs/complement_graph_ccs.hpp b/library/graphs/uncommon/complement_graph_ccs.hpp similarity index 100% rename from library/graphs/complement_graph_ccs.hpp rename to library/graphs/uncommon/complement_graph_ccs.hpp diff --git a/library/graphs/bridges_cuts/cuts.hpp b/library/graphs/uncommon/cuts.hpp similarity index 100% rename from library/graphs/bridges_cuts/cuts.hpp rename to library/graphs/uncommon/cuts.hpp diff --git a/library/graphs/enumerate_triangles.hpp b/library/graphs/uncommon/enumerate_triangles.hpp similarity index 100% rename from library/graphs/enumerate_triangles.hpp rename to library/graphs/uncommon/enumerate_triangles.hpp diff --git a/library/graphs/functional_graph_processor.hpp b/library/graphs/uncommon/functional_graph_processor.hpp similarity index 70% rename from library/graphs/functional_graph_processor.hpp rename to library/graphs/uncommon/functional_graph_processor.hpp index 313ad5db..db659e0d 100644 --- a/library/graphs/functional_graph_processor.hpp +++ b/library/graphs/uncommon/functional_graph_processor.hpp @@ -15,28 +15,20 @@ struct func_graph { vector root_of; vector cycle, childs; func_graph(const vi& a): root_of(sz(a)), childs(sz(a)) { - vi state(sz(a)); - rep(i, 0, sz(a)) if (!state[i]) { + vi vis(sz(a)); + rep(i, 0, sz(a)) if (!vis[i]) { int u = i; - while (!state[u]) { - state[u] = 1; - u = a[u]; - } - if (state[u] == 1) { - cycle.emplace_back(); - while (state[u] == 1) { + for (; !vis[u]; u = a[u]) vis[u] = 1; + if (vis[u] == 1) + for (cycle.emplace_back(); vis[u] == 1; u = a[u]) { root_of[u] = {sz(cycle) - 1, sz(cycle.back())}; cycle.back().push_back(u); - state[u] = 2; - u = a[u]; + vis[u] = 2; } - } - int v = i; - while (state[v] == 1) { + for (int v = i; vis[v] == 1; v = a[v]) { root_of[v] = root_of[u]; childs[a[v]].push_back(v); - state[v] = 2; - v = a[v]; + vis[v] = 2; } } } diff --git a/tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp b/tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp index 70145914..06c22f00 100644 --- a/tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp +++ b/tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_bcc.test.cpp @@ -1,7 +1,7 @@ #define PROBLEM \ "https://onlinejudge.u-aizu.ac.jp/problems/GRL_3_A" #include "../template.hpp" -#include "../../../library/graphs/bridges_cuts/bcc_callback.hpp" +#include "../../../library/graphs/bcc_callback.hpp" int main() { cin.tie(0)->sync_with_stdio(0); int n, m; diff --git a/tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp b/tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp index bd22f849..290a3f35 100644 --- a/tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp +++ b/tests/library_checker_aizu_tests/graphs/bcc_callback_aizu_two_edge_cc.test.cpp @@ -1,7 +1,7 @@ #define PROBLEM \ "https://onlinejudge.u-aizu.ac.jp/problems/GRL_3_B" #include "../template.hpp" -#include "../../../library/graphs/bridges_cuts/bcc_callback.hpp" +#include "../../../library/graphs/bcc_callback.hpp" int main() { cin.tie(0)->sync_with_stdio(0); int n, m; diff --git a/tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp b/tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp index 9dd2bfd0..bfeb9dd6 100644 --- a/tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp +++ b/tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_bcc.test.cpp @@ -1,7 +1,7 @@ #define PROBLEM \ "https://judge.yosupo.jp/problem/biconnected_components" #include "../template.hpp" -#include "../../../library/graphs/bridges_cuts/bcc_callback.hpp" +#include "../../../library/graphs/bcc_callback.hpp" int main() { cin.tie(0)->sync_with_stdio(0); int n, m; diff --git a/tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp b/tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp index 1655d989..7038e7b2 100644 --- a/tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp +++ b/tests/library_checker_aizu_tests/graphs/bcc_callback_lib_checker_two_cc.test.cpp @@ -1,7 +1,7 @@ #define PROBLEM \ "https://judge.yosupo.jp/problem/two_edge_connected_components" #include "../template.hpp" -#include "../../../library/graphs/bridges_cuts/bcc_callback.hpp" +#include "../../../library/graphs/bcc_callback.hpp" #include "../../../kactl/content/data-structures/UnionFind.h" int main() { cin.tie(0)->sync_with_stdio(0); diff --git a/tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp b/tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp index 2be352ae..bcc8d75c 100644 --- a/tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp +++ b/tests/library_checker_aizu_tests/graphs/biconnected_components.test.cpp @@ -1,7 +1,7 @@ #define PROBLEM \ "https://judge.yosupo.jp/problem/biconnected_components" #include "../template.hpp" -#include "../../../library/graphs/bridges_cuts/block_vertex_tree.hpp" +#include "../../../library/graphs/uncommon/block_vertex_tree.hpp" int main() { cin.tie(0)->sync_with_stdio(0); int n, m; diff --git a/tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp b/tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp index bcf93b9f..8a8f359b 100644 --- a/tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp +++ b/tests/library_checker_aizu_tests/graphs/connected_components_of_complement_graph.test.cpp @@ -1,7 +1,7 @@ #define PROBLEM \ "https://judge.yosupo.jp/problem/connected_components_of_complement_graph" #include "../template.hpp" -#include "../../../library/graphs/complement_graph_ccs.hpp" +#include "../../../library/graphs/uncommon/complement_graph_ccs.hpp" int main() { cin.tie(0)->sync_with_stdio(0); int n, m; diff --git a/tests/library_checker_aizu_tests/graphs/enumerate_triangles.test.cpp b/tests/library_checker_aizu_tests/graphs/enumerate_triangles.test.cpp index a5cb8e59..3c0c4ae8 100644 --- a/tests/library_checker_aizu_tests/graphs/enumerate_triangles.test.cpp +++ b/tests/library_checker_aizu_tests/graphs/enumerate_triangles.test.cpp @@ -1,7 +1,7 @@ #define PROBLEM \ "https://judge.yosupo.jp/problem/enumerate_triangles" #include "../template.hpp" -#include "../../../library/graphs/enumerate_triangles.hpp" +#include "../../../library/graphs/uncommon/enumerate_triangles.hpp" int main() { cin.tie(0)->sync_with_stdio(0); int n, m; diff --git a/tests/library_checker_aizu_tests/graphs/two_edge_components.test.cpp b/tests/library_checker_aizu_tests/graphs/two_edge_components.test.cpp index 5c7602cb..f12fbcad 100644 --- a/tests/library_checker_aizu_tests/graphs/two_edge_components.test.cpp +++ b/tests/library_checker_aizu_tests/graphs/two_edge_components.test.cpp @@ -1,7 +1,7 @@ #define PROBLEM \ "https://judge.yosupo.jp/problem/two_edge_connected_components" #include "../template.hpp" -#include "../../../library/graphs/bridges_cuts/bridge_tree.hpp" +#include "../../../library/graphs/uncommon/bridge_tree.hpp" #include "../../../library/data_structures/dsu/dsu_restorable.hpp" int main() { cin.tie(0)->sync_with_stdio(0); diff --git a/tests/library_checker_aizu_tests/handmade_tests/functional_graph.test.cpp b/tests/library_checker_aizu_tests/handmade_tests/functional_graph.test.cpp index 6901b9e8..db0a2da3 100644 --- a/tests/library_checker_aizu_tests/handmade_tests/functional_graph.test.cpp +++ b/tests/library_checker_aizu_tests/handmade_tests/functional_graph.test.cpp @@ -2,7 +2,7 @@ "https://onlinejudge.u-aizu.ac.jp/problems/ITP1_1_A" #include "../template.hpp" #include "../../../library/contest/random.hpp" -#include "../../../library/graphs/functional_graph_processor.hpp" +#include "../../../library/graphs/uncommon/functional_graph_processor.hpp" // https://github.com/Aeren1564/Algorithms/blob/master/Algorithm_Implementations_Cpp/Graph_Theory/Special_Graphs/functional_graph_processor.sublime-snippet struct functional_graph_processor { functional_graph_processor(const vector &next) { diff --git a/tests/scripts/build_pdf.sh b/tests/scripts/build_pdf.sh index 24b00187..c9128e33 100755 --- a/tests/scripts/build_pdf.sh +++ b/tests/scripts/build_pdf.sh @@ -19,7 +19,11 @@ rm ../library/data_structures/seg_tree_uncommon/kth_smallest_query.hpp || exit 1 rm ../library/data_structures/uncommon/mode_query.hpp || exit 1 rm ../library/data_structures/uncommon/priority_queue_of_updates.hpp || exit 1 rm ../library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp || exit 1 -rm ../library/graphs/functional_graph_processor.hpp || exit 1 +rm ../library/graphs/strongly_connected_components/offline_incremental_scc.hpp || exit 1 +rm ../library/graphs/uncommon/bridges.hpp || exit 1 +rm ../library/graphs/uncommon/cuts.hpp || exit 1 +rm ../library/graphs/uncommon/block_vertex_tree.hpp || exit 1 +rm ../library/graphs/uncommon/bridge_tree.hpp || exit 1 rm ../library/math/derangements.hpp || exit 1 rm ../library/math/num_distinct_subsequences.hpp || exit 1 rm ../library/math/partitions.hpp || exit 1