Submission #731335

#TimeUsernameProblemLanguageResultExecution timeMemory
731335esomerPipes (CEOI15_pipes)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define endl "\n" typedef long long int ll; const int MOD = 1e9 + 7; int cnt = 1; int DFS(int x, vector<vector<pair<int, int>>>& adj, vector<int>& vis, int edge){ vis[x] = cnt; int mn = cnt; cnt++; for(pair<int, int> pr : adj[x]){ int node = pr.first; if(pr.second == edge) continue; if(vis[node] > 0){ mn = min(mn, vis[node]); }else{ int val = DFS(node, adj, vis, mn, pr.second); mn = min(mn, val); if(val > vis[x]){ cout << node + 1 << " " << x + 1 << endl; } } } return mn; } void solve(){ int n, m; cin >> n >> m; vector<vector<pair<int, int>>> adj(n); for(int i = 0; i < m; i++){ int u, v; cin >> u >> v; u--; v--; adj[u].push_back({v, i}); adj[v].push_back({u, i}); } vector<int> vis(n, 0); for(int i = 0; i < n; i++){ if(!vis[i]){ DFS(i, adj, vis, -1); } } } signed main(){ ios_base::sync_with_stdio(0); cin.tie(0); //~ int tt; cin >> tt; int tt = 1; for(int t = 1; t <= tt; t++){ solve(); } }

Compilation message (stderr)

pipes.cpp: In function 'int DFS(int, std::vector<std::vector<std::pair<int, int> > >&, std::vector<int>&, int)':
pipes.cpp:21:47: error: too many arguments to function 'int DFS(int, std::vector<std::vector<std::pair<int, int> > >&, std::vector<int>&, int)'
   21 |    int val = DFS(node, adj, vis, mn, pr.second);
      |                                               ^
pipes.cpp:13:5: note: declared here
   13 | int DFS(int x, vector<vector<pair<int, int>>>& adj, vector<int>& vis, int edge){
      |     ^~~