Submission #1003081

# Submission time Handle Problem Language Result Execution time Memory
1003081 2024-06-20T05:24:41 Z vjudge1 Pipes (CEOI15_pipes) C++17
0 / 100
868 ms 65536 KB
#include <iostream>
#include <vector>

#define adiyer(); ios_base::sync_with_stdio(0); cin.tie(0);

using namespace std;

int n, m, timer;
int tin[100001], tout[100001], fup[100001];

vector < int > g[100001];

bool was[1000001];

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 time Memory Grader output
1 Incorrect 1 ms 2652 KB Wrong number of edges
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 3420 KB Wrong number of edges
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 74 ms 16444 KB Memory limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 127 ms 23888 KB Memory limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 225 ms 41556 KB Memory limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 298 ms 52192 KB Memory limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 575 ms 65536 KB Memory limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 708 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 811 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 868 ms 65536 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -