Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n;
- cin >> n;
- vector<vector<int>> g(n);
- //vector<vector<int>> gr(n);
- for (int v = 0; v < n; ++v){
- int u;
- cin >> u;
- while (cin >> u && u != -1){
- g[v].push_back(u);
- //gr[u].push_back(v);
- }
- }
- vector<vector<int>> components;
- vector<int> colors(g.size());
- getSCC(g, components, colors);
- printComponents(components);
- vector<set<int>> metaGraph(components.size());
- getMetaGraph(g, colors, metaGraph);
- printMetaGraph(metaGraph);
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement