# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1167237 | ByeWorld | Pipes (CEOI15_pipes) | C++20 | 2484 ms | 94680 KiB |
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
const int MAXN = 1e5+10;
int n,m, low[MAXN], disc[MAXN], tim;
vector <int> adj[MAXN];
bool done[MAXN];
void dfs(int nw, int par){
done[nw] = 1;
low[nw] = disc[nw] = ++tim;
for(auto nx :adj[nw]){
if(nx==par) continue;
if(disc[nx]==0){
dfs(nx, nw); low[nw] = min(low[nw], low[nx]);
} else low[nw] = min(low[nw], disc[nx]);
if(low[nx] > disc[nw]) cout << nw << ' ' << nx << "\n";
}
}
signed main(){
// ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>n>>m;
while(m--){
int x,y; cin>>x>>y;
adj[x].pb(y);adj[y].pb(x);
}
for(int i=1; i<=n; i++){
if(!done[i]) dfs(i, -1);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |