This documentation is automatically generated by competitive-verifier/competitive-verifier
// competitive-verifier: PROBLEM https://judge.yosupo.jp/problem/two_edge_connected_components
#include <bits/stdc++.h>
#include "../graph/connected-components/incremental-bridge-connectivity.hpp"
using namespace std;
#ifdef LOCAL
#include "copypaste/debug.h"
#else
#define debug(...) 42
#endif
#define endl '\n'
struct fast_ios {
fast_ios() {
cin.tie(nullptr);
ios::sync_with_stdio(false);
cout << fixed << setprecision(10);
};
} fast_ios_;
int main() {
#ifdef LOCAL
freopen("./data.in", "r", stdin);
#endif
int n, m;
cin >> n >> m;
IncrementalBridgeConnectivity ibc(n);
for (int i = 0; i < m; i++) {
int u, v;
cin >> u >> v;
ibc.add_edge(u, v);
}
vector<vector<int>> groups(n);
for (int i = 0; i < n; i++) {
groups[ibc.find(i)].push_back(i);
}
int k = 0;
for (int i = 0; i < n; i++) {
if ((int)groups[i].size()) k++;
}
cout << k << endl;
// cout << ibc.bridge_size() + 1 << endl;
for (int i = 0; i < n; i++) {
if ((int)groups[i].size()) {
cout << (int)groups[i].size();
for (auto &u : groups[i]) {
cout << ' ' << u;
}
cout << endl;
}
}
}
Traceback (most recent call last):
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj_resolve/resolver.py", line 181, in resolve
bundled_code = language.bundle(path, basedir=basedir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus.py", line 252, in bundle
bundler.update(path)
File "/home/runner/.local/lib/python3.12/site-packages/competitive_verifier/oj/verify/languages/cplusplus_bundle.py", line 477, in update
raise BundleErrorAt(
competitive_verifier.oj.verify.languages.cplusplus_bundle.BundleErrorAt: test/yosupo-two-edge-connected-components-2.test.cpp: line 9: unable to process #include in #if / #ifdef / #ifndef other than include guards
Env | Name | Status | Elapsed | Memory |
---|---|---|---|---|
g++ | example_00 |
![]() |
5 ms | 4 MB |
g++ | example_01 |
![]() |
5 ms | 4 MB |
g++ | example_02 |
![]() |
4 ms | 4 MB |
g++ | large_cycle_00 |
![]() |
46 ms | 11 MB |
g++ | max_random_00 |
![]() |
73 ms | 16 MB |
g++ | max_random_01 |
![]() |
76 ms | 16 MB |
g++ | max_random_02 |
![]() |
75 ms | 16 MB |
g++ | random_1_00 |
![]() |
52 ms | 11 MB |
g++ | random_1_01 |
![]() |
57 ms | 13 MB |
g++ | random_1_02 |
![]() |
34 ms | 6 MB |
g++ | random_2_00 |
![]() |
19 ms | 4 MB |
g++ | random_2_01 |
![]() |
8 ms | 4 MB |
g++ | random_2_02 |
![]() |
27 ms | 5 MB |
g++ | random_2_03 |
![]() |
37 ms | 5 MB |
g++ | random_2_04 |
![]() |
16 ms | 4 MB |
g++ | small_random_1_00 |
![]() |
4 ms | 4 MB |
g++ | small_random_1_01 |
![]() |
4 ms | 4 MB |
g++ | small_random_1_02 |
![]() |
4 ms | 4 MB |
g++ | small_random_2_00 |
![]() |
4 ms | 4 MB |
g++ | small_random_2_01 |
![]() |
4 ms | 3 MB |
g++ | small_random_2_02 |
![]() |
4 ms | 4 MB |