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

#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

#define MAX 10000
#define INFTY (1<<29)

class DisjointSet {
public:
	vector<int> rank, p;

	DisjointSet() {}
	DisjointSet(int size) {
		rank.resize(size, 0);
		p.resize(size, 0);
		for (int i = 0; i < size; i++)makeSet(i);
	}

	void makeSet(int x) {
		p[x] = x;
		rank[x] = 0;
	}

	bool same(int x, int y) {
		return findSet(x) == findSet(y);
	}

	void unnite(int x, int y) {
		link(findSet(x), findSet(y));
	}

	void link(int x, int y) {
		if (rank[x] > rank[y]) {
			p[y] = x;
		}
		else {
			p[x] = y;
			if (rank[x] == rank[y]) {
				rank[y]++;
			}
		}
	}

	int findSet(int x) {
		if (x != p[x]) {
			p[x] = findSet(p[x]);
		}
		return p[x];
	}
};

class Edge {
public:
	int source, target, cost;
	Edge(int source = 0, int target = 0, int cost = 0);
	bool operator<(const Edge &e)const {
		return cost < e.cost;
	}
};

int kruskal(int N, vector<Edge> edges) {
	int totalCost = 0;
	sort(edges.begin(), edges.end());

	DisjointSet dset = DisjointSet(N + 1);

	for (int i = 0; i < N; i++)dset.makeSet(i);

	int source, target;
	for (int i = 0; i < edges.size(); i++) {
		Edge e = edges[i];
		if (!dset.same(e.source, e.target)) {
			totalCost += e.cost;
			dset.unnite(e.source, e.target);
		}
	}
	return totalCost;
}

int main() {
	int N, M, cost;
	int source, target;

	cin >> N >> M;

	vector<Edge> edges;
	for (int i = 0; i < M; i++) {
		cin >> source >> target >> cost;
		edges.push_back(Edge(source, target, cost));
	}

	cout << kruskal(N, edges) << endl;

	return 0;
}


Compiler output:
/usr/bin/ld: /tmp/ccbNaKd7.o: in function `main':
a.cc:(.text+0x1bb): undefined reference to `Edge::Edge(int, int, int)'
collect2: error: ld returned 1 exit status
Language: C++

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

int n, m, a, b, c;
vector<pair<int,int>> e[10101];

int prim(const vector<pair<int,int>> &e[]) {
	priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> q;
	bool used[n];
	memset(used,0,sizeof(used));
	q.push({0,0});
	int res = 0;
	while (!q.empty()) {
		int cost = q.top().first, v = q.top().second; q.pop();
		if (used[v]) continue;
		used[v] = true;
		res += cost;
		for (int i=0; i<e[v].size(); ++i) q.push(e[v][i]);
	}
}

signed main() {
	cin >> n >> m;
	for (int i = 0; i < m; ++i) {
		cin >> a >> b >> c;
		a--, b--;
		e[a].push_back({b,c}), e[b].push_back({a,c});
	}
	cout << prim(e) << endl;
}


Compiler output:
a.cc:7:39: error: declaration of 'e' as array of references
    7 | int prim(const vector<pair<int,int>> &e[]) {
      |                                       ^
a.cc: In function 'int prim(...)':
a.cc:20:1: warning: no return statement in function returning non-void [-Wreturn-type]
   20 | }
      | ^
Language: C++

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

int n, m, a, b, c;
vector<pair<int,int>> e[10101];

void dijkstra(int s, vector<pair<int,int>> g[], int *d) {
	priority_queue<pair<int,int>, vector<pair<int,int>>, greater<pair<int,int>>> que;
	fill(d, d+, inf);
	d[s] = 0;
	que.push(make_pair(0,s));
	
	while(!que.empty()) {
		pair<int,int> p = que.top(); que.pop();
		int v = p.second, dis = p.first;
		if (d[v]<dis) continue;
		for (int i = 0; i < g[v].size(); ++i) {
			int to = g[v][i].first, cost = g[v][i].second;
			if (d[to] > d[v] + cost) {
				d[to] = d[v] + cost;
				que.push(make_pair(d[to], to));
			}
		}
	}
}


int prim(vector<pair<int,int>> e[]) {
	priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> q;
	bool used[n];
	memset(used,0,sizeof(used));
	q.push({0,0});
	int res = 0;
	while (!q.empty()) {
		int cost = q.top().first, v = q.top().second; q.pop();
		if (used[v]) continue;
		used[v] = true;
		res += cost;
		for (int i=0; i<e[v].size(); ++i) q.push(e[v][i]);
	}
}

signed main() {
	cin >> n >> m;
	for (int i = 0; i < m; ++i) {
		cin >> a >> b >> c;
		a--, b--;
		e[a].push_back({b,c}), e[b].push_back({a,c});
	}
	cout << prim(e) << endl;
}


Compiler output:
a.cc: In function 'void dijkstra(int, std::vector<std::pair<int, int> >*, int*)':
a.cc:9:19: error: expected primary-expression before ',' token
    9 |         fill(d, d+, inf);
      |                   ^
a.cc:9:21: error: 'inf' was not declared in this scope; did you mean 'ynf'?
    9 |         fill(d, d+, inf);
      |                     ^~~
      |                     ynf
a.cc: In function 'int prim(std::vector<std::pair<int, int> >*)':
a.cc:41:1: warning: no return statement in function returning non-void [-Wreturn-type]
   41 | }
      | ^
Language: C++

/*
Implementation of Kruscal's algorithm

Nodes of the graph are 0-indexed
*/

#include<iostream>
#include<vector>

using namespace std;

////////// BEGIN //////////

struct Kruscal {

    struct UnionFind{
        vector<int> par;
        vector<int> rank;

        UnionFind(int size) {
            par = vector<int>(size);
            rank = vector<int>(size);

            for (int i = 0; i < size; ++i) {
                par[i] = i;
                rank[i] = 0;
            }
        }

        int find(int x) {
            if (par[x] == x) return x;
            return par[x] = find(par[x]);
        }

        void unite(int x, int y) {
            x = find(x);
            y = find(y);
            if (x == y) return;
            if (rank[x] > rank[y]) {
                par[y] = x;
            } else {
                par[x] = y;
                if (rank[x] == rank[y]) ++rank[x];
            }
        }

        bool same(int x, int y) {
            return find(x) == find(y);
        }
    };

    struct Edge {
        int from, to, cost;

        Edge(){}
        Edge(int from, int to, int cost):
        from(from), to(to), cost(cost) {}

        bool operator<(const Edge& e) const {
            return cost < e.cost;
        }
    };

    int n;
    vector<Edge> edges;

    Kruscal() {}
    Kruscal(int size):n(size) {}

    void add_edge(int from, int to, int cost) {
        edges.emplace_back(from, to, cost);
    }

    void input(int m) {
        for (int i = 0; i < m; ++i) {
            int from, to, cost;
            cin >> from >> to >> cost;
            add_edge(from, to, cost);
        }
    }

