Submission #1003084

#TimeUsernameProblemLanguageResultExecution timeMemory
1003084adiyerPipes (CEOI15_pipes)C++17
0 / 100
1 ms604 KiB
#include <iostream> #include <vector> #define adiyer(); ios_base::sync_with_stdio(0); cin.tie(0); using namespace std; int n, m, timer; int tin[101], tout[101], fup[101]; vector < int > g[101]; bool was[101]; void dfs(int v, int p){ was[v] = 1; fup[v] = tin[v] = ++timer; bool c; for(int u : g[v]){ if(u == p && !c){ c = 1; continue; } if(was[u]){ fup[v] = min(tin[u], fup[v]); } else{ dfs(u, v); fup[v] = min(fup[u], fup[v]); if(fup[u] > tin[v]){ cout << u << ' ' << v << '\n'; } } } } int u, v; int main(){ adiyer(); cin >> n >> m; for(int i = 1; i <= m; i++) cin >> u >> v, g[v].push_back(u), g[u].push_back(v); for(int i = 1; i <= n; i++) if(!was[i]) dfs(i, 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...