criyle/codenet-compile-errors huggingface dataset:
Language: C++

// lolinkの自作ライブラリ
/* option1:グラフが非連結の場合,option2:bridgeの検出,option3:関節点の検出*/
#include <bits/stdc++.h>
#define REP(i,n) for (long i=0;i<(n);i++)
#define FOR(i,a,b) for (long i=(a);i<(b);i++)
#define dump1d_arr(array) REP(i,array.size()) cerr << #array << "[" << (i) << "] ==> " << (array[i]) << endl;
#define dump2d_arr(array) REP(i,array.size()) REP(j,array[i].size()) cerr << #array << "[" << (i) << "]" << "[" << (j) << "] ==> " << (array[i][j]) << endl;
#define dump(x)  cerr << #x << " => " << (x) << endl;
#define CLR(vec) { REP(i,vec.size()) vec[i] = 0; } 
#define loINF (long)10000000000
#define shINF (short)10000
#define SORT(c) sort((c).begin(),(c).end())
//#define NOT_ALL_CONNECTED 	//option1
//#define BRIDGE   				//option2
#define ARTICULATION_POINT    //option3
using namespace std;
const long V_START = 0;
typedef vector<long> VL;
typedef vector<VL> VVL;
typedef pair<long,long> pr;
typedef vector<pr> VP;

VVL edge;
VL ord;
VL low;
VL pre;

void dfs(long now_ver,long parent,long order){
	long child_num = 1;
	char flag = 0;
	pre[now_ver] = parent;
	low[now_ver] = ord[now_ver] = order;

	REP(i,edge[now_ver].size()){
		long to = edge[now_ver][i];
		if (to == parent) continue;
		if (ord[to] == -1) { // 子ノードへの辺
			dfs(to,now_ver,order + child_num);
			child_num++;
			low[now_ver] = min(low[now_ver],low[to]);
		}
		low[now_ver]=min(low[now_ver],ord[to]);
	}
}

int main(void){
	long V,E;
	cin >> V >> E;
	edge = VVL(V+1,VL(0));
	ord = VL(V+1,-1);
	low = VL(V+1,loINF);
	pre = VL(V+1,-1);

	REP(i,E){
		long u,v;
		cin >> u >> v;
		edge[u].push_back(v);
		edge[v].push_back(u); 
	}

	#ifdef NOT_ALL_CONNECTED // グラフが非連結の場合
		FOR(i,V_START,V+V_START) 
			if(ord[i] == -1)
				dfs(i,-1,1);
	#endif

	#ifndef NOT_ALL_CONNECTED // グラフが連結の場合
		dfs(1,-1,1);
	#endif

	#ifdef BRIDGE
		VP bridge;
		long bridge_count = 0;

		FOR(i,V_START,V+V_START){
			if (ord[i] == low[i]) {
				bridge.push_back(make_pair(i,pre[i]));
				bridge_count++;
			}
		}

		REP(i,bridge.size()) cout << bridge[i].first << "-" << bridge[i].second << endl;
	#endif

	#ifdef ARTICULATION_POINT
		VL point;
		long point_count = 0;
		char root_count = 0;
		FOR(i,V_START,V+V_START){
			if (pre[i] == -1) continue;
			if (pre[i] == 1) root_count++;
			else {
				if (ord[pre[i]] <= low[i]) {
					point.push_back(pre[i]);
					point_count++;
				}
			}
		}
		if(root_count >= 2) {
			point.push_back(1);
			point_count++;
		}

		SORT(point);
		point.erase(unique(ans.begin(),ans.end()),ans.end());
		REP(i,point.size()) cout << point[i] << endl;
		//cout << "関節点の個数:" << point_count << endl;

	#endif

	#ifdef DEBUG
		dump1d_arr(ord);
		dump1d_arr(low);
		dump1d_arr(pre);
	#endif

	return 0;
}




Compiler output:
a.cc: In function 'int main()':
a.cc:105:36: error: 'ans' was not declared in this scope; did you mean 'abs'?
  105 |                 point.erase(unique(ans.begin(),ans.end()),ans.end());
      |                                    ^~~
      |                                    abs
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
const int maxn = 10001;

vector<int> G[maxn], ans;
int n, e;
int prenum[maxn], parent[maxn], lowest[maxn], vis[maxn];
int time;
void dfs(int s)
{
    prenum[s] = lowest[s] = time++;
    vis[s] = 1;
    for(int i = 0; i < G[s].size(); i++)
    {
        int v = G[s][i];
        if(vis[v] == 0)
        {
            parent[v] = s;
            dfs(v);
            lowest[s] = min(lowest[s], lowest[v]);
        }
        else
        {
            lowest[s] = min(prenum[v], lowest[s]);
        }
    }
}

void art_points()
{
    for(int i = 0; i < n; i++)
        vis[i] = 0;
    time = 1;
    parent[0] = -1;
    dfs(0);
    int cnt = 0;
    for(int i = 1; i < n; i++)
    {
        int p = parent[i];
        if(p == 0) cnt++;
        else if (prenum[p] <= lowest[i] ) ans.push_back(p);
    }
    if(cnt > 1) ans.push_back(0);
    sort(ans.begin(), ans.end());
    for(int i = 0; i < ans.size(); i++)
        cout << ans[i] << endl;
}

int main()
{
    cin >> n >> e;
    for(int i = 0; i < e; i++)
    {
        int s, t;
        cin >> s >> t;
        G[s].push_back(t);
        G[t].push_back(s);
    }
    art_points();
    return 0;
}





Compiler output:
a.cc:10:5: error: 'int time' redeclared as different kind of entity
   10 | int time;
      |     ^~~~
In file included from /usr/include/pthread.h:23,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr-default.h:35,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/gthr.h:157,
                 from /usr/include/c++/14/ext/atomicity.h:35,
                 from /usr/include/c++/14/bits/ios_base.h:39,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/time.h:76:15: note: previous declaration 'time_t time(time_t*)'
   76 | extern time_t time (time_t *__timer) __THROW;
      |               ^~~~
a.cc: In function 'void dfs(int)':
a.cc:13:29: warning: ISO C++ forbids incrementing a pointer of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} [-Wpointer-arith]
   13 |     prenum[s] = lowest[s] = time++;
      |                             ^~~~
