제출 #958962

#제출 시각아이디문제언어결과실행 시간메모리
958962Cyber_WolfPipes (CEOI15_pipes)C++17
0 / 100
1370 ms65536 KiB
#include <bits/stdc++.h> using namespace std; #define lg int #define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); const lg N = 1e5+5; vector<lg> adj[N]; lg n,m, low[N], tin[N], tmp, id; void dfs(lg src, lg par = -1) { tin[src] = low[src] = ++tmp; for(auto it : adj[src]) { if(it == par) { continue; } if(tin[it]) { low[src] = min(low[src], tin[it]); continue; } dfs(it, src); low[src] = min(low[src], low[it]); if(low[it] > tin[src]) { cout << it << ' ' << src << '\n'; } } // cout << src << ' ' << low[src] << '\n'; } int main() { fastio; cin >> n >> m; for(int i = 0; i < m; i++) { lg u, v; cin >> u >> v; adj[u].push_back(v); adj[v].push_back(u); } for(int i = 1; i <= n; i++) { if(!tin[i]) dfs(i); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...