Advertisement
Guest User

Untitled

a guest
Oct 20th, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.55 KB | None | 0 0
  1. int n;
  2.     cin >> n;
  3.     vector<vector<int>> g(n);
  4.     //vector<vector<int>> gr(n);
  5.     for (int v = 0; v < n; ++v){
  6.         int u;
  7.         cin >> u;
  8.         while (cin >> u && u != -1){
  9.             g[v].push_back(u);
  10.             //gr[u].push_back(v);
  11.         }
  12.     }
  13.     vector<vector<int>> components;
  14.     vector<int> colors(g.size());
  15.     getSCC(g, components, colors);
  16.     printComponents(components);
  17.     vector<set<int>> metaGraph(components.size());
  18.     getMetaGraph(g, colors, metaGraph);
  19.     printMetaGraph(metaGraph);
  20.     return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement