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

#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tii tuple<int,int,int>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define edge(v,a,b) v[a].pb(b);v[b].pb(a);
#define MAX_V 400010
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define ALL(c) (c).begin(),(c).end()
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}

#define INF 1e9+7
#define LLINF 1e18+7
#define N 500000
ll MOD=1e9+7;

vector<vec>G(N);
int dfs(int x,int p){
  int g=0;
  for(auto e:G[x]){
    if(e!=p){
    g^=(dfs(e,x)+1);}
  }
}
main(){
    int n=in();
  rep(i,n-1){
  int a=in(),b=in();
  G[a].pb(b);
  G[b].pb(a);}
  cout<<(dfs(1,0)?“Alice”:“Bob”);
}



Compiler output:
a.cc:66:19: error: extended character “ is not valid in an identifier
   66 |   cout<<(dfs(1,0)?“Alice”:“Bob”);
      |                   ^
a.cc:66:19: error: extended character ” is not valid in an identifier
a.cc:66:27: error: extended character “ is not valid in an identifier
   66 |   cout<<(dfs(1,0)?“Alice”:“Bob”);
      |                           ^
a.cc:66:27: error: extended character ” is not valid in an identifier
a.cc: In function 'int dfs(int, int)':
a.cc:59:1: warning: no return statement in function returning non-void [-Wreturn-type]
   59 | }
      | ^
a.cc: At global scope:
a.cc:60:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   60 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:66:19: error: '\U0000201cAlice\U0000201d' was not declared in this scope
   66 |   cout<<(dfs(1,0)?“Alice”:“Bob”);
      |                   ^~~~~~~
a.cc:66:27: error: '\U0000201cBob\U0000201d' was not declared in this scope
   66 |   cout<<(dfs(1,0)?“Alice”:“Bob”);
      |                           ^~~~~
Language: C++

#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tii tuple<int,int,int>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define edge(v,a,b) v[a].pb(b);v[b].pb(a);
#define MAX_V 400010
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define ALL(c) (c).begin(),(c).end()
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}

#define INF 1e9+7
#define LLINF 1e18+7
#define N 500000
ll MOD=1e9+7;

vector<vec>G(N);
int dfs(int x,int p){
  int g=0;
  for(auto e:G[x]){
    if(e!=p){
    g^=(dfs(e,x)+1);}
  }
}
main(){
    int n=in();
  rep(i,n-1){
  int a=in(),b=in();
  G[a].pb(b);
  G[b].pb(a);}
  cout<<(dfs(1)?“Alice”:“Bob”);
}



Compiler output:
a.cc:66:17: error: extended character “ is not valid in an identifier
   66 |   cout<<(dfs(1)?“Alice”:“Bob”);
      |                 ^
a.cc:66:17: error: extended character ” is not valid in an identifier
a.cc:66:25: error: extended character “ is not valid in an identifier
   66 |   cout<<(dfs(1)?“Alice”:“Bob”);
      |                         ^
a.cc:66:25: error: extended character ” is not valid in an identifier
a.cc: In function 'int dfs(int, int)':
a.cc:59:1: warning: no return statement in function returning non-void [-Wreturn-type]
   59 | }
      | ^
a.cc: At global scope:
a.cc:60:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   60 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:66:13: error: too few arguments to function 'int dfs(int, int)'
   66 |   cout<<(dfs(1)?“Alice”:“Bob”);
      |          ~~~^~~
a.cc:53:5: note: declared here
   53 | int dfs(int x,int p){
      |     ^~~
a.cc:66:17: error: '\U0000201cAlice\U0000201d' was not declared in this scope
   66 |   cout<<(dfs(1)?“Alice”:“Bob”);
      |                 ^~~~~~~
a.cc:66:25: error: '\U0000201cBob\U0000201d' was not declared in this scope
   66 |   cout<<(dfs(1)?“Alice”:“Bob”);
      |                         ^~~~~
Language: C++

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

vector<int> edge[1000010];
int n,poi[1000010],u,v;

void dfs(int u,int fa)
{
    poi[u]=0;
    for(auto v : edge[u])
    {
        if(v==fa) continue;
        dfs(v,u);
        sg[u]^=sg[v]+1;
    }
}

int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n-1;++i)
    {
        scanf("%d%d",&u,&v);
        edge[u].push_back(v);
        edge[v].push_back(u);
    }
    dfs(1,0);
    puts(poi[1]?"Alice":"Bob");
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:14:9: error: 'sg' was not declared in this scope
   14 |         sg[u]^=sg[v]+1;
      |         ^~
Language: C++

#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;

inline int getint()
{
	static char c;
	while ((c = getchar()) < '0' || c > '9');

	int res = c - '0';
	while ((c = getchar()) >= '0' && c <= '9')
		res = res * 10 + c - '0';
	return res;
}

const int MaxN = 100000;

int n;
vector<int> adj[MaxN + 1];

int dfs(int u, int fa)
{
	int w = 0;
	for (int v : adj[u])
		if (v != fa)
			w ^= dfs(v, u) + 1;
	return w;
}

int main()
{
	cin >> n;
	for (int i = 1; i < n; ++i)
	{
		int u = getint(), v = getint();
		adj[u].push_back(v);
		adj[v].push_back(u);
	}

	cout << (dfs(1, 0) ? "Alice" : "Bob");
	cout << endl;

	return 0;
}

Compiler output:
a.cc:22:1: error: 'vector' does not name a type
   22 | vector<int> adj[MaxN + 1];
      | ^~~~~~
a.cc: In function 'int dfs(int, int)':
a.cc:27:22: error: 'adj' was not declared in this scope
   27 |         for (int v : adj[u])
      |                      ^~~
a.cc: In function 'int main()':
a.cc:39:17: error: 'adj' was not declared in this scope
   39 |                 adj[u].push_back(v);
      |                 ^~~
Language: C++

//作者：中国江苏省南京市李硕睿
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
using namespace std;
typedef long long ll;
const int =1e5+7;
vector<int> adj[N];
int mark[N];
int nim[N];
void dfs(int v,int p){
	for (auto u:adj[v])
		if (u!=p){
			dfs(u,v);
			nim[v]^=nim[u]+1;
		}
}
int main(){
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	for (int i=1;i<n;i++){
		int u,v;
		cin>>u>>v;
		u--; 
		v--;
		adj[v].push_back(u);
		adj[u].push_back(v);
	}
	dfs(0,-1);
	cout<<(nim[0] ? "Alice" : "Bob")<<"\n";
	return 0;
}

Compiler output:
a.cc:59:11: error: expected unqualified-id before '=' token
   59 | const int =1e5+7;
      |           ^
a.cc:60:17: error: 'N' was not declared in this scope
   60 | vector<int> adj[N];
      |                 ^
a.cc:61:10: error: 'N' was not declared in this scope
   61 | int mark[N];
      |          ^
a.cc:62:9: error: 'N' was not declared in this scope
   62 | int nim[N];
      |         ^
a.cc: In function 'void dfs(int, int)':
a.cc:64:21: error: 'adj' was not declared in this scope
   64 |         for (auto u:adj[v])
      |                     ^~~
a.cc:67:25: error: 'nim' was not declared in this scope
   67 |                         nim[v]^=nim[u]+1;
      |                         ^~~
a.cc: In function 'int main()':
a.cc:79:17: error: 'adj' was not declared in this scope
   79 |                 adj[v].push_back(u);
      |                 ^~~
a.cc:83:16: error: 'nim' was not declared in this scope
   83 |         cout<<(nim[0] ? "Alice" : "Bob")<<"\n";
      |                ^~~
Language: Java

import java.util.*;

public class Main {
  static ArrayList[] edge;
  
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    edge = new ArrayList[N + 1];
    for(int i = 1; i < N + 1; i++) {
      edge[i] = new ArrayList<Integer>();
    }
    for(int i = 0; i < N - 1; i++) {
      int x = sc.nextInt();
      int y = sc.nextInt();
      edge[x].add(y);
      edge[y].add(x);
    }
    String ans = "Alice";
    if(dfs(1, 0) == 0) ans = "Bob";
    System.out.println(ans);
  }

  public static int dfs(int v, int p) {
    ArrayList<Integer> list = edge[v];
    int ret = 0;
    for(int i = 0; i < list.size(); i++) {
      int u = list.get(i);
      if(u != p) {
        ret = (ret ^ (dfs(u, v) + 1));
      }
    }
  }
}

Compiler output:
Main.java:33: error: missing return statement
  }
  ^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
Language: C++

#include<list>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
using namespace std;



int n;
#define MAX 100002

vector<int> v[MAX];
int gr[MAX];

inline void dfs(int b,int pr=-1) {
	if (v[b].size() == 1 ) {
		gr[b] = 0;
		return;
	}
	for (int i = 0; i < v[b].size(); i++) {
		int go = v[b][i];
		if (go != pr) {
			dfs(go,b);
			gr[b] ^= (gr[go] + 1);
		}
	}
}

int main() {
	cin >> n;
	for (int i = 1; i < n; i++) {
		int a, b;
		scanf("%d%d", &a, &b);
		a--;
		b--;
		v[a].push_back(b);
		v[b].push_back(a);
	}
	dfs(0);
	if (gr[0]) {
		puts("Alice");
	}
	else {
		puts("Bob");
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:9: error: 'cin' was not declared in this scope
   33 |         cin >> n;
      |         ^~~
a.cc:8:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    7 | #include<cmath>
  +++ |+#include <iostream>
    8 | using namespace std;
a.cc:36:17: error: 'scanf' was not declared in this scope
   36 |                 scanf("%d%d", &a, &b);
      |                 ^~~~~
a.cc:44:17: error: 'puts' was not declared in this scope
   44 |                 puts("Alice");
      |                 ^~~~
a.cc:47:17: error: 'puts' was not declared in this scope
   47 |                 puts("Bob");
      |                 ^~~~
Language: C++

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

const int MAX = 1234567;

vector<int> g[MAX];

int dfs (int v, int r) {
	int res = 0;
	for (auto u : g[v])
		if (u != r)
			res ^= dfs (u, v);

	return res + 1;
}

int main() {
	ios_base :: sync_with_stdio(false);
	cin.tie(0);
	cin >> n;
	for (int i =  0; i < n-1; i++) {
		int a, b;
		cin >> a >> b; a--; b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}

	cout << (dfs (0,-1)==1 ? "Bob" : "Alice") << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:16: error: 'n' was not declared in this scope; did you mean 'yn'?
   20 |         cin >> n;
      |                ^
      |                yn
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,x[100010];
int main(){
	cin>>n;
	memset(x,0,n);
	for(int i=0;i<n;i++){
		int a,b;cin>>a>>b;a--,b--;
		x[a]++,x[b]++;
	}
	int cnt=0;
	for(int i=0;i<n;i++){
		if(x[i]%2==1)cnt++;
	}
	if(cnt%2==1)cout<<"Alice"<<endl;
	else cout<<"Bob"<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'memset' was not declared in this scope
   10 |         memset(x,0,n);
      |         ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<vector>
  +++ |+#include <cstring>
    5 | #define rep(i,n) for(int i=0;i<n;i++)
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define For(i,a,b) for(int i=a;i<b;i++)
const int M=100005;
bool has[M];
int n,fa[M],sg[M],res;
vector<int>G[M];
int Tz(int x=1,int f=-1){
	int res=sg[x];
	For(i,0,G[x].size())if(G[x][i]!=f)
		res^=(Tz(G[x][i],x)+1);			
	return res;
}
int main(){
    scanf("%d",&n);
    For(i,0,n-1){
    	int x,y;
		scanf("%d %d",&x,&y);
		G[x-1].push_back(y-1);
		G[y-1].push_back(x-1);
	}
	For(i,0,n)dfs(i);
    printf("%s",Tz()?"Alice":"Bob");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:22:19: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   22 |         For(i,0,n)dfs(i);
      |                   ^~~
      |                   ffs
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,x[100010];
int main(){
	cin>>n;
	memset(x,0,n);
	for(int i=0;i<n;i++){
		int a,b;a--,b--;
		x[a]++,x[b]++;
	}
	int cnt=0;
	for(int i=0;i<n;i++){
		if(x[i]%2==1)cnt++;
	}i
	if(cnt%2==1)cout<<"Alice"<<endl;
	else cout<<"Bob"<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:9: error: 'memset' was not declared in this scope
   10 |         memset(x,0,n);
      |         ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include<vector>
  +++ |+#include <cstring>
    5 | #define rep(i,n) for(int i=0;i<n;i++)
a.cc:18:10: error: 'i' was not declared in this scope
   18 |         }i
      |          ^
a.cc:20:9: error: 'else' without a previous 'if'
   20 |         else cout<<"Bob"<<endl;
      |         ^~~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
int N;
vector<vector<int > > to;
int dfs(int i,int from) {
	if (to[i].size() == 1) {
		return 1;
	}
	else {
		int ret = 0;
		for (int j = 0; j < to[i].size(); j++) {
			if (to[i][j] != from) {
				ret += dfs(to[i][j], i);
			}
		}
	}
	return ret % 2;
	
}
signed main() {
	cin >> N;
	to.resize(N);
	int x, y;
	for (int i = 0; i < N - 1; i++) {
		cin >> x >> y;
		x--;
		y--;
		to[x].push_back(y);
		to[y].push_back(x);
	}
	int res;
	res = dfs(0,-1);
	if (res == 1) {
		cout << "Alice" << endl;
	}
	else {
		cout << "Bob" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int dfs(int, int)':
a.cc:18:16: error: 'ret' was not declared in this scope
   18 |         return ret % 2;
      |                ^~~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<typename T> using Graph = vector<vector<T>>;

#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) REP(i, 0, a)
#define EACH(i, a) for (auto i: a)
#define ITR(x, a) for (__typeof(a.begin()) x = a.begin(); x != a.end(); x++)
#define ALL(a) (a.begin()), (a.end())
#define HAS(a, x) (a.find(x) != a.end())
#define endl '\n'

int N;
set<int> cand;
int x[100005], y[100005];

int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> N;

  int root = 0;
  int edge = 0;

  rep(i, N - 1) {
      cin >> x[i] >> y[i];
      x[i]--; y[i]--;
      if (x[i] > y[i]) swap(x[i], y[i]);
      if (x[i] == 0) {
          root += 1;
          cand.add(y[i]);
      } 
  }

  rep(i, N) {
    if (HAS(cand, x[i])) {
        edge += 1;
        root -= 1;
        cand.remove(x[i]);
    }
    if (HAS(cand, y[i])) {
        edge += 1;
        root -= 1;
        cand.remove(y[i]);
    }
  }

  int hand = 0;
  while (true) {
    if (edge == 0) {
        root -= 1;
    }
    else {
        if (root%2 == 1) {
            edge -= 1;
        } else {
            root -= 1;
        }
    }
    if (root == 0) {
      cout << (hand == 1 ? "Bob":"Alice") << endl;
      break;
    }

    hand = (hand + 1)%2;
  }
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:33:16: error: 'class std::set<int>' has no member named 'add'
   33 |           cand.add(y[i]);
      |                ^~~
a.cc:41:14: error: 'class std::set<int>' has no member named 'remove'
   41 |         cand.remove(x[i]);
      |              ^~~~~~
a.cc:46:14: error: 'class std::set<int>' has no member named 'remove'
   46 |         cand.remove(y[i]);
      |              ^~~~~~
Language: C++

#include <iostream>
#include <cstdio>
using anemspace std;

int main()
{
char c;
while(scanf("%c",&c)!=EOF);
printf("Alice");
}

Compiler output:
a.cc:3:7: error: expected nested-name-specifier before 'anemspace'
    3 | using anemspace std;
      |       ^~~~~~~~~
Language: C++

//Copyright(c)2017 Mstdream
#include<bits/stdc++.h>
using namespace std;
inline void splay(int &v){
	v=0;char c=0;int p=1;
	while(c<'0' || c>'9'){if(c=='-')p=-1;c=getchar();}
	while(c>='0' && c<='9'){v=(v<<3)+(v<<1)+c-'0';c=getchar();}
	v*=p;
}
const int N=200020;
int nxt[N*2],fir[N],to[N*2],sz,n,dp[N];
void add(int x,int y){
	nxt[++sz]=fir[x],fir[x]=sz,to[sz]=y;
}
//1先手0后手 
void dfs(int x,int fa){
	int a=0,b=0; 
	for(int u=fir[x];u;u=nxt[u]){
		if(to[u]!=fa){
			dfs(to[u],x);
			if(dp[to[u]]==1)a++;
			else b++;
		} 
	}
	if((b&1)==1)dp[x]=1;
	else{
		if((a&1)==1)dp[x]=1;
		else dp[x]=0;
	}
}
int main(){
	int _q=20<<20;
	char *_p=(char*)malloc(_q)+_q;
	__asm__("movl %0, %%esp\n"::"r"(_p));
	splay(n);
	for(int i=1;i<n;i++){
		int x,y;splay(x),splay(y);
		add(x,y),add(y,x);
	}
	dfs(1,0);
	puts(dp[1]?"Alice":"Bob");
}

Compiler output:
a.cc: Assembler messages:
a.cc:34: Error: operand type mismatch for `mov'
Language: C++

#include<cstdio>
#include<cstring>
#include<cctype>
#include<algorithm>
#define ll long long
#define INF 1000000000
#define clr(x) memset(x,0,sizeof(x))
using namespace std;

inline int read()
{
	register int ret=0,c=getchar();
	while(!isdigit(c))c=getchar();
	while(isdigit(c))ret=ret*10+c-'0',c=getchar();
	return ret;
}

#define M 100005

int n,fa[M],sg[M];
int first[M],next[M<<1],to[M<<1],t;

void addedge(int s,int v)
{
	next[++t]=first[s];
	first[s]=t;
	to[t]=v;
}

void dfs(int x)
{
	for(int i=first[x];i;i=next[i])
	{
		int v=to[i];
		if(v==fa[x])continue;
		fa[v]=x;
		dfs(v);
		sg[x]^=sg[v]+1;
	}
}

int main()
{
	n=read();
	for(int i=1;i<n;i++)
	{
		int x=read(),y=read();
		addedge(x,y);
		addedge(y,x);
	}
	dfs(1);
	if(sg[1]==0)puts("Bob");
	else puts("Alice");
	return 0;
}

Compiler output:
a.cc: In function 'int read()':
a.cc:12:22: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |         register int ret=0,c=getchar();
      |                      ^~~
a.cc:12:28: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
   12 |         register int ret=0,c=getchar();
      |                            ^
a.cc: In function 'void addedge(int, int)':
a.cc:25:9: error: reference to 'next' is ambiguous
   25 |         next[++t]=first[s];
      |         ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:4:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:21:14: note:                 'int next [200010]'
   21 | int first[M],next[M<<1],to[M<<1],t;
      |              ^~~~
a.cc: In function 'void dfs(int)':
a.cc:32:32: error: reference to 'next' is ambiguous
   32 |         for(int i=first[x];i;i=next[i])
      |                                ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:21:14: note:                 'int next [200010]'
   21 | int first[M],next[M<<1],to[M<<1],t;
      |              ^~~~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<ctime>
#include<cmath>

using namespace std;
typedef long long LL;
const int N=500050;

int head[N],to[N],next[N],sg[N],n,tot;

void addedge(int u,int v){
	tot++;to[tot]=v,next[tot]=head[u],head[u]=tot;
	tot++;to[tot]=u,next[tot]=head[v],head[v]=tot;
}
void dfs(int x,int fa){
	for(int i=head[x];i;i=next[i]){
		if(to[i]!=fa){
			dfs(to[i],x);
			sg[x]^=sg[to[i]]+1;
		}
	}
}

int main(){
	int i,j,k;
	scanf("%d",&n);
	for(i=1;i<n;i++){
		scanf("%d%d",&j,&k);
		addedge(j,k);
	}
	dfs(1,0);
	if(sg[1])puts("Alice");
	else puts("Bob");
	return 0;
}


Compiler output:
a.cc: In function 'void addedge(int, int)':
a.cc:16:25: error: reference to 'next' is ambiguous
   16 |         tot++;to[tot]=v,next[tot]=head[u],head[u]=tot;
      |                         ^~~~
In file included from /usr/include/c++/14/string:47,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 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/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:13:19: note:                 'int next [500050]'
   13 | int head[N],to[N],next[N],sg[N],n,tot;
      |                   ^~~~
a.cc:17:25: error: reference to 'next' is ambiguous
   17 |         tot++;to[tot]=u,next[tot]=head[v],head[v]=tot;
      |                         ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:13:19: note:                 'int next [500050]'
   13 | int head[N],to[N],next[N],sg[N],n,tot;
      |                   ^~~~
a.cc: In function 'void dfs(int, int)':
a.cc:20:31: error: reference to 'next' is ambiguous
   20 |         for(int i=head[x];i;i=next[i]){
      |                               ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:13:19: note:                 'int next [500050]'
   13 | int head[N],to[N],next[N],sg[N],n,tot;
      |                   ^~~~
Language: C++

#include<cstdio>
#include<algorithm>
#define fo(i,a,b) for(int i=a;i<=b;i++)
using namespace std;

typedef long long LL;

const int maxn=1e5+5;

int n;

int tot,go[2*maxn],next[2*maxn],f1[maxn];
void ins(int x,int y)
{
	go[++tot]=y;
	next[tot]=f1[x];
	f1[x]=tot;
}

int sg[maxn];
void dfs(int k,int last)
{
	sg[k]=0;
	for(int p=f1[k]; p; p=next[p]) if (go[p]!=last)
	{
		dfs(go[p],k);
		sg[k]^=(sg[go[p]]+1);
	}
}

int main()
{
	scanf("%d",&n);
	fo(i,1,n-1)
	{
		int x,y;
		scanf("%d %d",&x,&y);
		ins(x,y), ins(y,x);
	}
	
	dfs(1,0);
	
	printf((sg[1]) ?"Alice\n" :"Bob\n");
}

Compiler output:
a.cc: In function 'void ins(int, int)':
a.cc:16:9: error: reference to 'next' is ambiguous
   16 |         next[tot]=f1[x];
      |         ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:12:20: note:                 'int next [200010]'
   12 | int tot,go[2*maxn],next[2*maxn],f1[maxn];
      |                    ^~~~
a.cc: In function 'void dfs(int, int)':
a.cc:24:31: error: reference to 'next' is ambiguous
   24 |         for(int p=f1[k]; p; p=next[p]) if (go[p]!=last)
      |                               ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:12:20: note:                 'int next [200010]'
   12 | int tot,go[2*maxn],next[2*maxn],f1[maxn];
      |                    ^~~~
Language: C++

#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
using namespace std;
const int N=100010;
int e[N*2],next[N*2],head[N],ed=0;
void adde(int x,int y){e[++ed]=y;next[ed]=head[x];head[x]=ed;}
int dfs(int x,int fa){
    int i,t=0;
    for(i=head[x];i;i=next[i])
        if(e[i]!=fa) t^=dfs(e[i],x)+1;
    return t;
}
int main(){
    int n,i,x,y;
    scanf("%d",&n);
    for(i=1;i<n;i++){
        scanf("%d %d",&x,&y);
        adde(x,y);adde(y,x);
    }
    if(dfs(1,0)) printf("Alice\n");
    else printf("Bob\n");
    return 0;
}


Compiler output:
a.cc: In function 'void adde(int, int)':
a.cc:11:34: error: reference to 'next' is ambiguous
   11 | void adde(int x,int y){e[++ed]=y;next[ed]=head[x];head[x]=ed;}
      |                                  ^~~~
In file included from /usr/include/c++/14/string:47,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:10:12: note:                 'int next [200020]'
   10 | int e[N*2],next[N*2],head[N],ed=0;
      |            ^~~~
a.cc: In function 'int dfs(int, int)':
a.cc:14:23: error: reference to 'next' is ambiguous
   14 |     for(i=head[x];i;i=next[i])
      |                       ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:10:12: note:                 'int next [200020]'
   10 | int e[N*2],next[N*2],head[N],ed=0;
      |            ^~~~
Language: C++

#include <vector>
static const int MAXN = 100005;

int n;
std::vector<int> e[MAXN];

int f[MAXN];

void dfs(int u, int p = -1)
{
    f[u] = 0;
    for (int v : e[u]) if (v != p) {
        dfs(v, u);
        f[u] ^= (f[v] + 1);
    }
}

int main()
{
    scanf("%d", &n);
    for (int i = 0, u, v; i < n - 1; ++i) {
        scanf("%d%d", &u, &v); --u, --v;
        e[u].push_back(v);
        e[v].push_back(u);
    }

    dfs(0);
    puts(f[0] == 0 ? "Bob" : "Alice");

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:20:5: error: 'scanf' was not declared in this scope
   20 |     scanf("%d", &n);
      |     ^~~~~
a.cc:28:5: error: 'puts' was not declared in this scope
   28 |     puts(f[0] == 0 ? "Bob" : "Alice");
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int N=410;
int n,h,in[N],out[N];
int fa[N];
bool ok[N];
int find(const int &x){return fa[x]==x?x:fa[x]=find(fa[x]);}
int main(){
    n=read();h=read();
    for(int i=1;i<=(h<<1);i++) fa[i]=i;
    for(int i=1;i<=n;i++){
        int A=read(),B=read(),C=read(),D=read();
        int x=C?C+h:A,y=D?D:B+h;
        out[x]++;in[y]++;
        x=find(x);y=find(y);
        if(x!=y) fa[x]=y;
    }
    for(int i=1;i<=h;i++) if(in[i]>out[i]) return !puts("NO");
    for(int i=h+1;i<=(h<<1);i++) if(in[i]<out[i]) return !puts("NO");
    for(int i=1;i<=(h<<1);i++) if(in[i]!=out[i]||!in[i]&&!out[i]) ok[find(i)]=1;
    for(int i=1;i<=(h<<1);i++) if(fa[i]==i&&!ok[i]) return !puts("NO");
    return !puts("YES");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:11: error: too few arguments to function 'ssize_t read(int, void*, size_t)'
    9 |     n=read();h=read();
      |       ~~~~^~
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /usr/include/c++/14/csignal:42,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:116,
                 from a.cc:1:
/usr/include/unistd.h:371:16: note: declared here
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
a.cc:9:20: error: too few arguments to function 'ssize_t read(int, void*, size_t)'
    9 |     n=read();h=read();
      |                ~~~~^~
/usr/include/unistd.h:371:16: note: declared here
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
a.cc:12:19: error: too few arguments to function 'ssize_t read(int, void*, size_t)'
   12 |         int A=read(),B=read(),C=read(),D=read();
      |               ~~~~^~
/usr/include/unistd.h:371:16: note: declared here
  371 | extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur
      |                ^~~~
a.cc:13:15: error: 'C' was not declared in this scope
   13 |         int x=C?C+h:A,y=D?D:B+h;
      |               ^
a.cc:14:21: error: 'y' was not declared in this scope
   14 |         out[x]++;in[y]++;
      |                     ^
Language: C++

#include <iostream>
#include <vector>
#include<string.h>
using namespace std;
struct node
{
    int a, b, c, d;
};
vector<int> v[2][200];
node nd[100010];
bool rcd[100010];
int count = 1;
int N, H;

bool dfs(int f, int h)
{
    for (int i = 0; i < v[f][h].size(); i++)
    {
        if (rcd[v[f][h][i]] == 1)
            continue;
        else
            rcd[v[f][h][i]] == 1;
        if (++count == N)
            return 1;
        node nt = nd[v[f][h][i]];
        int f1, h1;
        if (nt.d == 0)
        {
            f1 = 1;
            h1 = nt.b;
        }
        else
        {
            f1 = 0;
            h1 = nt.d;
        }
        if (dfs(f1, h1))
            return 1;
        else
            rcd[v[f][h][i]] = 0;
    }
}

int main()
{
    cin >> N >> H;
    for (int i = 0; i < N; i++)
    {
        int A, B, C, D;
        cin >> A >> B >> C >> D;
        nd[i].a = A;
        nd[i].b = B;
        nd[i].c = C;
        nd[i].d = D;
        if (nd[i].c == 0)
        {
            v[0][nd[i].a].push_back(i);
        }
        else
            v[1][nd[i].c].push_back(i);
    }
    for (int i = 0; i < N; i++)
    {
        memset(rcd,0,sizeof(rcd));
        if (nd[i].c == 0)
        {
            rcd[i]=1;
            if (dfs(nd[i].d == 0 ? 1 : 0, nd[i].d == 0 ? nd[i].b : nd[i].d))
            {
                cout << "YES";
                return 0;
            }
        }
        count=1;
    
    cout << "NO";
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:78:2: error: expected '}' at end of input
   78 | }
      |  ^
a.cc:45:1: note: to match this '{'
   45 | {
      | ^
a.cc: In function 'bool dfs(int, int)':
a.cc:42:1: warning: control reaches end of non-void function [-Wreturn-type]
   42 | }
      | ^
Language: C++

//AtCoder Grand Contest 017 E - Jigsaw

#include <cstdio>
#include <iostream>
#include <cmath>

using namespace std;

int qr(){int ret = 0,f=1;char ch =getchar();while(!isdigit(ch))f=ch=='-'?-1:1,ch=getchar();while(isdigit(ch))ret=ret*10+ch-'0',ch=getchar();return ret*f;}

#define maxN 100005
#define maxH 205

int indegree[maxH<<2],outdegree[maxH<<2];

void read(int x,int y){
    indegree[y]++;
    outdegree[x]++;
    nxt[++tot] = fir[x];
    fir[x] = tot;
    ver[tot] = y;
}
int f[maxH<<1];
void init(){
    for(int i = 1;i<=(maxH<<1);i++)
        f[i] = i;
}
int gf(int x){
    if(f[x] == x) return x;
    else return f[x] = gf(f[x]);
}
int mer(int x,int y){
    x = gf(x);y = gf(y);
    if(x == y) return 0;
    f[x] = y;
    return 1;
}
int main(){
    int N = qr(),H = qr();
    int NN = N;
    int t1,t2,t3,t4,t5,t6;//上 t + maxN 下 t + maxN + maxH
    for(int i = 1;i<=N;i++){
        t1 = qr(),t2 = qr(),t3 = qr(),t4 = qr();
        if(!t3) t5 = t1;else t5 = t3+H;
        if(!t4) t6 = t2+H;else t6 = t4;
        read(t5,t6);
        N -= mer(t5,t6);
    }
    if(NN != 1){
        cout << "NO";
        return 0;
    }
    int in = 0,out = 0;
    for(int i = 1;i<=(H<<1);i++){
        if(indegree[i]!=outdegree[i]){
            if(indegree[i]>outdegree[i])
                in++;
            else out++;
            if(in == 2||out == 2){
                cout <<"NO";
                return 0;
            }
        }
    }
    cout << "YES";
    /*
    int a=0,b=0;
    for(int i = maxN;i<=maxN + 500;i++){
        if(indegree[i] == outdegree[i])
            continue;
        else {
            if(abs(indegree[i]-outdegree[i])!=1) {cout << "NO";return 0;}
            else {
                //if(i<=maxN+maxH) {
                    if(indegree[i] > outdegree[i])
                        a++;
                    else b++;
                //}else{
                //    if(indegree[i] > outdegree[i])
                //        b++;
                //    else a++;
                //}
            }
            if(a == 2||b == 2){cout << "NO";return 0;}
        }
    }
    if(a == b){cout << "YES";}
    else {cout << "NO";}
    */
    return 0;
}


Compiler output:
a.cc: In function 'void read(int, int)':
a.cc:19:5: error: 'nxt' was not declared in this scope
   19 |     nxt[++tot] = fir[x];
      |     ^~~
a.cc:19:11: error: 'tot' was not declared in this scope
   19 |     nxt[++tot] = fir[x];
      |           ^~~
a.cc:19:18: error: 'fir' was not declared in this scope
   19 |     nxt[++tot] = fir[x];
      |                  ^~~
a.cc:21:5: error: 'ver' was not declared in this scope
   21 |     ver[tot] = y;
      |     ^~~
Language: C++

//AtCoder Grand Contest 017 E - Jigsaw

#include <cstdio>
#include <iostream>
#include <cmath>

using namespace std;

int qr(){int ret = 0,f=1;char ch =getchar();while(!isdigit(ch))f=ch=='-'?-1:1,ch=getchar();while(isdigit(ch))ret=ret*10+ch-'0',ch=getchar();return ret*f;}

#define maxN 100005
#define maxH 205

int fir[maxN],nxt[maxN<<3],ver[maxN<<3],tot;
int indegree[maxN<<2],outdegree[maxN<<2];

void read(int x,int y){
    indegree[y]++;
    outdegree[x]++;
    nxt[++tot] = fir[x];
    fir[x] = tot;
    ver[tot] = y;
}
int f[maxH<<1];
void init(){
    for(int i = 1;i<=(maxH<<1);i++)
        f[i] = i;
}
int gf(int x){
    if(f[x] == x) return x;
    else return f[x] = gf(f[x]);
}
int mer(int x,int y){
    x = gf(x);y = gf(y);
    if(x == y) return 0;
    f[x] = y;
    return 1;
}
int main(){
    int N = qr(),H = qr();
    int N = N;
    int t1,t2,t3,t4,t5,t6;//上 t + maxN 下 t + maxN + maxH
    for(int i = 1;i<=N;i++){
        t1 = qr(),t2 = qr(),t3 = qr(),t4 = qr();
        /*
        if(t3 == 0) read(t1 + maxN + maxH , i);
        else read(t3 + maxN , i);
        if(t4 == 0) read(i,t2+maxN);
        else read(i,t4 + maxN + maxH);*/
        if(!t3) t5 = t1;else t5 = t3+H;
        if(!t4) t6 = t2+H;else t6 = t4;
        read(t5,t6);
        N -= mer(t5,t6);
    }
    if(N != 1){
        cout << "NO";
        return 0;
    }
    int in = 0,out = 0;
    for(int i = 1;i<=(H<<1);i++){
        if(indegree[i]!=outdegree[i]){
            if(indegree[i]>outdegree[i])
                in++;
            else out++;
            if(in == 2||out == 2){
                cout <<"NO";
                return 0;
            }
        }
    }
    cout << "YES";
    /*
    int a=0,b=0;
    for(int i = maxN;i<=maxN + 500;i++){
        if(indegree[i] == outdegree[i])
            continue;
        else {
            if(abs(indegree[i]-outdegree[i])!=1) {cout << "NO";return 0;}
            else {
                //if(i<=maxN+maxH) {
                    if(indegree[i] > outdegree[i])
                        a++;
                    else b++;
                //}else{
                //    if(indegree[i] > outdegree[i])
                //        b++;
                //    else a++;
                //}
            }
            if(a == 2||b == 2){cout << "NO";return 0;}
        }
    }
    if(a == b){cout << "YES";}
    else {cout << "NO";}
    */
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:41:9: error: redeclaration of 'int N'
   41 |     int N = N;
      |         ^
a.cc:40:9: note: 'int N' previously declared here
   40 |     int N = qr(),H = qr();
      |         ^
Language: C++

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

const int MAXN = (200 + 10) * 2;

class no_solution : public std::exception
{
public:
	const char * what(void) const noexcept
	{
		return "no solution reachable";
	}
};

namespace disjointSet
{
int fa[MAXN];

void init()
{
	memset(fa, 0x00, sizeof fa);
}

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

void merge(int x, int y)
{
	x = fa(x), y = fa(y);
	if(x != y)
		fa[x] = y;
}

}

bool loop[MAXN];
int inDeg[MAXN], outDeg[MAXN];
int N, H;

void solve()
{
	for(int i = 0; i <= 2 * H; i++)
	{
		if(i > H)
			if(inDeg[i] > outDeg[i])
				throw no_solution();
		if(i < H)
			if(outDeg[i] > inDeg[i])
				throw no_solution();

		bool found = false, isLoop = loop[i];

		for(int j = 0; j <= 2 * H; j++)
			if(found)
				break;
			else
				if(disjointSet::find(i) == disjointSet::find(j))
				{
					if(i != j)
						isLoop = true;
					if(inDeg[j] != outDeg[j])
						found = true;
				}

		if(!found && isLoop)
			throw no_solution();
	}
}

int main()
{
	ios::sync_with_stdio(false), cin.tie(nullptr);

	cin >> N >> H ;
	for(int i = 1; i <= N; i++)
	{
		int a, b, c, d, L, R;
		cin >> a >> b >> c >> d;
		L = c ? H - c : H + a;
		R = d ? H + d : H - b;
		disjointSet::merge(L, R);
		inDeg[R]++, outDeg[L]++;

		if(L == R)
			loop[L] = true;
	}


	try
	{
		solve();
		cout << "YES" << endl;
	}
	catch(std::exception & x)
	{
		cout << "NO" << endl ;
	}

	return 0;
}



Compiler output:
a.cc: In function 'void disjointSet::merge(int, int)':
a.cc:34:15: error: 'disjointSet::fa' cannot be used as a function
   34 |         x = fa(x), y = fa(y);
      |             ~~^~~
a.cc:34:26: error: 'disjointSet::fa' cannot be used as a function
   34 |         x = fa(x), y = fa(y);
      |                        ~~^~~
Language: C++

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

using namespace std;

#define sz(x) (int)(x.size())
#define fi(a,b) for(int i=a;i<b;++i)
#define fj(a,b) for(int j=a;j<b;++j)
#define pb push_back
#define mp make_pair
typedef pair<int, int> pii;
///////////////////////

int const N = 1e5 + 41;
int const H = 241;

int n, h, a[N], b[N], c[N], d[N];
vector<pii> e[H][2];
int pe[H][2], q;
pii v;

void yes(){
	printf("YES\n");
	exit(0);
}

pii getfrom(int a, int c){
	if(c == 0){
		return mp(a, 1);
	}else{
		return mp(c, 0);
	}
}

pii getto(int a, int c){
	if(c == 0){
		return mp(a, 0);
	}else{
		return mp(c, 1);
	}
}

void dfs(pii x){
	v = x;
	int p = pe[x.first][x.second];
	while(pe[x.first][x.second] < sz(e[x.first][x.second])){
		pii y = e[x.first][x.second][pe[x.first][x.second]];
		++pe[x.first][x.second];
		++q;
		dfs(y);
	}
}

void solve(){
	fi(0, n){
		pii x = getfrom(a[i], c[i]);
		pii y = getto(b[i], d[i]);
		e[x.first][x.second].pb(y);
	}
	fi(1, h+1){
		memset(pe, 0, sizeof(pe));
		q = 0;
		dfs(mp(i, 1));
		if(q == n && v.second == 0) yes();
	}
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	
	scanf("%d %d",&n,&h);
	fi(0, n){
		scanf("%d %d %d %d",&a[i],&b[i],&c[i],&d[i]);
	}

	solve();

	printf("NO\n");

	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:62:17: error: 'memset' was not declared in this scope
   62 |                 memset(pe, 0, sizeof(pe));
      |                 ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<vector>
  +++ |+#include <cstring>
    4 |
Language: C++

#include <algorithm>
#include <cassert>
#include <cstring>
#include <iostream>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define TRACE(x) cout << #x << " = " << x << endl
#define _ << " _ " <<

typedef long long llint;

const int MAX = 444;

vector<int> E[MAX];
bool bio[MAX];

int inDeg[MAX];
int outDeg[MAX];
int N, H;

vector<int> v;

void dfs(int x) {
  if (bio[x]) return;
  bio[x] = true;
  v.push_back(x);
  for (int y: E[x]) dfs(y);
}

bool solve() {
  REP(i, 2*H) {
    if (!bio[i] && E[i].size()) {
      v.clear();
      dfs(i);
      
      bool haveStart = false;
      bool haveEnd = false;
      
      int balance = 0;
      for (int x: v) {
        if (x < H) {
          haveStart = true;
          if (inDeg[x] > outDeg[x]) return false;
          balance += outDeg[x] - inDeg[x];
        } else {
          haveEnd = true;
          if (inDeg[x] < outDeg[x]) return false;
          balance -= inDeg[x] - outDeg[x];
        }
      }
      if (!haveStart || !haveEnd || balance != 0) return false;
    }
  }
  return true;
}

int main(void) {
  scanf("%d %d", &N, &H);
  REP(i, N) {
    int A, B, C, D;
    scanf("%d %d %d %d", &A, &B, &C, &D);

    int u = C == 0 ? A-1 : H+C-1;
    int v = D == 0 ? H+B-1 : D-1;

    E[u].push_back(v);
    E[v].push_back(u);
    outDeg[u]++;
    inDeg[v]++;
  }

  puts(solve() ? "YES" : "NO");
  return 0;
}


Compiler output:
a.cc:17:1: error: 'vector' does not name a type
   17 | vector<int> E[MAX];
      | ^~~~~~
a.cc:24:1: error: 'vector' does not name a type
   24 | vector<int> v;
      | ^~~~~~
a.cc: In function 'void dfs(int)':
a.cc:29:3: error: 'v' was not declared in this scope
   29 |   v.push_back(x);
      |   ^
a.cc:30:15: error: 'E' was not declared in this scope
   30 |   for (int y: E[x]) dfs(y);
      |               ^
a.cc: In function 'bool solve()':
a.cc:35:20: error: 'E' was not declared in this scope
   35 |     if (!bio[i] && E[i].size()) {
      |                    ^
a.cc:36:7: error: 'v' was not declared in this scope
   36 |       v.clear();
      |       ^
a.cc: In function 'int main()':
a.cc:69:5: error: 'E' was not declared in this scope
   69 |     E[u].push_back(v);
      |     ^
Language: C++

#include<bits/stdc++.h>

#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pf push_front
#define pb2 pop_back
#define pf2 pop_front
#define line printf("\n")
#define pq priority_queue
#define rep(k,i,j) for(int k = (int)i;k<(int)j;k++)
#define repd(k,i,j) for(int k = (int)i;k>=(int)j;k--)
#define ll long long
#define ALL(a) a.begin(),a.end()
#define vi vector<int>

using namespace std;

double EPS = 1e-9;
int INF = 1e9+7;;
long long INFLL = 1e17;
double pi = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};

clock_t first_attempt = clock();
inline void cek_time(){
	clock_t cur = clock()- first_attempt;
	cerr<<"TIME : "<<(double) cur/CLOCKS_PER_SEC<<endl;
}
inline void OPEN (string s) {
  freopen ((s + ".in").c_str (), "r", stdin);
  freopen ((s + ".out").c_str (), "w", stdout);
}

//end of template

int n,H;

const int maxn=  1e5+4;
int deg[maxn];
vi adj[maxn];
void add_edge(int a,int b){
	deg[a]++;
	deg[b]--;
	adj[a].pb(b);
//	printf("%d -> %d\n",a,b);
}

int bisa = 1;

int cycle2(int st){
	int a = st;
	while(1){
		if(adj[a].size()==0){bisa=  0;return;}
		int b = adj[a].back();
		adj[a].pb2();
		a = b;
		if(a==st)return;
	}
}
void cycle(int st){
	
	int a = st;
	while(1){
		if(adj[a].size()==0){bisa=  0;return;}
		int b = adj[a].back();
		adj[a].pb2();
		a = b;
		if(a<H)return;
	}
}
int main(){
	scanf("%d%d",&n,&H);
	
	H+=2;
	rep(k,0,n){
		int a,b,c,d;
		scanf("%d%d%d%d",&a,&b,&c,&d);
		a+= c;
		b+= d;
		swap(a,c);swap(b,d);
		
		if(!a && !b){
			add_edge(c,d);
		}
		if(!a && b){
			add_edge(c,b + H);
		}
		if(a && !b){
			add_edge(a+H,d);
		}
		if(a && b){
			add_edge(a+H,b + H);
		}
	}
	
	rep(k,0,H){
		while(adj[k].size())cycle(k);
	}
	
	rep(k,H,2*H+1){
		while(adj[k].size())cycle2(k);
	}
	
	printf("%s\n",bisa?"YES":"NO");
	
	return 0;
}


Compiler output:
a.cc: In function 'int cycle2(int)':
a.cc:58:47: error: return-statement with no value, in function returning 'int' [-fpermissive]
   58 |                 if(adj[a].size()==0){bisa=  0;return;}
      |                                               ^~~~~~
a.cc:62:26: error: return-statement with no value, in function returning 'int' [-fpermissive]
   62 |                 if(a==st)return;
      |                          ^~~~~~
Language: C++

#include<bits/stdc++.h>
#define mo 1000000007
//#define add(a,b) (a+b>=mo)?(a+=b-mo):(a+=b)
#define lowbit(s) ((s)&(-(s))) 
using namespace std;
int f[2][22][1<<20],a[22][22];
inline void add(int &a,int b){(a+b>=mo)?(a+=b-mo):(a+=b);}
int main()
{
	int n,m,q;scanf("%d%d%d",&n,&m,&q);
	memset(a,255,sizeof(a));
	while (q--)
	{
		int u,v,w;scanf("%d%d%d",&u,&v,&w);
		a[u][v]=w;
	}
	f[1][0][0]=1;
	for (int i=1;i<=m;i++)
	{
		memset(f[(i&1)^1],0,sizeof(f[(i&1)^1]));
		for (int j=0;j<n;j++)
		{
			for (int s=0;s<(1<<(n-1));s++) if (f[i&1][j][s])
			{
				//cout<<i<<' '<<j<<' '<<s<<' '<<f[i][j][s]<<endl;
				if (j==n-1)
				{
					add(f[(i&1)^1][0][s],f[i&1][j][s]);
				}
				else
				{
					add(f[i&1][j+1][s],f[i&1][j][s]*((a[i][j+1]!=1)&&((s&(1<<j))==0)));
					add(f[i&1][j+1][s+(!(bool)(s&(1<<j)))*(-(lowbit(s>>j)<<j)+(1<<j))],f[i&1][j][s]*(a[i][j+1]!=0));
					
				}
			}
	}
	int ans=0;
	for (int s=0;s<(1<<(n-1));s++) add(ans,f[m&1][n-1][s]);
	printf("%d\n",ans);
}
	
	
	
	
	
	
	
	
	
	
	

Compiler output:
a.cc: In function 'int main()':
a.cc:41:2: error: expected '}' at end of input
   41 | }
      |  ^
a.cc:9:1: note: to match this '{'
    9 | {
      | ^
Language: C++

#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <string>
using namespace std;

int main()
{
	int ans,n, m;
	char str[222];
	cin >> str;
	int n = strlen(str);
	for (int i = n - 2; i; i -= 2) {
		if (strncmp(str, str + i / 2, i / 2) == 0) {
			printf("%d\n", i);
			return 0;
		}
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: redeclaration of 'int n'
   16 |         int n = strlen(str);
      |             ^
a.cc:13:17: note: 'int n' previously declared here
   13 |         int ans,n, m;
      |                 ^
a.cc:16:17: error: 'strlen' was not declared in this scope
   16 |         int n = strlen(str);
      |                 ^~~~~~
a.cc:8:1: note: 'strlen' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    7 | #include <map>
  +++ |+#include <cstring>
    8 | #include <string>
a.cc:18:21: error: 'strncmp' was not declared in this scope
   18 |                 if (strncmp(str, str + i / 2, i / 2) == 0) {
      |                     ^~~~~~~
a.cc:18:21: note: 'strncmp' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'