File tree Expand file tree Collapse file tree
tests/library_checker_aizu_tests/graphs Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44#include " ../../../library/graphs/bridges_cuts/cuts_callback.hpp"
55int main () {
66 cin.tie (0 )->sync_with_stdio (0 );
7- int n,m;
8- cin>>n>> m;
7+ int n, m;
8+ cin >> n >> m;
99 vector<basic_string<int >> adj (n);
10- for (int i = 0 ; i <n; i++) {
11- adj[i] += i;
12- }
13- for (int i = 0 ; i <m; i++) {
14- int u,v;
15- cin>>u>>v;
10+ for (int i = 0 ; i < n; i++) adj[i] += i;
11+ for (int i = 0 ; i < m; i++) {
12+ int u, v;
13+ cin >> u >> v;
1614 adj[u] += v;
1715 adj[v] += u;
1816 }
1917 vector<bool > vis (n, 0 );
2018 vector<vector<int >> all_bccs;
2119 cuts_callback (adj, [&](const vi& nodes_bcc) {
22- for (int v : nodes_bcc){
23- vis[v] = 1 ;
24- }
20+ for (int v : nodes_bcc) vis[v] = 1 ;
2521 all_bccs.push_back (nodes_bcc);
2622 });
27- for (int i = 0 ; i <n; i++) {
28- if (!vis[i]) {
29- all_bccs.push_back ({i});
30- }
31- }
23+ for (int i = 0 ; i < n; i++)
24+ if (!vis[i]) all_bccs.push_back ({i});
3225 cout << ssize (all_bccs) << ' \n ' ;
33- for (const vector<int >& other_nodes : all_bccs) {
34- cout<<ssize (other_nodes)<<' ' ;
35- for (int v : other_nodes){
36- cout<<v<<' ' ;
37- }
38- cout<<' \n ' ;
26+ for (const vector<int >& other_nodes : all_bccs) {
27+ cout << ssize (other_nodes) << ' ' ;
28+ for (int v : other_nodes) cout << v << ' ' ;
29+ cout << ' \n ' ;
3930 }
4031 return 0 ;
4132}
You can’t perform that action at this time.
0 commit comments