Skip to content

Commit 7a9ac3c

Browse files
committed
revert name back
1 parent 0d18faa commit 7a9ac3c

File tree

6 files changed

+18
-22
lines changed

6 files changed

+18
-22
lines changed

library/graphs/scc/add_edges_strongly_connected.hpp renamed to library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp

File renamed without changes.

library/graphs/scc/offline_incremental_scc.hpp renamed to library/graphs/strongly_connected_components/offline_incremental_scc.hpp

File renamed without changes.

library/graphs/scc/scc.hpp renamed to library/graphs/strongly_connected_components/scc.hpp

File renamed without changes.

tests/library_checker_aizu_tests/graphs/offline_incremental_scc.test.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
#define PROBLEM \
2-
"https://judge.yosupo.jp/problem/incremental_scc"
3-
#include "../template.hpp"
1+
#define PROBLEM "https://judge.yosupo.jp/problem/incremental_scc"
2+
#include "../../../library/graphs/strongly_connected_components/offline_incremental_scc.hpp"
3+
44
#include "../../../kactl/content/data-structures/UnionFind.h"
5-
#include "../../../library/graphs/scc/offline_incremental_scc.hpp"
65
#include "../../../library/math/mod_int.hpp"
6+
#include "../template.hpp"
77
int main() {
88
cin.tie(0)->sync_with_stdio(0);
99
int n, m;
@@ -18,8 +18,7 @@ int main() {
1818
assert((eds[t][0] == eds[t][1]) == (joins[t] == -1));
1919
vector<int> order(m);
2020
iota(all(order), 0);
21-
ranges::sort(all(order), {},
22-
[&](int i) { return joins[i]; });
21+
ranges::sort(all(order), {}, [&](int i) { return joins[i]; });
2322
UF uf(n);
2423
mint sum = 0;
2524
for (int t = 0, it = 0; t < m; t++) {

tests/library_checker_aizu_tests/graphs/strongly_connected_components_lib_checker.test.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#define PROBLEM "https://judge.yosupo.jp/problem/scc"
2-
#include "../template.hpp"
2+
#include "../../../library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp"
33
#include "../scc_asserts.hpp"
4-
#include "../../../library/graphs/scc/add_edges_strongly_connected.hpp"
4+
#include "../template.hpp"
55
int main() {
66
cin.tie(0)->sync_with_stdio(0);
77
int n, m;
@@ -16,8 +16,7 @@ int main() {
1616
auto [num_sccs, scc_id] = sccs(adj);
1717
cout << num_sccs << '\n';
1818
vector<vector<int>> each_scc(num_sccs);
19-
for (int i = 0; i < n; i++)
20-
each_scc[scc_id[i]].push_back(i);
19+
for (int i = 0; i < n; i++) each_scc[scc_id[i]].push_back(i);
2120
for (int i = num_sccs - 1; i >= 0; i--) {
2221
cout << sz(each_scc[i]) << " ";
2322
for (auto node : each_scc[i]) cout << node << " ";

tests/library_checker_aizu_tests/scc_asserts.hpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22
#include "../../library/contest/random.hpp"
3-
#include "../../library/graphs/scc/add_edges_strongly_connected.hpp"
4-
#include "../../library/graphs/scc/offline_incremental_scc.hpp"
3+
#include "../../library/graphs/strongly_connected_components/add_edges_strongly_connected.hpp"
4+
#include "../../library/graphs/strongly_connected_components/offline_incremental_scc.hpp"
55
void scc_asserts(const vector<vector<int>>& adj) {
66
int n = sz(adj);
77
auto [num_sccs, scc_id] = sccs(adj);
@@ -10,8 +10,7 @@ void scc_asserts(const vector<vector<int>>& adj) {
1010
for (int i = 0; i < n; i++)
1111
for (auto j : adj[i]) assert(scc_id[i] >= scc_id[j]);
1212
}
13-
vector<bool> is_zero_in(num_sccs, 1),
14-
is_zero_out(num_sccs, 1);
13+
vector<bool> is_zero_in(num_sccs, 1), is_zero_out(num_sccs, 1);
1514
for (int i = 0; i < n; i++) {
1615
for (int v : adj[i]) {
1716
if (scc_id[i] == scc_id[v]) continue;
@@ -21,14 +20,13 @@ void scc_asserts(const vector<vector<int>>& adj) {
2120
}
2221
// since {num_sccs-1, ..., 2, 1, 0} is a topo order
2322
assert(is_zero_in[num_sccs - 1] && is_zero_out[0]);
24-
int num_zero_in =
25-
int(count(begin(is_zero_in), end(is_zero_in), 1));
26-
int num_zero_out =
27-
int(count(begin(is_zero_out), end(is_zero_out), 1));
28-
vector<pair<int, int>> edges =
29-
extra_edges(adj, num_sccs, scc_id);
30-
if (num_sccs == 1) assert(sz(edges) == 0);
31-
else assert(sz(edges) == max(num_zero_in, num_zero_out));
23+
int num_zero_in = int(count(begin(is_zero_in), end(is_zero_in), 1));
24+
int num_zero_out = int(count(begin(is_zero_out), end(is_zero_out), 1));
25+
vector<pair<int, int>> edges = extra_edges(adj, num_sccs, scc_id);
26+
if (num_sccs == 1)
27+
assert(sz(edges) == 0);
28+
else
29+
assert(sz(edges) == max(num_zero_in, num_zero_out));
3230
vector<vector<int>> adj_copy(adj);
3331
for (auto [u, v] : edges) {
3432
assert(u != v);

0 commit comments

Comments
 (0)