    long long mincost() {
        sort(edges.begin(), edges.end());
        UnionFind uf(n);
        long long cost = 0;
        for (auto& e : edges) {
            if (!uf.same(e.from, e.to)) {
                cost += e.cost;
                uf.unite(e.from, e.to);
            }
        }

        return cost;
    }
};

////////// END //////////

int main () {
    int n, m;
    cin >> n >> m;
    Kruscal kr(n);
    kr.input(m);
    cout << kr.mincost() << endl;
}


Compiler output:
a.cc: In member function 'long long int Kruscal::mincost()':
a.cc:83:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   83 |         sort(edges.begin(), edges.end());
      |         ^~~~
      |         short
Language: C++

#include<vector>
#include<iostream>
#include<algorithm>
using namespace std;
#define MAX_N 100000
#define MAX_E 100000
int N;
int par[MAX_N];
int r[MAX_N];
void init(int N)
{
	for (int i = 0; i < N; i++)
	{
		par[i] = i;
		r[i] = 0;
	}
}

int root(int x)
{
	if (par[x] == x)
	{
		return x;
	}
	else
	{
		return par[x] = root(par[x]);
	}
}


bool same(int x, int y)
{
	return root(x) == root(y);
}


void unite(int x, int y)
{
	x = root(x);
	y = root(y);
	if (x==y)
	{
		return;
	}
	
	
	if (r[x] < r[y])

	{
		par[x] = y;
	}
	else if(r[x]>r[y])
	{
		par[y] = x;
	}
	else if (r[x] == r[y])
	{
			par[y] = x;
			r[x]++;

	}
	
}

struct edge
{
	int u, v, cost;
};

bool comp(const edge& e1, const edge& e2)
{
	return e1.cost < e2.cost;
}


edge es[MAX_E];
int E;

int Kruskal()
{
	sort(es, es + E, comp);
	init(N);
	int res = 0;
	for (int i = 0; i < E; i++)
	{
		if (!same(es[i].u, es[i].v))
		{
			unite(es[i].u, es[i].v);
			res += es[i].cost;
		}
	}
	
	return res;
	
}

int main()
{
	cin >> V >> E;
	for (int i = 0; i < E; i++)
	{
		cin >> es[i].u >> es[i].v >> es[i].cost;
	}

	cout << Kruskal() << endl;
	return 0;
}







Compiler output:
a.cc: In function 'int main()':
a.cc:100:16: error: 'V' was not declared in this scope
  100 |         cin >> V >> E;
      |                ^
Language: C++

#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
#include <fstream>
using namespace std;
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)
#define CLR(mat) memset(mat, 0, sizeof(mat))
typedef long long ll;

//unionfind tree
struct UnionFind {
  vector<int> par;
  vector<int> rnk;
  int n;
  UnionFind(int n):n(n){
    par.resize(n);rnk.resize(n);
    for(int i=0; i<n; i++){par[i] = i;rnk[i] = 0;}
  }
  int find(int x){
      if(par[x] == x) return x;
      else return par[x] = find(par[x]);
  }
  void unite(int x, int y){
      x = find(x);y = find(y);
      if(x == y) return;
      if(rnk[x] < rnk[y])par[x] = y;
      else {
        par[y] = x;
        if(rnk[x] == rnk[y]) rnk[x]++;
      }
      return;
  }
  bool isSame(int x, int y){return find(x) == find(y);}
}

// クラスカル法(最小全域木求めるやつ)
struct edge{ll u, v ; ll cost; };
bool comp(edge& e1, edge& e2){
  return e1.cost < e2.cost;
}

int main(){
    int V,E;
    cin>>V>>E;
    vector<edge> es(E);
    FOR(i,0,E){
        cin>>es[i].u>>es[i].v>>es[i].cost;
    }
    sort(es.begin(), es.end(), comp);
    UnionFind U(V);
    ll res = 0;
    FOR(i,0,E){
        edge e = es[i];
        if(!U.isSame(e.u, e.v)){
            U.unite(e.u, e.v);
            res += e.cost;
        }
    }
    cout<<res<<endl;
    return 0;
}



Compiler output:
a.cc:49:2: error: expected ';' after struct definition
   49 | }
      |  ^
      |  ;
Language: C++

#include <iostream>
#include <vector>
using namespace std;
//
struct edge{int from;int to;int cost;};
struct kruskal{
	//
	bool comp(const edge &e1,const edge &e2){
		return e1.cost<e2.cost;
	}
	//
	int v,e;
	vector<int> par,ran;
	//
	kruskal(int n,int m){
		v=n;e=m;
		init(v);
	}
	//
	void init(int n){
		par.resize(n);
		ran.resize(n);
		for(int i=0;i<n;i++){
			par[i]=i;
			ran[i]=0;
		}
	}
	//
	int find(int x){
		if(par[x]==x){
			return x;
		}else{
			return par[x]=find(par[x]);
		}
	}
	//
	void unite(int x,int y){
		x=find(x);
		y=find(y);
		if(x==y){
			return ;
		}
		if(ran[x]<ran[y]){
			par[x]=y;
		}else{
			par[y]=x;
			if(ran[x]==ran[y]){
				ran[x]++;
			}
		}
	}
	//
	bool same(int x,int y){
		return find(x)==find(y);
	}
	//
	int cul(vector<int> es){
		sort(es.begin(),es.end(),comp);
		init(v);
		int res=0;
		for(int i=0;i<e;i++){
			edge &e=es[i];
			if(!same(e.from,e.to)){
				unite(e.from,e.to);
				res+=e.cost;
			}
		}
		return res;
	}
	//
};
//
int main(){
	int V,E;
	cin>>V>>E;
	vetcor<edge> G;
	for(int i=0;i<E;i++){
		int s,t,cost;
		G.push_back((edge){s,t,cost});
	}
	kruskal k(V,E);
	cout<<k.cul(G)<<endl;
	return 0;
}


Compiler output:
a.cc: In member function 'int kruskal::cul(std::vector<int>)':
a.cc:58:17: error: 'sort' was not declared in this scope; did you mean 'short'?
   58 |                 sort(es.begin(),es.end(),comp);
      |                 ^~~~
      |                 short
a.cc:62:37: error: invalid initialization of reference of type 'edge&' from expression of type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   62 |                         edge &e=es[i];
      |                                     ^
a.cc: In function 'int main()':
a.cc:76:9: error: 'vetcor' was not declared in this scope
   76 |         vetcor<edge> G;
      |         ^~~~~~
a.cc:76:20: error: expected primary-expression before '>' token
   76 |         vetcor<edge> G;
      |                    ^
a.cc:76:22: error: 'G' was not declared in this scope
   76 |         vetcor<edge> G;
      |                      ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
//
struct edge{int from;int to;int cost;};
struct kruskal{
	//
	bool comp(const edge &e1,const edge &e2){
		return e1.cost<e2.cost;
	}
	//
	int v,e;
	vector<int> par,ran;
	//
	kruskal(int n,int m){
		v=n;e=m;
		init(v);
	}
	//
	void init(int n){
		par.resize(n);
		ran.resize(n);
		for(int i=0;i<n;i++){
			par[i]=i;
			ran[i]=0;
		}
	}
	//
	int find(int x){
		if(par[x]==x){
			return x;
		}else{
			return par[x]=find(par[x]);
		}
	}
	//
	void unite(int x,int y){
		x=find(x);
		y=find(y);
		if(x==y){
			return ;
		}
		if(ran[x]<ran[y]){
			par[x]=y;
		}else{
			par[y]=x;
			if(ran[x]==ran[y]){
				ran[x]++;
			}
		}
	}
	//
	bool same(int x,int y){
		return find(x)==find(y);
	}
	//
	int cul(vector<int> es){
		sort(es.begin(),es.end(),comp);
		init(v);
		int res=0;
		for(int i=0;i<e;i++){
			edge &e=es[i];
			if(!same(e.from,e.to)){
				unite(e.from,e.to);
				res+=e.cost;
			}
		}
		return res;
	}
	//
};
//
int main(){
	int V,E;
	cin>>V>>E;
	vetcor<edge> G;
	for(int i=0;i<E;i++){
		int s,t,cost;
		G.push_back((edge){s,t,cost});
	}
	kruskal k(V,E);
	cout<<k.cul(G)<<endl;
	return 0;
}


Compiler output:
a.cc: In member function 'int kruskal::cul(std::vector<int>)':
a.cc:59:42: error: invalid use of non-static member function 'bool kruskal::comp(const edge&, const edge&)'
   59 |                 sort(es.begin(),es.end(),comp);
      |                                          ^~~~
a.cc:9:14: note: declared here
    9 |         bool comp(const edge &e1,const edge &e2){
      |              ^~~~
a.cc:63:37: error: invalid initialization of reference of type 'edge&' from expression of type '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'}
   63 |                         edge &e=es[i];
      |                                     ^
a.cc: In function 'int main()':
a.cc:77:9: error: 'vetcor' was not declared in this scope
   77 |         vetcor<edge> G;
      |         ^~~~~~
a.cc:77:20: error: expected primary-expression before '>' token
   77 |         vetcor<edge> G;
      |                    ^
a.cc:77:22: error: 'G' was not declared in this scope
   77 |         vetcor<edge> G;
      |                      ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
//
struct edge{int from;int to;int cost;};
struct kruskal{
	//
	bool comp(const edge &e1,const edge &e2){
		return e1.cost<e2.cost;
	}
	//
	int v,e;
	vector<int> par,ran;
	//
	kruskal(int n,int m){
		v=n;e=m;
		init(v);
	}
	//
	void init(int n){
		par.resize(n);
		ran.resize(n);
		for(int i=0;i<n;i++){
			par[i]=i;
			ran[i]=0;
		}
	}
	//
	int find(int x){
		if(par[x]==x){
			return x;
		}else{
			return par[x]=find(par[x]);
		}
	}
	//
	void unite(int x,int y){
		x=find(x);
		y=find(y);
		if(x==y){
			return ;
		}
		if(ran[x]<ran[y]){
			par[x]=y;
		}else{
			par[y]=x;
			if(ran[x]==ran[y]){
				ran[x]++;
			}
		}
	}
	//
	bool same(int x,int y){
		return find(x)==find(y);
	}
	//
	int cul(vector<edge> es){
		sort(es.begin(),es.end(),comp);
		init(v);
		int res=0;
		for(int i=0;i<e;i++){
			edge &e=es[i];
			if(!same(e.from,e.to)){
				unite(e.from,e.to);
				res+=e.cost;
			}
		}
		return res;
	}
	//
};
//
int main(){
	int V,E;
	cin>>V>>E;
	vetcor<edge> G;
	for(int i=0;i<E;i++){
		int s,t,cost;
		G.push_back((edge){s,t,cost});
	}
	kruskal k(V,E);
	cout<<k.cul(G)<<endl;
	return 0;
}


Compiler output:
a.cc: In member function 'int kruskal::cul(std::vector<edge>)':
a.cc:59:42: error: invalid use of non-static member function 'bool kruskal::comp(const edge&, const edge&)'
   59 |                 sort(es.begin(),es.end(),comp);
      |                                          ^~~~
a.cc:9:14: note: declared here
    9 |         bool comp(const edge &e1,const edge &e2){
      |              ^~~~
a.cc: In function 'int main()':
a.cc:77:9: error: 'vetcor' was not declared in this scope
   77 |         vetcor<edge> G;
      |         ^~~~~~
a.cc:77:20: error: expected primary-expression before '>' token
   77 |         vetcor<edge> G;
      |                    ^
a.cc:77:22: error: 'G' was not declared in this scope
   77 |         vetcor<edge> G;
      |                      ^
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
//
struct edge{int from;int to;int cost;};
struct kruskal{
	//
	bool comp(const edge &e1,const edge &e2){
		return e1.cost<e2.cost;
	}
	//
	int v,e;
	vector<int> par,ran;
	//
	kruskal(int n,int m){
		v=n;e=m;
		init(v);
	}
	//
	void init(int n){
		par.resize(n);
		ran.resize(n);
		for(int i=0;i<n;i++){
			par[i]=i;
			ran[i]=0;
		}
	}
	//
	int find(int x){
		if(par[x]==x){
			return x;
		}else{
			return par[x]=find(par[x]);
		}
	}
	//
	void unite(int x,int y){
		x=find(x);
		y=find(y);
		if(x==y){
			return ;
		}
		if(ran[x]<ran[y]){
			par[x]=y;
		}else{
			par[y]=x;
			if(ran[x]==ran[y]){
				ran[x]++;
			}
		}
	}
	//
	bool same(int x,int y){
		return find(x)==find(y);
	}
	//
	int cul(vector<edge> es){
		sort(es.begin(),es.end(),comp);
		init(v);
		int res=0;
		for(int i=0;i<e;i++){
			edge &e=es[i];
			if(!same(e.from,e.to)){
				unite(e.from,e.to);
				res+=e.cost;
			}
		}
		return res;
	}
	//
};
//
int main(){
	int V,E;
	cin>>V>>E;
	vector<edge> G;
	for(int i=0;i<E;i++){
		int s,t,cost;
		G.push_back((edge){s,t,cost});
	}
	kruskal k(V,E);
	cout<<k.cul(G)<<endl;
	return 0;
}


Compiler output:
a.cc: In member function 'int kruskal::cul(std::vector<edge>)':
a.cc:59:42: error: invalid use of non-static member function 'bool kruskal::comp(const edge&, const edge&)'
   59 |                 sort(es.begin(),es.end(),comp);
      |                                          ^~~~
a.cc:9:14: note: declared here
    9 |         bool comp(const edge &e1,const edge &e2){
      |              ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
//
struct edge{int from;int to;int cost;};
struct kruskal{
	//
	bool comp(const edge &e1,const edge &e2){
		return e1.cost<e2.cost;
	}
	//
	int v,e;
	vector<int> par,ran;
	//
	kruskal(int n,int m){
		v=n;e=m;
		init(v);
	}
	//
	void init(int n){
		par.resize(n);
		ran.resize(n);
		for(int i=0;i<n;i++){
			par[i]=i;
			ran[i]=0;
		}
	}
	//
	int find(int x){
		if(par[x]==x){
			return x;
		}else{
			return par[x]=find(par[x]);
		}
	}
	//
	void unite(int x,int y){
		x=find(x);
		y=find(y);
		if(x==y){
			return ;
		}
		if(ran[x]<ran[y]){
			par[x]=y;
		}else{
			par[y]=x;
			if(ran[x]==ran[y]){
				ran[x]++;
			}
		}
	}
	//
	bool same(int x,int y){
		return find(x)==find(y);
	}
	//
	int cul(vector<edge> es){
		sort(es.begin(),es.end(),comp());
		init(v);
		int res=0;
		for(int i=0;i<e;i++){
			edge &e=es[i];
			if(!same(e.from,e.to)){
				unite(e.from,e.to);
				res+=e.cost;
			}
		}
		return res;
	}
	//
};
//
int main(){
	int V,E;
	cin>>V>>E;
	vector<edge> G;
	for(int i=0;i<E;i++){
		int s,t,cost;
		G.push_back((edge){s,t,cost});
	}
	kruskal k(V,E);
	cout<<k.cul(G)<<endl;
	return 0;
}


Compiler output:
a.cc: In member function 'int kruskal::cul(std::vector<edge>)':
a.cc:59:46: error: no matching function for call to 'kruskal::comp()'
   59 |                 sort(es.begin(),es.end(),comp());
      |                                          ~~~~^~
a.cc:9:14: note: candidate: 'bool kruskal::comp(const edge&, const edge&)'
    9 |         bool comp(const edge &e1,const edge &e2){
      |              ^~~~
a.cc:9:14: note:   candidate expects 2 arguments, 0 provided
Language: C++

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
//
struct edge{
    int from;int to;int cost;
    bool comp(const edge &e1,const edge &e2){
		return e1.cost<e2.cost;
	}
};
struct kruskal{
	//
	//
	int v,e;
	vector<int> par,ran;
	//
	kruskal(int n,int m){
		v=n;e=m;
		init(v);
	}
	//
	void init(int n){
		par.resize(n);
		ran.resize(n);
		for(int i=0;i<n;i++){
			par[i]=i;
			ran[i]=0;
		}
	}
	//
	int find(int x){
		if(par[x]==x){
			return x;
		}else{
			return par[x]=find(par[x]);
		}
	}
	//
	void unite(int x,int y){
		x=find(x);
		y=find(y);
		if(x==y){
			return ;
		}
		if(ran[x]<ran[y]){
			par[x]=y;
		}else{
			par[y]=x;
			if(ran[x]==ran[y]){
				ran[x]++;
			}
		}
	}
	//
	bool same(int x,int y){
		return find(x)==find(y);
	}
	//
	int cul(vector<edge> es){
		sort(es.begin(),es.end(),comp);
		init(v);
		int res=0;
		for(int i=0;i<e;i++){
			edge &e=es[i];
			if(!same(e.from,e.to)){
				unite(e.from,e.to);
				res+=e.cost;
			}
		}
		return res;
	}
	//
};
//
int main(){
	int V,E;
	cin>>V>>E;
	vector<edge> G;
	for(int i=0;i<E;i++){
		int s,t,cost;
		G.push_back((edge){s,t,cost});
	}
	kruskal k(V,E);
	cout<<k.cul(G)<<endl;
	return 0;
}


Compiler output:
a.cc: In member function 'int kruskal::cul(std::vector<edge>)':
a.cc:61:42: error: 'comp' was not declared in this scope
   61 |                 sort(es.begin(),es.end(),comp);
      |                                          ^~~~
Language: C

#include<stdio.h>
int cmp[100010],r=0,f[10010]={0};
int Ta[110],To[1010],Co[1010],Nt[1010];
void sdfs(int e,int s,int k,int *ta,int *to,int *nt,int *id){
  int i;
  f[s]++;
  for(i=ta[s];i+1;i=nt[i]){
    if(i<e&&k<0&&f[to[i]]<0||i>=e&&k>=0&&!f[to[i]])sdfs(e,to[i],k,ta,to,nt,id);
  }
  k<0?(id[r++]=s):(cmp[s]=k);
}
void scc(int v,int e,int *a,int *b){
  int ta[10010],to[60010],nt[60010],id[10010],i,k;
  for(i=0;i<v;i++)f[i]=ta[i]=-1;
  for(i=0;i<e;i++){
    nt[i  ]=ta[to[i+e]=a[i]];
    nt[i+e]=ta[to[i  ]=b[i]];
    ta[a[i]]=i;
    ta[b[i]]=i+e;
  }
  for(i=k=0;i<v;i++){
    if(f[i]==-1)sdfs(e,i,-1,ta,to,nt,id);
  }
  for(i=r;i;i--){
    if(f[id[i-1]]==0)sdfs(e,id[i-1],id[i-1],ta,to,nt,id);
  }
}
int mca(int v,int e,int k,int *a,int *b,int *c){
  int i,j,t,r,s,p=0,mi[110],q[10010],bk[110]={0};
  for(i=0;i<v;i++)Ta[i]=mi[i]=-1;//??£??\??????????????????
  for(i=0;i<e;i++){
    Nt[i]=Ta[a[i]];
    Co[Ta[a[i]]=i]=c[i];
    bk[a[i]]=bk[To=b[i]]=1;
  }
  for(i=0;i<v;i++)p+=bk[i];
  for(i=0;i<e;i++){//?????????MIN???????±???????
    if(mi[To[i]]==-1||Co[mi[To[i]]]>Co[i])mi[To[i]]=i;
  }
  mi[q[t=0]=k]=-1;
  for(r=1;r-t;t++){
    for(j=Ta[q[t]];j+1;j=Nt[j]){
      if(mi[To[j]]==j){
	q[r++]=To[j];
	s+=Co[j];
      }
    }
  }
  if(r==p)return s;
  for(i=r=0;i<v;i++){
    bk[i]=0;
    for(j=Ta[i];j+1;j=Nt[j]){
      if(mi[b[r]=To[j]]==j)a[r++]=i;
    }
  }
  scc(v,r,a,b);//?????£?????????????§£??§???????????????????????????
  for(i=0;i<v;i++)bk[cmp[i]]++;
  for(i=r=s=0;i<v;i++){
    for(j=Ta[i];j+1;j=Nt[j]){
      if((a[r]=cmp[i])==(b[r]=cmp[To[j]])){
	if(j==mi[To[j]])s+=Co[j];
      }
      else c[r++]=bk[cmp[To[j]]]-1?Co[j]-Co[mi[To[j]]]:Co[j];
    }
  }
  return mca(v,r,k,a,b,c)+s;
}
	 
int main(){
  int n,m,k,i,a[10010],b[10010],c[10010];
  scanf("%d %d %d",&n,&m,&k);
  for(i=0;i<m;i++)scanf("%d %d %d",&a[i],&b[i],&c[i]);
  printf("%d\n",mca(n,m,k,a,b,c));
  return 0;
}

Compiler output:
main.c: In function 'mca':
main.c:34:19: error: assignment to expression with array type
   34 |     bk[a[i]]=bk[To=b[i]]=1;
      |                   ^
Language: C++

#include <bits/stdc++.h>

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)


using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

using ll=long long;

//Appropriately Changed
using edge=struct{int to,cost;};
using G=vector<vector<edge>>;

//Appropriately Changed
void add_edge(G &graph,int from,int to,int cost){ 
	graph[from].push_back({to,cost});
}

auto chuliu(const G &graph,int root){
	using W=int;
	const W inf=1<<28;
	
	const int n=graph.size();
	vector<int> cost(n,inf),pv(n,-1);
	rep(v,n) for(auto &e:graph[v]) if(chmin(cost[e.to],e.cost)) pv[e.to]=v;
	pv[root]=-1;

	vector<int> used(n,-1);
	set<int> comp;

	rep(v,n){
		if(used[v]!= -1 or pv[v]==-1) continue;

		used[v]=v;
		for(cur=pv[v]; pv[cur]!=-1 and used[cur] == -1; cur=pv[cur]) used[cur]=v;

		if(used[cur]==v){
			term=false,comp.insert(cur);	
			for(int w=pv[cur]; w != cur; w = pv[w]) comp.insert(cur);
			break;
		}
	}

	if(comp.empty()){
		G ret(n);
		rep(v,n) if(pv[v]!=-1) add_edge(ret,pv[v],v,cost[v]);
		return ret;
	}

	G ngraph(n);
	using E=tuple<int,int,int>;
	map<E,E> dict;
	const int led=*begin(comp);

	rep(v,n){
		for(auto &e:graph[v]){			
			int a=v,b=e.to,c=e.cost;
			if(comp.find(a)!=end(comp)) a=led;
			if(comp.find(b)!=end(comp)) c-=cost[b],b=led;
			if(a==b) continue;
			dict[E(a,b,c)]=E(v,e.to,e.cost);
			add_edge(ngraph,a,b,c);
		}
	}
	
	int nroot=root;
	if(comp.find(root)!=end(comp)) nroot=led;
	auto ntree=chuliu(ngraph,nroot);

	G ret(n);
	int unuse=-1;
	rep(v,n){
		for(auto &e:ntree[v]){
			int a,b,c;
			tie(a,b,c)=dict[E(v,e.to,e.cost)];
			if(comp.find(b)!=end(comp)) unuse=b;
			add_edge(ret,a,b,c);
		}
	}

	for(auto &v:comp){
		if(v==unuse) continue;
		add_edge(ret,pv[v],v,cost[v]); 
	}
	
	return ret;
}

int main(void){
	int v,e,r;
	cin >> v >> e >> r;
	G graph(v);
	rep(i,e){
		int a,b,w;
		cin >> a >> b >> w;
		add_edge(graph,a,b,w);
	}

	auto tree=chuliu(graph,r);
	int ans=0;
	rep(i,v) for(auto &e:tree[i]) ans+=e.cost;
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'auto chuliu(const G&, int)':
a.cc:45:21: error: 'cur' was not declared in this scope
   45 |                 for(cur=pv[v]; pv[cur]!=-1 and used[cur] == -1; cur=pv[cur]) used[cur]=v;
      |                     ^~~
a.cc:47:25: error: 'cur' was not declared in this scope
   47 |                 if(used[cur]==v){
      |                         ^~~
a.cc:48:25: error: 'term' was not declared in this scope; did you mean 'tm'?
   48 |                         term=false,comp.insert(cur);
      |                         ^~~~
      |                         tm
Language: C++

#include <queue>
#include <algorithm>
using namespace std;
#define MAXN 1000000
typedef long long ll;
typedef priority_queue<pair<ll, int>, vector<pair<ll, int> >, greater<pair<ll, int> > > pq;
struct UF // Union find data structure using path compression
{
	int rep[MAXN];
	UF()
	{
		for (int i = 0; i < MAXN; i++) rep[i] = i;
	}
	int findrep(int a) // Returns the representative in the UF 
	{
		if (rep[a] == a) return a;
		return rep[a] = findrep(rep[a]);
	}
	void merge(int a, int b) // Merges a into b
	{
		rep[findrep(a)] = findrep(b);
	}
	bool connected(int a, int b) // Is a connected to b
	{
		return findrep(a) == findrep(b); 
	}
};
UF stronglyconnected, weaklyconnected;
int v, e; 
pq* adj[MAXN]; // Incoming edges in a priority queue
int incoming[MAXN]; // The incoming edge to this node in the current graph
ll incomingDis[MAXN]; // The weight of the incoming edge to this node
pq* merge(pq* a, pq* b) // Merges a into b
{
	if (a->size() > b->size()) swap(a, b); // Ensure a is smaller than b
	while (!a->empty()) // Push alll elements of a into b
	{
		b->push(a->top());
		a->pop();
	}
	return b;
}
ll ans; // Sum of edge weights
int main()
{
	scanf("%d%d", &v, &e);
	int r;
	scanf("%d", &r); // Root
	for (int i = 0; i < v; i++) // Allocate priority queues
	{
		adj[i] = new pq();
	}
	for (int i = 0; i < e; i++)
	{
		int a, b;
		ll c;
		scanf("%d%d%lld", &a, &b, &c);
		adj[b]->emplace(c, a);
	}
	queue<int> q; // Nodes to be processed
	for (int i = 0; i < v; i++) 
	{
		if (i != r) q.push(i); // Process all nodes except the root
	}
	while (!q.empty())
	{
		int a = q.front();
		q.pop();
		incoming[a] = adj[a]->top().second;
		incomingDis[a] = adj[a]->top().first;
		incoming[a] = stronglyconnected.findrep(incoming[a]);
		adj[a]->pop();
		ans += incomingDis[a]; // Add the distance to the answer
		int b = incoming[a];
		if (weaklyconnected.connected(a, b)) // If connected, makes a cycle
		{
			ll mxincycle = incomingDis[a]; // Maximum edge weight : will not be in the arborescence 
			for (int i = b; i != a; i = stronglyconnected.findrep(incoming[i]))
			{
				mxincycle = max(mxincycle, incomingDis[i]);
				// Merge nodes i and a
				stronglyconnected.merge(i, a);
				adj[a] = merge(adj[a], adj[i]); 
			}
			ans -= mxincycle;
			q.push(a); // Process a again as a supernode
		}
		else
		{
			// Weakly merge them
			weaklyconnected.merge(a, b);
		}
	}
	printf("%lld\n", ans);
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:9: error: 'scanf' was not declared in this scope
   46 |         scanf("%d%d", &v, &e);
      |         ^~~~~
a.cc:94:9: error: 'printf' was not declared in this scope
   94 |         printf("%lld\n", ans);
      |         ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <algorithm>
  +++ |+#include <cstdio>
    3 | using namespace std;
Language: C

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

#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define inf (1<<29)
#define MAX_V 100010

using namespace std;

typedef pair<int,int> ii;
typedef vector<ii>   vii;
typedef vector<int>   vi;
const int DFS_WHITE = -1; // unvisited
const int DFS_BLACK =  1; // visited

int V,E;
int dfsNumberCounter,rootChildren,dfsRoot;
vi dfs_num,dfs_low,dfs_parent,articulation_vertex;
vii AdjList[MAX_V];// ii(neighbor,weight)


void articulationPointAndBridge(int u)
{
  dfs_low[u] = dfs_num[u] = dfsNumberCounter++;
  for(int j=0;j<(int)AdjList[u].size();j++)
    {
      ii v = AdjList[u][j];
      if(dfs_num[v.first] == DFS_WHITE)
	{
	  dfs_parent[v.first] = u;
	  if(u == dfsRoot)rootChildren++;

	  articulationPointAndBridge(v.first);

	  if(dfs_low[v.first] >= dfs_num[u])
	    articulation_vertex[u] = true;
	  //if(dfs_low[v.first] >  dfs_num[u])
	    //printf("Edge (%d,%d) is a bridge\n",u,v.first);
	  dfs_low[u] = min(dfs_low[u],dfs_low[v.first]);

	}
      else if(v.first != dfs_parent[u])
	dfs_low[u] = min(dfs_low[u],dfs_num[v.first]);
    }
}

void compute()
{
  dfsNumberCounter = 0; dfs_num.assign(V,DFS_WHITE); dfs_low.assign(V,0);
  dfs_parent.assign(V,0); articulation_vertex.assign(V,0);
  //puts("Bridges:");
  for(int i = 0; i < V; i++)
    if(dfs_num[i] == DFS_WHITE)
      {
	dfsRoot = i; rootChildren = 0;
	articulationPointAndBridge(i);
	articulation_vertex[dfsRoot] = (rootChildren > 1);// special case
      }
  //puts("Articulation Points");
  for(int i = 0; i < V; i++)
    if(articulation_vertex[i])
      printf("%d\n",i);
      //printf("Vertex %d\n",i);
}

int main()
{
  scanf("%d%d",&V,&E);
  rep(i,V)AdjList[i].clear();
  rep(i,E)
    {
      int s,t;
      scanf("%d%d",&s,&t);
      AdjList[s].push_back(ii(t,1));
      AdjList[t].push_back(ii(s,1));
    }

  compute();

  return 0;
}

Compiler output:
main.c:1:9: fatal error: iostream: No such file or directory
    1 | #include<iostream>
      |         ^~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
using namespace std;
static const int N=100000;
static const int infty=(1<<21);
static const int white=0;
static const int black=2;
int n,v[N],l[N],p[N];
vector<int> s[N];
int color[N],time=1;
void dfs(int t,int f)
{
	l[t]=v[t]=time++;
	color[t]=black;
	int temp;
	for(int i=0;i<s[t].size();i++)
	{
		temp=s[t][i];
		if(color[temp]!=black)
		{
		p[temp]=t; 
		dfs(temp,t);
		l[temp]=min(l[p[temp]],l[temp]);
	    }
	    else if(temp!=f)
	    {
	    	l[temp]=min(l[temp],l[f]);
		}
   }
}
void asort()
{
	for(int i=0;i<n;i++)
	{
		v[i]=0;l[i]=-1;p[i]=-1;color[i]=white;
	}
	dfs(0,-1);
	set<int> ap;
	int np=0;
	for(int i=1;i<n;i++)
	{
		int u=p[i];
		if(u==0)np++;
		else if(v[u]<=l[i])ap.insert(u);
		
	}
	if(np>1)ap.insert(0);
	for(set<int>::iterator it=ap.begin();it!=ap.end();it++)
	cout<<*it<<endl;
}
int main()
{
	int m,k,d;
	cin>>n>>m;
	for(int i=0;i<m;i++)
	{
		cin>>k>>d;
		s[k].push_back(d);
		s[d].push_back(k);
	}
	asort();
	return 0;
}


Compiler output:
a.cc:12:14: error: 'int time' redeclared as different kind of entity
   12 | int color[N],time=1;
      |              ^~~~
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, int)':
a.cc:15:19: warning: ISO C++ forbids incrementing a pointer of type 'time_t (*)(time_t*) noexcept' {aka 'long int (*)(long int*) noexcept'} [-Wpointer-arith]
   15 |         l[t]=v[t]=time++;
      |                   ^~~~
a.cc:15:23: error: lvalue required as increment operand
   15 |         l[t]=v[t]=time++;
      |                       ^~
Language: C++


#include<iostream>
#include<algorithm>
using namespace std;
 
int main() {
    int V, E;
    cin >> V >> E;
    Graph g(V);
    for(int i = 0; i < E; ++i) {
        int s, t;
        cin >> s >> t;
        g.add(s, t, 1);
        g.add(t, s, 1);
    }
    auto cv = cut_vertex(g);
    sort(cv.begin(), cv.end());
    unique(cv.begin(), cv.end());
    for(const auto& v: cv) {
        cout << v << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:5: error: 'Graph' was not declared in this scope; did you mean 'isgraph'?
    9 |     Graph g(V);
      |     ^~~~~
      |     isgraph
a.cc:13:9: error: 'g' was not declared in this scope
   13 |         g.add(s, t, 1);
      |         ^
a.cc:16:26: error: 'g' was not declared in this scope
   16 |     auto cv = cut_vertex(g);
      |                          ^
a.cc:16:15: error: 'cut_vertex' was not declared in this scope
   16 |     auto cv = cut_vertex(g);
      |               ^~~~~~~~~~
Language: C++

#include<algorithm>
#include<iostream>
#include<vector>

using namespace std;

struct edge {
	int to;
	edge(const int& _to) :to(_to) {}
	edge(const edge& e) :to(e.to) {}
};

constexpr int MAX_N = 100000;
vector<int> pre_order(MAX_N, -1);//pre_order[i]:=??±???????????¢?´¢??§???????????????i????????£?????¨??????timer
vector<int> post_order(MAX_N, -1);//post_order[i]:=??±???????????¢?´¢??§???????????????i????????£?????¨??????timer
vector<int> parent(MAX_N, -1);//parent[i]:=??±???????????¢?´¢??§??¨????§????????????¨???????????????i??????
vector<bool> visited(MAX_N, false);//??±???????????¢?´¢???????????§????¨?????????????????????°???????´?????????????

vector<vector<edge>> G;

void add_edge(int s, int t) {
	G[s].emplace_back(edge(t));
	G[t].emplace_back(edge(s));
}

void dfs(const vector<vector<edge>>& G, int u = 0, int prev_u = -1, int timer = 1) {
	pre_order[u] = timer;
	post_order[u] = timer;
	++timer;

	//u????¨????????????¨????????¢
	visited[u] = true;
	

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

		int v = G[u][i].to;

		//u?????£??\??????????????????v == G[u][i].to ???????¨?
		if (!visited[v]) {

			//v?????????u??§?¢??????????
			parent[v] = u;

			//v??\????????±???????????¢?´¢????????????
			dfs(G, v, u, timer);

			//u???post_order?????´??°??????
			post_order[u] = min(post_order[u], post_order[v]);
		}

		//u?????£??\??????????????????v?????¢?¨?????????¢?´¢??§??´????????§????????£??????????????¨?????????
		else if (v != prev_u) {
			post_order[u] = min(post_order[u], pre_order[v]);
		}
	}
}

vector<int> articulation_points(const vector<vector<edge>>& G, int G_sz, int root = 0) {
	dfs(G,root);
	vector<int> ans;
	int G_sz = G.size();
	for (int i = 0; i < G_sz; ++i) {

		//??±???????????¢?´¢??§?§????????????¨??????????????????????????????2?????\????????????????????\????¢????
		if (i == root) {
			int root_child = 0;
			for (int j = 0; j < G_sz; ++j) {
				if (parent[j] == root)++root_child;
				if (root_child == 2) {
					ans.emplace_back(root);
					break;
				}
			}
		}

		else if (pre_order[parent[i]] <= post_order[i]) {
			ans.emplace_back(parent[i]);
		}
	}
	return ans;
}

int main()
{
	int N, E;
	cin >> N >> E;
	int s, t;

	for (int i = 0; i < E; ++i) {
		cin >> s >> t;
		add_edge(s, t);
	}
	vector<int>ans = articulation_points(G, N);
	for (int i = 0; i < ans.size(); ++i) {
		cout << ans[i] << endl;
	}
}

Compiler output:
a.cc: In function 'std::vector<int> articulation_points(const std::vector<std::vector<edge> >&, int, int)':
a.cc:62:13: error: declaration of 'int G_sz' shadows a parameter
   62 |         int G_sz = G.size();
      |             ^~~~
a.cc:59:68: note: 'int G_sz' previously declared here
   59 | vector<int> articulation_points(const vector<vector<edge>>& G, int G_sz, int root = 0) {
      |                                                                ~~~~^~~~
Language: C++

#include<algorithm>
#include<iostream>
#include<vector>

using namespace std;

constexpr int MAX_N = 100000;
vector<int> pre_order(MAX_N, -1);//pre_order[i]:=??±???????????¢?´¢??§???????????????i????????£?????¨??????timer
vector<int> post_order(MAX_N, -1);//post_order[i]:=??±???????????¢?´¢??§???????????????i????????£?????¨??????timer
vector<int> parent(MAX_N, -1);//parent[i]:=??±???????????¢?´¢??§??¨????§????????????¨???????????????i??????
vector<bool> visited(MAX_N, false);//??±???????????¢?´¢???????????§????¨?????????????????????°???????´?????????????

vector<vector<int>> G(MAX_N);

void add_edge(int s, int t) {
	G[s].emplace_back(t);
	G[t].emplace_back(s);
}

void dfs(const vector<vector<int>>& G, int u = 0, int prev_u = -1, int timer = 1) {
	pre_order[u] = timer;
	post_order[u] = timer;
	++timer;

	//u????¨????????????¨????????¢
	visited[u] = true;
	

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

		int v = G[u][i];

		//u?????£??\??????????????????v == G[u][i] ???????¨?
		if (!visited[v]) {

			//v?????????u??§?¢??????????
			parent[v] = u;

			//v??\????????±???????????¢?´¢????????????
			dfs(G, v, u, timer);

			//u???post_order?????´??°??????
			post_order[u] = min(post_order[u], post_order[v]);
		}

		//u?????£??\??????????????????v?????¢?¨?????????¢?´¢??§??´????????§????????£??????????????¨?????????
		else if (v != prev_u) {
			post_order[u] = min(post_order[u], pre_order[v]);
		}
	}
}

vector<int> articulation_points(const vector<vector<int>>& G, int G_sz, int root = 0) {
	dfs(G,root);
	vector<int> ans;
	vector<bool> used(G_sz, false);
	int root_child = 0;
	for (int j = 0; j < G_sz; ++j) {
	        if (parent[j] == root)++root_child;
	        if (root_child == 2) {
			ans.emplace_back(root);
			break;
		}
	}
	for (int i = 1; i < G_sz; ++i) {
		else if (parent[i] != root
				&&pre_order[parent[i]] <= post_order[i]
				&& !used[parent[i]]) {

			ans.emplace_back(parent[i]);
			used[parent[i]] = true;
		}
	}
	sort(ans.begin(), ans.end());
	return ans;
}

int main()
{
	int N, E;
	cin >> N >> E;
	int s, t;

	for (int i = 0; i < E; ++i) {
		cin >> s >> t;
		add_edge(s, t);
	}
	vector<int>ans = articulation_points(G, N);
	for (int i = 0; i < ans.size(); ++i) {
		cout << ans[i] << endl;
	}
}

Compiler output:
a.cc: In function 'std::vector<int> articulation_points(const std::vector<std::vector<int> >&, int, int)':
a.cc:66:17: error: 'else' without a previous 'if'
   66 |                 else if (parent[i] != root
      |                 ^~~~
Language: C++

#include<algorithm>
#include<iostream>
#include<vector>

using namespace std;

constexpr int MAX_N = 100000;
vector<int> pre_order(MAX_N, -1);
vector<int> post_order(MAX_N, -1);
vector<int> parent(MAX_N, -1);
vector<bool> visited(MAX_N, false);

vector<vector<int>> G(MAX_N);

vector<int> ans;

void add_edge(int s, int t) {
	G[s].emplace_back(t);
	G[t].emplace_back(s);
}

void dfs(const vector<vector<int>>& G, int u = 0, int prev_u = -1, int timer = 1) {
	pre_order[u] = timer;
	post_order[u] = timer;
	++timer;

	visited[u] = true;

	for (auto&& v:G[u]) {
		if (!visited[v]) {
			parent[v] = u;
			dfs(G, v, u, timer);
			post_order[u] = min(post_order[u], post_order[v]);
		}
		else if (v != prev_u) {
			post_order[u] = min(post_order[u], pre_order[v]);
		}
	}
}

void articulation_points(const vector<vector<int>>& G, int G_sz, int root = 0) {
	dfs(G, root);
	vector<bool> used(G_sz, false);
	int root_child = 0;
	for (int j = 0; j < G_sz; ++j) {
		if (parent[j] == root)++root_child;
		if (root_child == 2) {
			ans.emplace_back(root);used[root]=true;
			break;
		}
	}
	for (int i = 1; i < G_sz; ++i) {
		if (parent[i] != root
			&&pre_order[parent[i]] <= post_order[i]
			&& !used[parent[i]]) {
		        ans.emplace_back(parent[i]);
			used[parent[i]] = true;
		}
	}
	sort(ans.begin(), ans.end());
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int N, E;cin >> N >> E;
	int s, t;
	for (int i = 0; i < E; ++i) {
		cin >> s >> t;
		add_edge(s, t);
	}
        articulation_points(G, N)
	for (auto&& v : ans) {
		cout << v << endl;
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:73:34: error: expected ';' before 'for'
   73 |         articulation_points(G, N)
      |                                  ^
      |                                  ;
   74 |         for (auto&& v : ans) {
      |         ~~~
Language: C++

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_3_A&lang=jp
// hos?????????????????????????????????
// lowlink????¨??????????????????§??????
#include <bits/stdc++.h>
using namespace std;
int ord[100000], low[100000], iscome[100000];
vector<int> edge[100000];
int judge[100000][100000];
vector<int> stock;
int v, e, s, t, k;
void dfs(int u) {
    ord[u] = k; k++;
    low[u] = ord[u];
    iscome[u] = 1;
    for (int i=0; i<edge[u].size(); i++) {
        int a = edge[u][i];
        if (iscome[a] != 1) {
            judge[u][a] = 1; judge[a][u] = 1;
            dfs(a);
            low[u] = min(low[u], low[a]);
        } else if (judge[u][a] != 1) {
            low[u] = min(low[u], ord[a]);
        }
    }
}
int main() {
    scanf("%d%d",&v,&e);
    for (int i=0; i<e; i++) {
        scanf("%d%d",&s,&t);
        edge[s].push_back(t); edge[t].push_back(s);
    }
    if (v == 1) {
    } else {
        k = 0;
        dfs(0);
        // DFS??¨??¨??????????¬???°????????\???????????????
        int sum = 0;
        for (int j=0; j<edge[0].size(); j++) {
            if (judge[0][edge[0][j]] == 1) sum++;
        }
        if (sum > 1) puts("0");
        for (int i=1; i<v; i++) {
            bool flag = false;
            for (int j=0; j<edge[i].size(); j++) {
                if (ord[i] <= low[edge[i][j]]) flag = true;
            }
            if (flag) printf("%d\n",i);
        }
    }
}

Compiler output:
/tmp/ccpwOy5f.o: in function `dfs(int)':
a.cc:(.text+0xe): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccpwOy5f.o
a.cc:(.text+0x2c): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccpwOy5f.o
a.cc:(.text+0x35): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccpwOy5f.o
/tmp/ccpwOy5f.o: in function `main':
a.cc:(.text+0x266): relocation truncated to fit: R_X86_64_PC32 against symbol `e' defined in .bss section in /tmp/ccpwOy5f.o
a.cc:(.text+0x270): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccpwOy5f.o
a.cc:(.text+0x29a): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccpwOy5f.o
a.cc:(.text+0x2a4): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccpwOy5f.o
a.cc:(.text+0x2c1): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccpwOy5f.o
a.cc:(.text+0x2e2): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccpwOy5f.o
a.cc:(.text+0x2f3): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccpwOy5f.o
a.cc:(.text+0x314): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

// http://judgef.u-aizu.ac.jp/onlinejudgef/description.jsp?id=GRL_3_A&lang=jp
// hos?????????????????????????????????
// lowflink????¨??????????????????§??????
#include <bits/stdc++.h>
using namespace std;
int ordf[100000], lowf[100000], iscomef[100000];
vector<int> edge[100000];
int judgef[100000][100000];
vector<int> stock;
int v, e, s, t, k;
void dfs(int u) {
    ordf[u] = k; k++;
    lowf[u] = ordf[u];
    iscomef[u] = 1;
    for (int i=0; i<edge[u].size(); i++) {
        int a = edge[u][i];
        if (iscomef[a] != 1) {
            judgef[u][a] = 1; judgef[a][u] = 1;
            dfs(a);
            lowf[u] = min(lowf[u], lowf[a]);
        } else if (judgef[u][a] != 1) {
            lowf[u] = min(lowf[u], ordf[a]);
        }
    }
}
int main() {
    scanf("%d%d",&v,&e);
    for (int i=0; i<e; i++) {
        scanf("%d%d",&s,&t);
        edge[s].push_back(t); edge[t].push_back(s);
    }
    if (v == 1) {
    } else {
        k = 0;
        dfs(0);
        // DFS??¨??¨??????????¬???°????????\???????????????
        int sum = 0;
        for (int j=0; j<edge[0].size(); j++) {
            if (judgef[0][edge[0][j]] == 1) sum++;
        }
        if (sum > 1) puts("0");
        for (int i=1; i<v; i++) {
            bool flag = false;
            for (int j=0; j<edge[i].size(); j++) {
                if (ordf[i] <= lowf[edge[i][j]]) flag = true;
            }
            if (flag) printf("%d\n",i);
        }
    }
}

Compiler output:
/tmp/ccyAr5lZ.o: in function `dfs(int)':
a.cc:(.text+0xe): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccyAr5lZ.o
a.cc:(.text+0x2c): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccyAr5lZ.o
a.cc:(.text+0x35): relocation truncated to fit: R_X86_64_PC32 against symbol `k' defined in .bss section in /tmp/ccyAr5lZ.o
/tmp/ccyAr5lZ.o: in function `main':
a.cc:(.text+0x266): relocation truncated to fit: R_X86_64_PC32 against symbol `e' defined in .bss section in /tmp/ccyAr5lZ.o
a.cc:(.text+0x270): relocation truncated to fit: R_X86_64_PC32 against symbol `v' defined in .bss section in /tmp/ccyAr5lZ.o
a.cc:(.text+0x29a): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccyAr5lZ.o
a.cc:(.text+0x2a4): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccyAr5lZ.o
a.cc:(.text+0x2c1): relocation truncated to fit: R_X86_64_PC32 against symbol `s' defined in .bss section in /tmp/ccyAr5lZ.o
a.cc:(.text+0x2e2): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccyAr5lZ.o
a.cc:(.text+0x2f3): relocation truncated to fit: R_X86_64_PC32 against symbol `t' defined in .bss section in /tmp/ccyAr5lZ.o
a.cc:(.text+0x314): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status