a.cc:13:33: error: lvalue required as increment operand
   13 |     prenum[s] = lowest[s] = time++;
      |                                 ^~
a.cc: In function 'void art_points()':
a.cc:35:10: error: assignment of function 'time_t time(time_t*)'
   35 |     time = 1;
      |     ~~~~~^~~
Language: C++

#include<iostream>
#include<vector>
#include<set>
using namespace std;

#define MAX 100000

vector<int> G[MAX];
int N;
bool visited[MAX];
int prenum[MAX], parent[MAX], lowest[MAX], timer;

void dfs(int current, int prev) {
	prenum[current] = lowest[current] = timer;
	timer++;

	visited[current] = true;

	int next;

	for (int i = 0; i < G[current].size(); i++) {
		next = G[current][i];
		if (!visited[next]) {
			parent[next] = current;

			dfs(next, current);

			lowest[current] = min(lowest[current], lowest[next]);
		}
		else if (next != prev) {
			lowest[current] = min(lowest[current], prenum[next]);
		}
	}
}

void art_points() {
	for (int i = 0; i < N; i++)visited[i] = false;
	timer = 1;
	dfs(0. - 1);

	set<int> ap;
	int np = 0;
	for (int i = 1; i < N; i++) {
		int p = parent[i];
		if (p == 0)np++;
		else if (prenum[p] <= lowest[i])ap.insert(p);
	}
	if (np > 1)ap.insert(0);
	for (set<int>::iterator it = ap.begin(); it != ap.end(); it++)
		cout << *it << endl;
}

int main() {
	int m;
	cin >> N >> m;

	for (int i = 0; i < m; i++) {
		int s, t;
		cin >> s >> t;
		G[s].push_back(t);
		G[t].push_back(s);
	}
	art_points();

	return 0;
}


Compiler output:
a.cc: In function 'void art_points()':
a.cc:39:12: error: too few arguments to function 'void dfs(int, int)'
   39 |         dfs(0. - 1);
      |         ~~~^~~~~~~~
