Submission #1193449

#TimeUsernameProblemLanguageResultExecution timeMemory
1193449nuutsnoyntonPipes (CEOI15_pipes)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>

using namespace std;
using ll = short;
using pll = pair < ll, ll >;
const ll N = 1e5 + 2;

ll tin[N], timer = 1, low[N];
vector < ll > adj[N];


void euler_tour(ll node, ll par) {
	tin[node] = timer;
	low[node] = timer;
	timer ++;
	bool parent_found = false;
	for ( ll nxt : adj[node]) {
		if ( nxt == par && parent_found == false) {
			parent_found = true;
			continue;
		}
		if ( tin[nxt] > 0) {
			low[node] = min(low[node], tin[nxt]);
			continue;
		}
		euler_tour(nxt, node);
		low[node] = min(low[node], low[nxt]);
		if ( low[nxt] > tin[node]) {
			cout << node << " " << nxt << endl;
		}
	}
}


int main() {
	ll n, m, r, x, y, i, j, ans, t;
	
	cin >> n >> m;
	
	for (i = 1; i <= m; i ++) {
		cin >> x >> y;
		adj[x].push_back(y);
		adj[y].push_back(x);
	}
	
	for (i = 1; i <= n; i ++) {
		if ( tin[i] == 0) euler_tour(i, -1);
	}
	
	
}

Compilation message (stderr)

pipes.cpp:6:18: warning: overflow in conversion from 'double' to 'll' {aka 'short int'} changes value from '1.00002e+5' to '32767' [-Woverflow]
    6 | const ll N = 1e5 + 2;
      |              ~~~~^~~
pipes.cpp:8:8: error: size of array 'tin' exceeds maximum object size '9223372036854775807'
    8 | ll tin[N], timer = 1, low[N];
      |        ^
pipes.cpp:8:27: error: size of array 'low' exceeds maximum object size '9223372036854775807'
    8 | ll tin[N], timer = 1, low[N];
      |                           ^
pipes.cpp:9:19: error: size of array 'adj' exceeds maximum object size '9223372036854775807'
    9 | vector < ll > adj[N];
      |                   ^