a.cc:13:6: note: declared here
   13 | void dfs(int current, int prev) {
      |      ^~~
Language: C++

#include<iostream>
#include<vector>
#include<set>

using namespace std;

static const int MAX = 100000;

vector<int> G[MAX];
int N;
bool visited[MAX];
int prenum[MAX], parent[MAX], lowest[MAX], timer;

void dfs(int current, int prev) {
  prenum[current] = lowest[current] = timer;
  timer++;

  visited[current] = true;

  int next;

  for (int i = 0; i < G[current].size(); i++) {
    next = G[current][i];
    if (!visited[next]) {
      parent[next] = current

      dfs(next, current);
      lowest[current] = min(lowest[current], lowest[next]);
    } else if (next != prev) {
      lowest[current] = min(lowest[currrent], prenum[next]);
    }
  }
}

void articulation_point() {
  for (int i = 0; i < N; i++) {
  visited[i] = false;
  }
  timer = 1;
  dfs(0, -1);

  set<int> ap;
  int np = 0;
  for (int i = 1; i < N; i++) {
    int p = parent[i];
    if (p == 0) {
      np++;
    } else if (prenum[p] <= lowest[i]) {
      ap.insert(p);
    }
  }
  if (np > 0) {
    ap.insert(0);
  }
  for (set<int>::iterator it = ap.begin(); it != ap.end(); it++) {
    cout << *it << endl;
  }
}

int main() {
  int m;
  cin >> N >> m;

  for (int i = 0; i < m; i++) {
    int s, t;
    cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  articulation_points();

  return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:25:29: error: expected ';' before 'dfs'
   25 |       parent[next] = current
      |                             ^
      |                             ;
   26 | 
   27 |       dfs(next, current);
      |       ~~~                    
a.cc:30:36: error: 'currrent' was not declared in this scope; did you mean 'current'?
   30 |       lowest[current] = min(lowest[currrent], prenum[next]);
      |                                    ^~~~~~~~
      |                                    current
a.cc: In function 'int main()':
a.cc:71:3: error: 'articulation_points' was not declared in this scope; did you mean 'articulation_point'?
   71 |   articulation_points();
      |   ^~~~~~~~~~~~~~~~~~~
      |   articulation_point
Language: C++

#include<iostream>
#include<vector>
#include<set>

using namespace std;

static const int MAX = 100000;

vector<int> G[MAX];
int N;
bool visited[MAX];
int prenum[MAX], parent[MAX], lowest[MAX], timer;

void dfs(int current, int prev) {
  prenum[current] = lowest[current] = timer;
  timer++;

  visited[current] = true;

  int next;

  for (int i = 0; i < G[current].size(); i++) {
    next = G[current][i];
    if (!visited[next]) {
      parent[next] = current;

      dfs(next, current);
      lowest[current] = min(lowest[current], lowest[next]);
    } else if (next != prev) {
      lowest[current] = min(lowest[currrent], prenum[next]);
    }
  }
}

void articulation_point() {
  for (int i = 0; i < N; i++) {
  visited[i] = false;
  }
  timer = 1;
  dfs(0, -1);

  set<int> ap;
  int np = 0;
  for (int i = 1; i < N; i++) {
    int p = parent[i];
    if (p == 0) {
      np++;
    } else if (prenum[p] <= lowest[i]) {
      ap.insert(p);
    }
  }
  if (np > 0) {
    ap.insert(0);
  }
  for (set<int>::iterator it = ap.begin(); it != ap.end(); it++) {
    cout << *it << endl;
  }
}

int main() {
  int m;
  cin >> N >> m;

  for (int i = 0; i < m; i++) {
    int s, t;
    cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  articulation_points();

  return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:30:36: error: 'currrent' was not declared in this scope; did you mean 'current'?
   30 |       lowest[current] = min(lowest[currrent], prenum[next]);
      |                                    ^~~~~~~~
      |                                    current
a.cc: In function 'int main()':
a.cc:71:3: error: 'articulation_points' was not declared in this scope; did you mean 'articulation_point'?
   71 |   articulation_points();
      |   ^~~~~~~~~~~~~~~~~~~
      |   articulation_point
Language: C++

#include<iostream>
#include<vector>
#include<set>

using namespace std;

static const int MAX = 100000;

vector<int> G[MAX];
int N;
bool visited[MAX];
int prenum[MAX], parent[MAX], lowest[MAX], timer;

void dfs(int current, int prev) {
  prenum[current] = lowest[current] = timer;
  timer++;

  visited[current] = true;

  int next;

  for (int i = 0; i < G[current].size(); i++) {
    next = G[current][i];
    if (!visited[next]) {
      parent[next] = current;

      dfs(next, current);
      lowest[current] = min(lowest[current], lowest[next]);
    } else if (next != prev) {
      lowest[current] = min(lowest[current], prenum[next]);
    }
  }
}

void articulation_point() {
  for (int i = 0; i < N; i++) {
  visited[i] = false;
  }
  timer = 1;
  dfs(0, -1);

  set<int> ap;
  int np = 0;
  for (int i = 1; i < N; i++) {
    int p = parent[i];
    if (p == 0) {
      np++;
    } else if (prenum[p] <= lowest[i]) {
      ap.insert(p);
    }
  }
  if (np > 0) {
    ap.insert(0);
  }
  for (set<int>::iterator it = ap.begin(); it != ap.end(); it++) {
    cout << *it << endl;
  }
}

int main() {
  int m;
  cin >> N >> m;

  for (int i = 0; i < m; i++) {
    int s, t;
    cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  articulation_points();

  return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:71:3: error: 'articulation_points' was not declared in this scope; did you mean 'articulation_point'?
   71 |   articulation_points();
      |   ^~~~~~~~~~~~~~~~~~~
      |   articulation_point
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define fi first
#define se second
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef vector<int> vi;
const int inf = 1e9+7;
const int INF = 1e18+7;

class LowLink{
public:
	int n, cnt1;
	vector<vector<int> > G, G2;	//G2は作ったグラフ(木)
	vector<int> pre, low, cmp, used;	//cmpは作成後のindex
	init(int m){
		n = m;cnt1 = 0;
		pre.resize(n);low.resize(n);used.resize(n);
		G.resize(n);G2.resize(n);cmp.resize(n);
		fill(all(pre), -1);
	}
	void add_edge(int x, int y){
		G[x].pb(y);G[y].pb(x);
	}
	int dfs(int p = 0, int par = -1){	//橋の検出
		if(pre[p] >= 0)return pre[p];
		pre[p] = low[p] = cnt1++;
		rep(i,G[p].size())if(par != G[p][i]){
			int res = dfs(G[p][i], p);
			low[p] = min(low[p], res);
		}
		return low[p];
	}
	int build(int p = 0, int x = 0){	//橋のみを残した木の構築
		int mx = x;cmp[p] = x;
		used[p] = 1;
		rep(i,G[p].size())if(!used[G[p][i]]){
			if(pre[G[p][i]] == low[G[p][i]]){			//橋
				G2[x].pb(x+1);G2[x+1].pb(x);
				chmax(mx, build(G[p][i], x+1));
			}
			chmax(mx, build(G[p][i], x));
		}
		return mx;
	}
	int lowlink(){
		rep(i,n)if(!used[i])dfs(i);
		fill(all(used), 0);
		int k = 0;
		rep(i,n)if(!used[i])k += (build(i, k)-k)+1;
		return k;
	}
};

vector<P> ans;
signed main(){
	LowLink low;
	int n, m;
	scanf("%lld%lld", &n, &m);
	low.init(n);
	rep(i,m){
		int v, u;
		scanf("%lld%lld", &v, &u);
		low.add_edge(v, u);
	}
	int size = low.lowlink();
	vector<vector<int> > G = low.G2;
	rep(i,size){
		rep(j,G[i].size()){
			if(i < G[i][j])ans.push_back(P(i, G[i][j]));
		}
	}
	//printf("%lld\n", size);
	sort(all(ans));
	size = ans.size();
	rep(i,size)printf("%lld %lld\n", ans[i].fi, ans[i].se);
	return 0;
}







Compiler output:
a.cc:32:9: error: ISO C++ forbids declaration of 'init' with no type [-fpermissive]
   32 |         init(int m){
      |         ^~~~
a.cc: In member function 'int LowLink::init(long long int)':
a.cc:37:9: warning: no return statement in function returning non-void [-Wreturn-type]
   37 |         }
      |         ^
Language: C++

#include <iostream>
#include <vector>
using namespace std;

struct Edge {
    int from,to;
    Edge(int f,int t) : from(f), to(t){}
};

using Edges = vector<Edge>;
using Graph = vector<Edges>;

class LowLink {
    public:
        LowLink(int n) : mGraph(n), mOrd(n), mLow(n), mUsed(n,false) {}
        void add_edge(int u, int v){
            mGraph[u].emplace_back(u,v);
            mGraph[v].emplace_back(v,u);
        }
        // e(u,v)が橋　<=> ord[u] < low[v]
        // 頂点vが関節点 <=> ord[u] <= low[v]となるvの子uが存在
        int dfs(int v,int pv,int k){
            mUsed[v] = true;
            mOrd[v] = mLow[v] = k++; // 訪れた順
            bool is_articulation = false;
            int cnt = 0;
            for(Edge nv : mGraph[v]){
                if(!mUsed[nv.to]){ // まだ訪れてない
                    ++cnt;
                    k = dfs(nv.to,v,k);
                    mLow[v] = min(mLow[v], mLow[nv.to]);

                    is_articulation |= ~pv && mOrd[v] <= mLow[nv.to];
                    if(mOrd[v] < mLow[nv.to]) mBridges.emplace_back(v,nv.to);
                } else if(nv.to != pv){ // 後退辺だったら
                    mLow[v] = min(mLow[v], mOrd[nv.to]);
                }
            }
            is_articulation |= pv == -1 && cnt > 1;
            if(is_articulation) mArticulationPoints.push_back(v);

            return k;
        }

        void Init(){
            int k = 0;
            for(int i = 0; i < mGraph.size(); ++i){
                if(!mUsed[i]) k = dfs(i,k,-1);
            }
        }

        vector<pair<int,int> > GetBridges(){ return mBridges;}
        vector<int> GetArticulationPoints(){ return mArticulationPoints;}

    private:
        Graph mGraph;
        vector<int> mOrd;
        vector<int> mLow;
        vector<bool> mUsed;
        vector<pair<int,int> > mBridges;
        vector<int> mArticulationPoints;
};


int main(){
    int V,E,s,t;
    cin >> V >> E;
    LowLink lowlink(V);
    for(int i = 0; i < E; ++i){
        cin >> s >> t;
        lowlink.add_edge(s,t);
    }
    lowlink.Init();
    auto ans = lowlink.GetBridges();
    sort(ans.begin(),ans.end());
    for(auto e : ans){ cout << e.first << " " << e.second << endl;}
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:75:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   75 |     sort(ans.begin(),ans.end());
      |     ^~~~
      |     short
Language: C++

#include<cstdio>
#include<vector>
#include<algorithm>

using namespace std;

vector<int> E[100010];
vector<int> res;
bool pass[100010][100010];
int o[100010];

int dfs(int i,int n) {
    if(o[i]) {
        o[i] = min(o[i], n);
        return o[i];
    }
    o[i] = n;
    for(vector<int>::iterator it=E[i].begin(); it != E[i].end(); it++) {
        if(pass[i][*it]) continue;
        pass[i][*it] = pass[*it][i] = true;
        o[i] = min(o[i], dfs(*it, n+1));
    }
    return o[i];
}

int main(void) {
    int v,e;
    scanf("%d%d",&v,&e);
    for(int i=0; i<e; i++) {
        int s,t;
        scanf("%d%d",&s,&t);
        E[s].push_back(t);
        E[t].push_back(s);
    }
    for(int i=0; i<v; i++)
        sort(E[i].begin(), E[i].end());

    dfs(0,1);

    for(int i=0; i<v; i++)
        for(vector<int>::iterator it = E[i].begin(); it != E[i].end(); it++) {
            if(i > *it) continue;
            if(o[i] == o[*it]) continue;
            printf("%d %d\n",i,*it);
        }
    return 0;
}

Compiler output:
/tmp/ccHrINA1.o: in function `dfs(int, int)':
a.cc:(.text+0x1f): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccHrINA1.o
a.cc:(.text+0x3a): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccHrINA1.o
a.cc:(.text+0x63): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccHrINA1.o
a.cc:(.text+0x7a): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccHrINA1.o
a.cc:(.text+0x9a): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccHrINA1.o
a.cc:(.text+0x1ad): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccHrINA1.o
a.cc:(.text+0x1d6): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccHrINA1.o
a.cc:(.text+0x245): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccHrINA1.o
/tmp/ccHrINA1.o: in function `main':
a.cc:(.text+0x3e8): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccHrINA1.o
a.cc:(.text+0x40a): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccHrINA1.o
collect2: error: ld returned 1 exit status
Language: C++

#include<cstdio>
#include<vector>
#include<algorithm>

using namespace std;

vector<int> E[100010];
vector<int> res;
char pass[100010][100010];
int o[100010];

int dfs(int i,int n) {
    if(o[i]) {
        o[i] = min(o[i], n);
        return o[i];
    }
    o[i] = n;
    for(vector<int>::iterator it=E[i].begin(); it != E[i].end(); it++) {
        if(pass[i][*it]) continue;
        pass[i][*it] = pass[*it][i] = true;
        o[i] = min(o[i], dfs(*it, n+1));
    }
    return o[i];
}

int main(void) {
    int v,e;
    scanf("%d%d",&v,&e);
    for(int i=0; i<e; i++) {
        int s,t;
        scanf("%d%d",&s,&t);
        E[s].push_back(t);
        E[t].push_back(s);
    }
    for(int i=0; i<v; i++)
        sort(E[i].begin(), E[i].end());

    dfs(0,1);

    for(int i=0; i<v; i++)
        for(vector<int>::iterator it = E[i].begin(); it != E[i].end(); it++) {
            if(i > *it) continue;
            if(o[i] == o[*it]) continue;
            printf("%d %d\n",i,*it);
        }
    return 0;
}

Compiler output:
/tmp/ccb04wTb.o: in function `dfs(int, int)':
a.cc:(.text+0x1f): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccb04wTb.o
a.cc:(.text+0x3a): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccb04wTb.o
a.cc:(.text+0x63): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccb04wTb.o
a.cc:(.text+0x7a): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccb04wTb.o
a.cc:(.text+0x9a): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccb04wTb.o
a.cc:(.text+0x1b2): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccb04wTb.o
a.cc:(.text+0x1db): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccb04wTb.o
a.cc:(.text+0x24a): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccb04wTb.o
/tmp/ccb04wTb.o: in function `main':
a.cc:(.text+0x3ed): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccb04wTb.o
a.cc:(.text+0x40f): relocation truncated to fit: R_X86_64_PC32 against symbol `o' defined in .bss section in /tmp/ccb04wTb.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<climits>
using namespace std;

const int V_MAX=100000;
const int E_MAX=100000;

struct edge{
	int from;
	int to;
	bool operator<( const edge& right ) const {
        return from == right.from ? to < right.to : from < right.from;
    }
};

vector<int> G[V_MAX];
bool used_v[V_MAX]={};
bool used_e[E_MAX][E_MAX]={};
vector<int> pre(V_MAX,INT_MAX);
vector<int> low(V_MAX,INT_MAX);
vector<edge> result;
int order;

void dfs(int s,int p){
	if(used_v[s]==true){return;}
	used_v[s]=true;
	pre[s]=order;
	low[s]=order;
	order++;
	for (int i=0;i<G[s].size();i++){
		used_e[s][G[s][i]]=true;
		if(!used_v[G[s][i]]){
			dfs(G[s][i],s);
			low[s]=min(low[s],low[G[s][i]]);
		}else if(!used_e[G[s][i]][s]){
			low[s]=min(low[s],pre[G[s][i]]);
		}
	}
	if(!(s==0 && p==0) && low[s]>pre[p]){
		edge e;
		e.from=min(s,p);
		e.to=max(s,p);
		result.push_back(e); 
	}
}

int main(){
	int V,E,s,t;
	cin>> V >> E;
	for (int i=0;i<E;i++){
		cin >> s >> t;
		G[s].push_back(t);
		G[t].push_back(s);
	}
	
	order=0;
	dfs(0,0);
	
	sort(result.begin(),result.end());
	for(int i=0;i<result.size();i++){
		cout << result[i].from << " " << result[i].to << endl;
	}
	/*
	for(int i=0;i<V;i++){
		cout << pre[i] << " ";
	}
	cout << endl;
	
	for(int i=0;i<V;i++){
		cout << low[i] << " ";
	}
	for (int i=0;i<V;i++){
		for (int j=0;j<V;j++){
			cout << used_e[i][j] <<" " ;
		}
	}
	*/
	return 0;
}

Compiler output:
/tmp/cc0Wlrk0.o: in function `dfs(int, int)':
a.cc:(.text+0x3d): relocation truncated to fit: R_X86_64_PC32 against symbol `order' defined in .bss section in /tmp/cc0Wlrk0.o
a.cc:(.text+0x4c): relocation truncated to fit: R_X86_64_PC32 against symbol `pre' defined in .bss section in /tmp/cc0Wlrk0.o
a.cc:(.text+0x5c): relocation truncated to fit: R_X86_64_PC32 against symbol `order' defined in .bss section in /tmp/cc0Wlrk0.o
a.cc:(.text+0x6b): relocation truncated to fit: R_X86_64_PC32 against symbol `low' defined in .bss section in /tmp/cc0Wlrk0.o
a.cc:(.text+0x7b): relocation truncated to fit: R_X86_64_PC32 against symbol `order' defined in .bss section in /tmp/cc0Wlrk0.o
a.cc:(.text+0x84): relocation truncated to fit: R_X86_64_PC32 against symbol `order' defined in .bss section in /tmp/cc0Wlrk0.o
a.cc:(.text+0x19b): relocation truncated to fit: R_X86_64_PC32 against symbol `low' defined in .bss section in /tmp/cc0Wlrk0.o
a.cc:(.text+0x1b5): relocation truncated to fit: R_X86_64_PC32 against symbol `low' defined in .bss section in /tmp/cc0Wlrk0.o
a.cc:(.text+0x1d9): relocation truncated to fit: R_X86_64_PC32 against symbol `low' defined in .bss section in /tmp/cc0Wlrk0.o
a.cc:(.text+0x27c): relocation truncated to fit: R_X86_64_PC32 against symbol `pre' defined in .bss section in /tmp/cc0Wlrk0.o
a.cc:(.text+0x296): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999
//#define INF (1LL<<59)


#define MAX_V 100000
vector<int> G[MAX_V];
bool usedV[MAX_V],usedE[MAX_V][MAX_V];
int ord[MAX_V],lowlink[MAX_V];
int k=0;


void dfs(int v){	//make ord and lowlink
	usedV[v] = true;
	ord[v]=lowlink[v]=k;
	k++;
	
	rep(i,G[v].size()){
		int to = G[v][i];
		if(!usedV[to]){
			usedE[v][to] = true;
			dfs(to);
			lowlink[v] = min(lowlink[v],lowlink[to]);
		}
		else if(!usedE[to][v]){	//use back edge
			lowlink[v] = min(lowlink[v],ord[to]);
		}
	}
}


int main(){
	int v,e;
	cin>>v>>e;
	vector<pii> edges;
	rep(i,e){
		int s,t;
		cin>>s>>t;
		if(s>t)swap(s,t);
		edges.pb(pii(s,t));
		G[s].pb(t);
		G[t].pb(s);
	}
	
	dfs(0);
	
	rep(i,e){
		if(ord[edges[i].first]<lowlink[edges[i].second])cout<<edges[i].first<<" "<<edges[i].second<<endl;
	}
}

Compiler output:
/tmp/cczt4ZJc.o: in function `dfs(int)':
a.cc:(.text+0x1d): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/cczt4ZJc.o
a.cc:(.text+0x32): relocation truncated to fit: R_X86_64_PC32 against symbol `lowlink' defined in .bss section in /tmp/cczt4ZJc.o
a.cc:(.text+0x49): relocation truncated to fit: R_X86_64_PC32 against symbol `lowlink' defined in .bss section in /tmp/cczt4ZJc.o
a.cc:(.text+0x61): relocation truncated to fit: R_X86_64_PC32 against symbol `ord' defined in .bss section in /tmp/cczt4ZJc.o
a.cc:(.text+0x6a): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/cczt4ZJc.o
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/cczt4ZJc.o
a.cc:(.text+0x10c): relocation truncated to fit: R_X86_64_PC32 against symbol `lowlink' defined in .bss section in /tmp/cczt4ZJc.o
a.cc:(.text+0x123): relocation truncated to fit: R_X86_64_PC32 against symbol `lowlink' defined in .bss section in /tmp/cczt4ZJc.o
a.cc:(.text+0x148): relocation truncated to fit: R_X86_64_PC32 against symbol `lowlink' defined in .bss section in /tmp/cczt4ZJc.o
a.cc:(.text+0x18a): relocation truncated to fit: R_X86_64_PC32 against symbol `ord' defined in .bss section in /tmp/cczt4ZJc.o
a.cc:(.text+0x1a1): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define vi vector<int>
#define pb push_back
#define INF 999999999
//#define INF (1LL<<59)


#define MAX_V 100000
vector<int> G[MAX_V];
bool usedV[MAX_V],usedE[MAX_V][MAX_V];
int ord[MAX_V],lowlink[MAX_V];
int k=0;


void dfs(int v){	//make ord and lowlink
	usedV[v] = true;
	ord[v]=lowlink[v]=k;
	k++;
	
	rep(i,G[v].size()){
		int to = G[v][i];
		if(!usedV[to]){
			usedE[v][to] = true;
			dfs(to);
			lowlink[v] = min(lowlink[v],lowlink[to]);
		}
		else if(!usedE[to][v]){	//use back edge
			lowlink[v] = min(lowlink[v],ord[to]);
		}
	}
}


int main(){
	int v,e;
	cin>>v>>e;
	vector<pii> edges;
	rep(i,e){
		int s,t;
		cin>>s>>t;
		if(s>t)swap(s,t);
		edges.pb(pii(s,t));
		G[s].pb(t);
		G[t].pb(s);
	}
	
	dfs(0);
	
	rep(i,e){
		if(ord[edges[i].first]<lowlink[edges[i].second])cout<<edges[i].first<<" "<<edges[i].second<<endl;
	}
}

Compiler output:
/tmp/cck3nIUP.o: in function `dfs(int)':
a.cc:(.text+0x1d): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/cck3nIUP.o
a.cc:(.text+0x32): relocation truncated to fit: R_X86_64_PC32 against symbol `lowlink' defined in .bss section in /tmp/cck3nIUP.o
a.cc:(.text+0x49): relocation truncated to fit: R_X86_64_PC32 against symbol `lowlink' defined in .bss section in /tmp/cck3nIUP.o
a.cc:(.text+0x61): relocation truncated to fit: R_X86_64_PC32 against symbol `ord' defined in .bss section in /tmp/cck3nIUP.o
a.cc:(.text+0x6a): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/cck3nIUP.o
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/cck3nIUP.o
a.cc:(.text+0x10c): relocation truncated to fit: R_X86_64_PC32 against symbol `lowlink' defined in .bss section in /tmp/cck3nIUP.o
a.cc:(.text+0x123): relocation truncated to fit: R_X86_64_PC32 against symbol `lowlink' defined in .bss section in /tmp/cck3nIUP.o
a.cc:(.text+0x148): relocation truncated to fit: R_X86_64_PC32 against symbol `lowlink' defined in .bss section in /tmp/cck3nIUP.o
a.cc:(.text+0x18a): relocation truncated to fit: R_X86_64_PC32 against symbol `ord' defined in .bss section in /tmp/cck3nIUP.o
a.cc:(.text+0x1a1): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<vector>
#include<set>
using namespace std;

typedef vector<vector<int> > Graph;
typedef pair<int, int> pii;
struct Node{
  int order, min_order;
};
class BrigeFind{
public:
  BrigeFind(Graph _g){
    g = _g;
    node.resize(g.size(), Node{-1, (int)1e9});
  }
  set<pii> find(){
    if(current_order == 0)dfs();
    return brige;
  }
private:
  void dfs(int current  = 0,
           int previous = -1){
    node[current].order   = current_order;
    node[current].min_order = current_order++;
    for (int i = 0; i < g[current].size(); i++) {
      int to = g[current][i];
      if(node[to].order == -1){
        dfs(to, current);
        node[current].min_order =
          min(node[current].min_order,
              node[to].min_order);
      }else{
        if(previous == to)continue;
        node[current].min_order =
          min(node[current].min_order,
              node[to].min_order);
      }
    }
    if(previous != -1 and node[current].min_order == node[previous].order){
      brige.insert(pii(current, to));
    }
  }
  int current_order = 0;
  set<pii> brige;
  Graph g;
  vector<Node> node;
};

int main(int argc, char *argv[]){
  int n, m;
  std::cin >> n >> m;
  Graph g(n, vector<int>());
  for (int i = 0; i < m; i++) {
    int to, from;
    std::cin >> to >> from;
    g[to].push_back(from);
    g[from].push_back(to);
  }
  BrigeFind bf(g);
  set<int> bridge = bf.find();
  for (auto i: bridge){
    std::cout << i.first << " " << i.second << std::endl;
  }
  return 0;
}

Compiler output:
a.cc: In member function 'void BrigeFind::dfs(int, int)':
a.cc:41:33: error: 'to' was not declared in this scope; did you mean 'tm'?
   41 |       brige.insert(pii(current, to));
      |                                 ^~
      |                                 tm
a.cc: In function 'int main(int, char**)':
a.cc:61:28: error: conversion from 'set<std::pair<int, int>>' to non-scalar type 'set<int>' requested
   61 |   set<int> bridge = bf.find();
      |                     ~~~~~~~^~
a.cc:63:20: error: request for member 'first' in 'i', which is of non-class type 'int'
   63 |     std::cout << i.first << " " << i.second << std::endl;
      |                    ^~~~~
a.cc:63:38: error: request for member 'second' in 'i', which is of non-class type 'int'
   63 |     std::cout << i.first << " " << i.second << std::endl;
      |                                      ^~~~~~
Language: C++

class in{struct It{int it;const bool rev;explicit constexpr It(int it_, bool rev=false):it(it_),rev(rev){}int operator*(){return it;}bool operator!=(It& r){return it!=r.it;}void operator++(){rev?--it:++it;}};const It i,n;public:explicit constexpr in(int n):i(0),n(n<0?0:n){}explicit constexpr in(int i,int n):i(i,n<i),n(n){}const It& begin(){return i;}const It& end(){return n;}};
  
#include <iostream>
#include <vector>
#include <string>
#include <functional>
using namespace std;
const int INF = 1e9;


int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<vector<int>> adj(n);
    for(int _ : in(m)) {
        int u, v;
        cin >> u >> v;
        adj[u].emplace_back(v);
        adj[v].emplace_back(u);
    }
    vector<pair<int, int>> bridge;
    vector<int> depth(n, INF), ub(n, INF);
    function<void(int, int, int)> dfs = [&](int v, int p, int d) {
        depth[v] = d;
        ub[v] = d;
        for(int nv : adj[v]) {
            if(nv == p) continue;
            if(depth[nv] != INF) {
                ub[v] = min(ub[v], depth[nv]);
                continue;
            }
            dfs(nv, v, d + 1);
            ub[v] = min(ub[v], ub[nv]);
            if(ub[nv] > depth[v])
                bridge.emplace_back(min(v, nv), max(v, nv));
        }
    };
    dfs(0, -1, 0);
    sort(bridge.begin(), bridge.end());
    for(auto p : bridge) cout << p.first << ' ' << p.second << '\n';
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:41:5: error: 'sort' was not declared in this scope; did you mean 'short'?
   41 |     sort(bridge.begin(), bridge.end());
      |     ^~~~
      |     short
Language: C++

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v), end(v)
#define debug(x) cerr<< #x <<": "<<x<<endl
#define debug2(x,y) cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<endl

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;
typedef deque<bool> db;
template<class T> using vv=vector<vector< T > >;

// cout vector
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size(); s << "\n";
  for (int i = 0; i < len; ++i) {
    s << v[i]; if (i < len - 1) s << "\t";
  }
  s << "\n"; return s;
}

int n, m; // number of nodes, edges

vvi edge;
vvi g;
vi prenum;
vi lowest;
vi parent;
int timer;

void lowlink_dfs(int u, int prev) {
  prenum[u] = timer;
  lowest[u] = timer;
  timer += 1;

  for (auto v : g[u]) {
    if (prenum[v] < 0) {
      parent[v] = u;
      lowlink_dfs(v, u);
      lowest[u] = min(lowest[u], lowest[v]);
    } else if (v != prev) {
      lowest[u] = min(lowest[u], prenum[v]);
    }
  }
}

void lowlink() {
  prenum.assign(n, -1);
  lowest.assign(n, 0);
  parent.assign(n, 0);
  timer = 0;
  lowlink_dfs(0, -1);
}

bool is_bridge(int x, int y) {
  return (return (prenum[x] < lowest[y] || prenum[y] < lowest[x]);
}

// call after lowlink()
set<pii> bridge() {
  set<pii> ret;
  rep (i, m) {
    int x = edge[i][0];
    int y = edge[i][1];
    if (is_bridge(x, y)) {
      if (x > y) {
        swap(x, y);
      }
      ret.insert(make_pair(x, y));
    }
  }
  return ret;
}


int main() {
  scanf("%d %d", &n, &m);
  edge.assign(m, vi(2, 0));
  g.resize(n);
  rep (i, m) {
    int s, t;
    scanf("%d %d", &s, &t);
    if (s > t) {
      swap(s, t);
    }
    edge[i][0] = s;
    edge[i][1] = t;
    g[s].push_back(t);
    g[t].push_back(s);
  }
  sort(all(edge));
  lowlink();
  auto ans = bridge();
  for (auto p : ans) {
    printf("%d %d\n", p.first, p.second);
  }

  return 0;
}

Compiler output:
a.cc: In function 'bool is_bridge(int, int)':
a.cc:79:11: error: expected primary-expression before 'return'
   79 |   return (return (prenum[x] < lowest[y] || prenum[y] < lowest[x]);
      |           ^~~~~~
a.cc:79:11: error: expected ')' before 'return'
   79 |   return (return (prenum[x] < lowest[y] || prenum[y] < lowest[x]);
      |          ~^~~~~~
      |           )
Language: C++

#include <bits/stdc++.h>
using namespace std;

int V, E;

void dfs(vector<vector<int>> &G, int p, int u, int d, vector<int> &depth, vector<int> &lowlink, vector<bool> &visited){
    visited[u] = true;
    depth[u] = lowlink[u] = d;
    
    for(auto v: G[u]) if(v != p){
        if(!visited[v]){
            dfs(G, u, v, d+1, depth, lowlink, visited);
            lowlink[u] = min(lowlink[u], lowlink[v]);
        }else{
            lowlink[u] = min(lowlink[u], depth[v]);
        }
    }
}

int main(){
    cin >> V >> E;
    
    vector<vector<int>> G(V);
    for(int i=0; i<E; i++){
        int s, t; cin >> s >> t;
        G[s].push_back(t);
        G[t].push_back(s);
    }
    for(int i=0; i<V; i++)
        sort(G[i].begin(), G[i].end());
    
    vector<int> depth(V, -1), lowlink(V, -1);
    vector<bool> visited(V, false);
    dfs(G, -1, 0, 0, depth, lowlink, visited);
    
    for(int s=0; s<V; s++){
        for(auto t: G[s]) if(s<t && (depth[s]<lowlink[t))){
            cout << s << " " << t << endl;
        }
    }
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:56: error: expected ']' before ')' token
   37 |         for(auto t: G[s]) if(s<t && (depth[s]<lowlink[t))){
      |                                                        ^
      |                                                        ]
a.cc:37:58: error: expected primary-expression before ')' token
   37 |         for(auto t: G[s]) if(s<t && (depth[s]<lowlink[t))){
      |                                                          ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>

using ll = long long;
using namespace std;

struct edge{
    int f, t;
};

const int V_MAX = (int)1e5;
const int E_MAX = (int)1e5;
vector<int> edges[V_MAX];
int ord[V_MAX];
int low[V_MAX];
bool used_v[V_MAX], used_e[V_MAX][V_MAX];
vector<edge> ans;

bool comp(edge e1, edge e2){
    if(e1.f == e2.f){
        return e1.t < e2.t;
    } else {
        return e1.f < e2.f;
    }
}

void dfs(int u, int k){
    low[u] = ord[u] = k;
    k += 1;
    used_v[u] = true;

    for(int i=0; i<edges[u].size(); i++){
        int next = edges[u][i];

        if(not used_v[next]){
            used_e[u][next] = used_e[next][u] = true;
            dfs(next, k);
            low[u] = min(low[u], low[next]);

            if(low[next] > ord[u]){
                edge e;
                e.f = min(u, next); e.t = max(u, next);
                ans.push_back(e);
            }
        } else if(not used_e[u][next]){
            low[u] = min(low[u], ord[next]);

        }
    }
    return ;
}

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int v, e; 
    cin >> v >> e;
    memset(used_v, false, sizeof(used_v));

    for(int i=0; i<e; i++) {
        int a, b;
        scanf("%d %d", &a, &b);
        edges[a].push_back(b);
        edges[b].push_back(a);
    }

    dfs(0, 1);

    sort(ans.begin(), ans.end(), comp);
    for(int i=0; i<ans.size(); i++){
        cout << ans[i].f << " " << ans[i].t << "\n";
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:63:5: error: 'memset' was not declared in this scope
   63 |     memset(used_v, false, sizeof(used_v));
      |     ^~~~~~
a.cc:7:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    6 | #include <set>
  +++ |+#include <cstring>
    7 |
Language: C++

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>

using namespace std;

struct edge{
    int f, t;
};

const int V_MAX = (int)1e5;
const int E_MAX = (int)1e5;
vector<int> edges[V_MAX];
int ord[V_MAX];
int low[V_MAX];
bool used_v[V_MAX], used_e[V_MAX][V_MAX];
vector<edge> ans;

bool comp(edge e1, edge e2){
    if(e1.f == e2.f){
        return e1.t < e2.t;
    } else {
        return e1.f < e2.f;
    }
}

void dfs(int u, int k){
    low[u] = ord[u] = k;
    k += 1;
    used_v[u] = true;

    for(int i=0; i<edges[u].size(); i++){
        int next = edges[u][i];

        if(not used_v[next]){
            used_e[u][next] = used_e[next][u] = true;
            dfs(next, k);
            low[u] = min(low[u], low[next]);

            if(low[next] > ord[u]){
                edge e;
                e.f = min(u, next); e.t = max(u, next);
                ans.push_back(e);
            }
        } else if(not used_e[u][next]){
            low[u] = min(low[u], ord[next]);

        }
    }
    return ;
}

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int v, e; 
    cin >> v >> e;

    for(int i=0; i<e; i++) {
        int a, b;
        scanf("%d %d", &a, &b);
        edges[a].push_back(b);
        edges[b].push_back(a);
    }

    dfs(0, 1);

    sort(ans.begin(), ans.end(), comp);
    for(int i=0; i<ans.size(); i++){
        cout << ans[i].f << " " << ans[i].t << "\n";
    }

    return 0;
}

Compiler output:
/tmp/ccQhaaD7.o: in function `dfs(int, int)':
a.cc:(.text+0x226): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccQhaaD7.o
/tmp/ccQhaaD7.o: in function `main':
a.cc:(.text+0x3e5): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccQhaaD7.o
a.cc:(.text+0x3f7): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccQhaaD7.o
a.cc:(.text+0x42f): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccQhaaD7.o
a.cc:(.text+0x471): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccQhaaD7.o
a.cc:(.text+0x4ac): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccQhaaD7.o
/tmp/ccQhaaD7.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x553): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccQhaaD7.o
a.cc:(.text+0x56c): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/ccQhaaD7.o
collect2: error: ld returned 1 exit status
Language: C++

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>

using namespace std;

struct edge{
    int f, t;
};

const int V_MAX = (int)1e5;
vector<int> edges[V_MAX];
int ord[V_MAX];
int low[V_MAX];
bool used_v[V_MAX], used_e[V_MAX][V_MAX];
vector<edge> ans;

bool comp(edge e1, edge e2){
    if(e1.f == e2.f){
        return e1.t < e2.t;
    } else {
        return e1.f < e2.f;
    }
}

void dfs(int u, int k){
    low[u] = ord[u] = k;
    k += 1;
    used_v[u] = true;

    for(int i=0; i<edges[u].size(); i++){
        int next = edges[u][i];

        if(not used_v[next]){
            used_e[u][next] = used_e[next][u] = true;
            dfs(next, k);
            low[u] = min(low[u], low[next]);

            if(low[next] > ord[u]){
                edge e;
                e.f = min(u, next); e.t = max(u, next);
                ans.push_back(e);
            }
        } else if(not used_e[u][next]){
            low[u] = min(low[u], ord[next]);

        }
    }
    return ;
}

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int v, e; 
    cin >> v >> e;

    for(int i=0; i<e; i++) {
        int a, b;
        scanf("%d %d", &a, &b);
        edges[a].push_back(b);
        edges[b].push_back(a);
    }

    dfs(0, 1);

    sort(ans.begin(), ans.end(), comp);
    for(int i=0; i<ans.size(); i++){
        cout << ans[i].f << " " << ans[i].t << "\n";
    }

    return 0;
}

Compiler output:
/tmp/cccJpAnb.o: in function `dfs(int, int)':
a.cc:(.text+0x226): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cccJpAnb.o
/tmp/cccJpAnb.o: in function `main':
a.cc:(.text+0x3e5): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cccJpAnb.o
a.cc:(.text+0x3f7): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cccJpAnb.o
a.cc:(.text+0x42f): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cccJpAnb.o
a.cc:(.text+0x471): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cccJpAnb.o
a.cc:(.text+0x4ac): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cccJpAnb.o
/tmp/cccJpAnb.o: in function `__static_initialization_and_destruction_0()':
a.cc:(.text+0x553): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cccJpAnb.o
a.cc:(.text+0x56c): relocation truncated to fit: R_X86_64_PC32 against symbol `ans' defined in .bss section in /tmp/cccJpAnb.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<vector>
using namespace std;

typedef vector<vector<int> > Graph;
typedef pair<int, int> pii;
struct Node{
  int ord, low;
};

class BridgeFind{
public:
  BridgeFind(Graph _g){
    g = _g;
    node.resize(g.size(), Node{-1, (int)1e9});
  }
  vector<pii> find(){
    if(v_ord == 0)dfs();
    return bridge;
  }
private:
  void dfs(int v  = 0,
           int previous = -1){
    node[v].ord = node[v].low = v_ord++;
    int to;
    for (int i = 0; i < g[v].size(); i++) {
      to = g[v][i];
      if(previous == to)continue;
      if(node[to].ord == -1) dfs(to, v);
      node[v].low = min(node[v].low, node[to].low);
    }
    if(node[v].low == node[v].ord and previous != -1)
      bridge.emplace_back(pii(previous, v));
  }
  int v_ord = 0;
  vector<pii> bridge;
  Graph g;
  vector<Node> node;
};

int main(int argc, char *argv[]){
  int n, m;
  std::cin >> n >> m;
  Graph g(n, vector<int>());
  for (int i = 0; i < m; i++) {
    int to, from;
    std::cin >> to >> from;
    g[to].push_back(from);
    g[from].push_back(to);
  }
  BridgeFind bf(g);
  vector<pii> bridge = bf.find();
  sort(bridge.begin(), bridge.end());
  for (auto i: bridge){
    std::cout << i.first << " " << i.second << std::endl;
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main(int, char**)':
a.cc:53:3: error: 'sort' was not declared in this scope; did you mean 'short'?
   53 |   sort(bridge.begin(), bridge.end());
      |   ^~~~
      |   short