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

#include<queue>
#include<stack>
#include<map>
#include<set>
#include<cstdio>
#include<vector>
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
bool tr[100005][100005]={0};
int n,a,b;
int stepfen[100005]={0},stepsnu[100005]={0};
bool spot[1000005]={0};
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a>>b;
		tr[a][b]=1;
		tr[b][a]=1;
	}
	stepfen[1]=0;
	queue<int> q;
	q.push(1);
	int stepsfen=0;
	while(!q.empty()){
		int dot=q.front();
		q.pop();
		for(int i=1;i<=dot;i++){
			if(tr[dot][i]==1){
				if(stepfen[i]==0){
					stepfen[i]=stepfen[dot]+1;
					q.push(i);
					if(i==n){
						stepsfen=stepfen[i];
					}
				}
			}
		}
	}
	stepsnu[n]=0;
	q.push(n);
	int stepssnu=0;
	while(!q.empty()){
		int dot=q.front();
		q.pop();
		for(int i=1;i<=dot;i++){
			if(tr[dot][i]==1){
				if(stepsnu[i]==0){
					stepsnu[i]=stepsnu[dot]+1;
					q.push(i);
					if(i==n){
						stepssnu=stepsnu[i];
					}
				}
			}
		}
	}
	queue<int> q2;
	q2.push(n);
	while(!q2.empty()){
		int dot=q2.front();
		spot[dot]=1;
		q2.pop();
		for(int i=1;i<=dot;i++){
			if(tr[dot][i]==1){
				if(stepfen[i]==stepfen[dot]-1){
					q2.push(i);
				}
			}
		}
	}
	int fen=0,snu=0;
	for(int i=1;i<=n;i++){
		if(spot[i]){
			if(stepfen[i]<=stepsnu[i]){
				fen++;
			}else{
				snu++;
			}
		}else{
			if(stepfen[i]>=stepsnu[i]){
				fen++;
			}else{
				snu++;
			}
		}
	}
	if(fen>snu){
		cout<<"Fennec";
	}else{
		cout<<"Snuke";
	}
	return 0;
}

Compiler output:
/tmp/ccKOfnNr.o: in function `main':
a.cc:(.text+0xf): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccKOfnNr.o
a.cc:(.text+0x34): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccKOfnNr.o
a.cc:(.text+0x50): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccKOfnNr.o
a.cc:(.text+0x61): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccKOfnNr.o
a.cc:(.text+0x67): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccKOfnNr.o
a.cc:(.text+0x89): relocation truncated to fit: R_X86_64_PC32 against symbol `b' defined in .bss section in /tmp/ccKOfnNr.o
a.cc:(.text+0x8f): relocation truncated to fit: R_X86_64_PC32 against symbol `a' defined in .bss section in /tmp/ccKOfnNr.o
a.cc:(.text+0xb5): relocation truncated to fit: R_X86_64_PC32 against symbol `n' defined in .bss section in /tmp/ccKOfnNr.o
a.cc:(.text+0xc4): relocation truncated to fit: R_X86_64_PC32 against symbol `stepfen' defined in .bss section in /tmp/ccKOfnNr.o
a.cc:(.text+0x17a): relocation truncated to fit: R_X86_64_PC32 against symbol `stepfen' defined in .bss section in /tmp/ccKOfnNr.o
a.cc:(.text+0x195): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<string>
#include<queue>
#include<set>
#include<map>
#include<vector>
#include<algorithm>
#include<memory>
using namespace std;
vector<int> con[100001];
int N;
int a[2][100001];
queue<int> q[2];
int main()
{
  cin>>N;
  for (int i=0;i<N-1;i++)
  {
    int x,y;
    cin>>x>>y;
    con[x].push_back(y);
    con[y].push_back(x);
  }
  memset(a,-1,sizeof(a));
  q[0].push(1);
  a[0][1]=0;
  q[1].push(N);
  a[1][N]=0;
  for (int i=0;i<2;i++)
  {
    while (q[i].size())
    {
      int c=q[i].front();
      q[i].pop();
      for (int i=0;i<con[c].size();i++)
      {
        if (a[i][con[c][i]]==-1)
          a[i][con[c][i]]=a[i][c]+1,q[i].push(con[c][i]);
      }
    }
  }
  int k=0;
  for (int i=1;i<=N;i++)
  {
    if (a[0][i]>=a[1][i]) k++;
  }
  if (k>N-k) cout<<"Fennec\n";
  else cout<<"Snuke\n";
  //system("pause");
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:24:3: error: 'memset' was not declared in this scope
   24 |   memset(a,-1,sizeof(a));
      |   ^~~~~~
a.cc:9:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    8 | #include<memory>
  +++ |+#include <cstring>
    9 | using namespace std;
Language: C++

#include<iostream>
#include<vector>
#include<queue> 
using namespace std;
vector<int> sons[100001];
queue<int> q; 
int da[100001],db[100001];
bool v[100001];
int main(){
int n,a,b,x,u;
cin >> n;
for(int i=1;i<=n-1;i++){
cin >> a >> b;
sons[a].push_back(b);
sons[b].push_back(a);
}
a=1;
b=n;
memset(v,0,sizeof(v));
for(int i=1;i<=n;i++) da[i]=1e9;
da[a]=0; v[a]=1; q.push(a);
while(!q.empty()){
x=q.front();
for(int i=0;i<sons[x].size();i++){
u=sons[x][i];
if(!v[u]){
da[u]=da[x]+1;
v[u]=1;
q.push(u);
}}
q.pop();
}
memset(v, 0, sizeof(v));
for(int i=1;i<=n;i++) db[i]=1e9;
db[b]=0; v[b]=1; q.push(b);
while(!q.empty()){
x=q.front();
for(int i=0;i<sons[x].size();i++){
u=sons[x][i];
if(!v[u]){
db[u]=db[x]+1;
v[u]=1;
q.push(u);
}}
q.pop();
}
int snuke=0, fennec=0;
for(int i=1;i<=n;i++){
if(da[i]>db[i]) snuke++;
else if(da[i]<=db[i]) fennec++;
}
if(snuke>=fennec) cout << "Snuke" << endl;
else cout << "Fennec" << endl;
//system("pause");
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:1: error: 'memset' was not declared in this scope
   19 | memset(v,0,sizeof(v));
      | ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<queue>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

#include<iostream>
#include<vector>
#include<queue> 
using namespace std;
vector<int> sons[100001];
queue<int> q; 
int da[100001],db[100001];
bool v[100001];
int main(){
int n,a,b,x,u;
cin >> n;
for(int i=1;i<=n-1;i++){
cin >> a >> b;
sons[a].push_back(b);
sons[b].push_back(a);
}
a=1;
b=n;
memset(v,0,sizeof(v));
for(int i=1;i<=n;i++) da[i]=1e9;
da[a]=0; v[a]=1; q.push(a);
while(!q.empty()){
x=q.front();
for(int i=0;i<sons[x].size();i++){
u=sons[x][i];
if(!v[u]){
da[u]=da[x]+1;
v[u]=1;
q.push(u);
}}
q.pop();
}
memset(v, 0, sizeof(v));
for(int i=1;i<=n;i++) db[i]=1e9;
db[b]=0; v[b]=1; q.push(b);
while(!q.empty()){
x=q.front();
for(int i=0;i<sons[x].size();i++){
u=sons[x][i];
if(!v[u]){
db[u]=db[x]+1;
v[u]=1;
q.push(u);
}}
q.pop();
}
int snuke=0, fennec=0;
for(int i=1;i<=n;i++){
if(da[i]>db[i]) snuke++;
else if(da[i]<=db[i]) fennec++;
}
if(snuke>=fennec) cout << "Snuke" << endl;
else cout << "Fennec" << endl;
system("pause");
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:19:1: error: 'memset' was not declared in this scope
   19 | memset(v,0,sizeof(v));
      | ^~~~~~
a.cc:4:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    3 | #include<queue>
  +++ |+#include <cstring>
    4 | using namespace std;
Language: C++

using System;

namespace agc019_b
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            long ret = (long)s.Length * (s.Length - 1);
            for (int i = 0; i < s.Length; i++)
            {
                for (int j = 0; j < s.Length; j++) if (s[i] == s[j]) ret--;
            }
            Console.WriteLine(ret + 1);
        }
    }
}

Compiler output:
a.cc:1:7: error: expected nested-name-specifier before 'System'
    1 | using System;
      |       ^~~~~~
a.cc:7:26: error: 'string' has not been declared
    7 |         static void Main(string[] args)
      |                          ^~~~~~
a.cc:7:35: error: expected ',' or '...' before 'args'
    7 |         static void Main(string[] args)
      |                                   ^~~~
a.cc:17:6: error: expected ';' after class definition
   17 |     }
      |      ^
      |      ;
a.cc: In static member function 'static void agc019_b::Program::Main(int*)':
a.cc:9:13: error: 'string' was not declared in this scope
    9 |             string s = Console.ReadLine();
      |             ^~~~~~
a.cc:10:30: error: 's' was not declared in this scope
   10 |             long ret = (long)s.Length * (s.Length - 1);
      |                              ^
a.cc:15:13: error: 'Console' was not declared in this scope
   15 |             Console.WriteLine(ret + 1);
      |             ^~~~~~~
Language: C++

#include <iostream>
#include <ostream>
#include <istream>
#include <cmath>
#include <string>
#include <vector>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <vector>
#include <set>
#define pb push_back
#define ppb pop_back
using namespace std;
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define for1(i, n) for (int i = 1; i <= int(n); i++)
#define forv(i, v) forn(i, v.size())
#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair
#define CIN_FILE "input.txt"
#define COUT_FILE "output.txt"
#define pi 3.1415926535897932
#define NMAX 100005
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
const int Mod=1e9+7;
const int INF=INT_MAX/2;
vector<int> bfs(int N,vector<vector<int> >& G,int s) {
	vector<int> d(N,INF);
	d[s]=0;
	queue<int> q;
	q.push(s);
	while(q.size()) {
		int u=q.front();
		q.pop();
		for(int v;v<G[u].size();v++) {
			if(d[v]>d[u]+1) {
				d[v]=d[u]+1;
				q.push(v);
			}
		}
	}
	return d;
}
int main() {
	int n;
	cin>>n;
	vector<vector<int> >G(n);
	forn(i,n-1) {
		int u,v;
		scanf("%d%d",&u,&v);
		u--;
		v--;
		G[u].push_back(v),G[v].push_back(u);
	}
	vector<int>d1=bfs(n,G,0);
	vector<int>d2=bfs(n,G,n-1);
	int n1=0,n2=0;
	forn(u,n)if(d1[u]<=d2[u])n1++;
	else n2++;
	cout<<(n1>n2?"Snuke":"Fennec")<<endl;
	return 0;
}

Compiler output:
a.cc:35:15: error: 'INT_MAX' was not declared in this scope
   35 | const int INF=INT_MAX/2;
      |               ^~~~~~~
a.cc:18:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   17 | #include <set>
  +++ |+#include <climits>
   18 | #define pb push_back
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int Mod=1e9+7;
const int INF=INT_MAX/2;
vector<int> bfs(int N,vector<vector<int>>& G,int s) {
	vector<int> d(N,INF);
	d[s]=0;
	queue<int> q;
	q.push(s);
	while(q.size()) {
		int u=q.front();
		q.pop();
		for(int v:G[u]) {
			if(d[v]>d[u]+1) {
				d[v]=d[u]+1;
				q.push(v);
			}
		}
	}
	return d;
}
int main() {
	int n;
	cin>>n;
	vector<vector<int>>G(n);
	forn(i,n-1) {
		int u,v;
		scanf("%d%d",&u,&v);
		u--;
		v--;
		G[u].push_back(v),G[v].push_back(u);
	}
	vector<int>d1=bfs(n,G,0);
	vector<int>d2=bfs(n,G,n-1);
	int n1=0,n2=0;
	forn(u,n)if(d1[u]<=d2[u])n1++;
	else n2++;
	cout<<(n1>n2?"Fennec":"Snuke")<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:26:14: error: 'i' was not declared in this scope
   26 |         forn(i,n-1) {
      |              ^
a.cc:26:9: error: 'forn' was not declared in this scope; did you mean 'fork'?
   26 |         forn(i,n-1) {
      |         ^~~~
      |         fork
a.cc:36:14: error: 'u' was not declared in this scope
   36 |         forn(u,n)if(d1[u]<=d2[u])n1++;
      |              ^
a.cc:37:9: error: 'else' without a previous 'if'
   37 |         else n2++;
      |         ^~~~
Language: C++

#include <iostream>
#include <ostream>
#include <istream>
#include <cmath>
#include <string>
#include <vector>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <vector>
#include <set>
#define pb push_back
#define ppb pop_back
using namespace std;
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define for1(i, n) for (int i = 1; i <= int(n); i++)
#define forv(i, v) forn(i, v.size())
#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair
#define CIN_FILE "input.txt"
#define COUT_FILE "output.txt"
#define pi 3.1415926535897932
#define NMAX 100005
typedef pair<int, int> pii;
typedef long long ll;
typedef long double ld;
const int Mod=1e9+7;
const int INF=INT_MAX/2;
vector<int> bfs(int N,vector<vector<int>>& G,int s) {
	vector<int> d(N,INF);
	d[s]=0;
	queue<int> q;
	q.push(s);
	while(q.size()) {
		int u=q.front();
		q.pop();
		for(int v:G[u]) {
			if(d[v]>d[u]+1) {
				d[v]=d[u]+1;
				q.push(v);
			}
		}
	}
	return d;
}
int main() {
	int n;
	cin>>n;
	vector<vector<int>>G(n);
	forn(i,n-1) {
		int u,v;
		cin>>u>>v;
		u--;
		v--;
		G[u].push_back(v),G[v].push_back(u);
	}
	vector<int>d1=bfs(n,G,0);
	vector<int>d2=bfs(n,G,n-1);
	int n1=0,n2=0;
	forn(u,n)if(d1[u]<=d2[u])n1++;
	else n2++;
	cout<<(n1>n2?"Fennec":"Snuke")<<endl;
	return 0;
}



Compiler output:
a.cc:35:15: error: 'INT_MAX' was not declared in this scope
   35 | const int INF=INT_MAX/2;
      |               ^~~~~~~
a.cc:18:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   17 | #include <set>
  +++ |+#include <climits>
   18 | #define pb push_back
Language: C++

#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <queue>
#include <list>
#include <cstdlib>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
#include <cstring>
#include <cmath>
//#include<bits/stdc++.h>
using namespace std;

const int INF=0x3f3f3f3f;
const int SIZE=100005;

vector<int> mp[SIZE];
int color[SIZE],dist[SIZE],dist2[SIZE];

void bfs(int s,int dist[]){
	queue<int> que;
	que.push(s);
	while(!que.empty()){
		int u=que.front();
		que.pop();
		for(int i=0;i<mp[u].size();i++){
			int t=mp[u][i];
			if(dist[t] || t==s) continue;
			dist[t]=dist[u]+1;
			que.push(t);
		}
	}
}

int main(){
	int n;
	scanf("%d",&n);
	for(int i=0,a,b;i<n-1;i++){
		scanf("%d%d",&a,&b)
		a--;
		b--;
		mp[a].push_back(b);
		mp[b].push_back(a);
	}
	bfs(0,dist);
	bfs(n-1,dist2);
	int s=0,f=0;
	for(int i=0;i<n;i++){
		if(dist[i]<=dist2[i]) f++; else s++;
	}
	if(s>=f){
		puts("Snuke");
	}
	else{
		puts("Fennec");
	}
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:36: error: expected ';' before 'a'
   42 |                 scanf("%d%d",&a,&b)
      |                                    ^
      |                                    ;
   43 |                 a--;
      |                 ~
Language: C++

#include <assert.h>
#include <ctype.h>
#include <errno.h>
#include <error.h>
#include <float.h>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <locale>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <wchar.h>
#include <wctype.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <functional>
#include <map>
#include <ios>
#include <iosfwd>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
#include <complex.h>
#include <fenv.h>
#include <inttypes.h>
#include <stdbool.h>
#include <stdint.h>
#include <tgmath.h>
#include <tuple>
#include <conio.h>
#include <numeric>
#include <list>
#include <windows.h>
#include <cfloat>
#include <climits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
const int INF=1000000007;
vector<int> g[100005];
int dist1[100005],dist2[100005];
int main()
{
	int n;
	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);
	}
	for(int i=0;i<n;i++)
		dist1[i]=INF,dist2[i]=INF;
	queue<int> q;
	q.push(0);
	dist1[0]=0;
	while(!q.empty())
	{
		int f=q.front();
		q.pop();
		for(int i=0;i<g[f].size();i++)
		{
			int s=g[f][i];
			if(dist1[s]==INF)
			{
				dist1[s]=dist1[f]+1;
				q.push(s);
			}
		}
	}
	q.push(n-1);
	dist2[n-1]=0;
	while(!q.empty())
	{
		int f=q.front();
		q.pop();
		for(int i=0;i<g[f].size();i++)
		{
			int s=g[f][i];
			if(dist2[s]==INF)
			{
				dist2[s]=dist2[f]+1;
				q.push(s);
			}
		}
	}
	int s1=0,s2=0;
	for(int i=0;i<n;i++)
		if(dist1[i]<=dist2[i])
			s1++;
		else
			s2++;
	if(s1>s2)
		cout<<"Fennec"<<endl;
	else
		cout<<"Snuke"<<endl;
	return 0;
}

Compiler output:
a.cc:55:10: fatal error: conio.h: No such file or directory
   55 | #include <conio.h>
      |          ^~~~~~~~~
compilation terminated.
Language: C++

#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}
#define N 100010
bool used[N];
vector<int> g[N];
ll d[N];
void dfs(int u){
	if(used[u]) return;
	used[u] = true;
	for(auto v: g[u]) dfs(v);
}

int main(){
	int n;
	cin>>n;
	rep(i, n){
		int a, b;
		cin>>a>>b;
		a--; b--;
		g[a].pb(b);
		g[b].pb(a);
	}
	dfs(a);
	cout<<(d[b]%2?"Snuke":"Fennec")<<endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:60:13: error: 'a' was not declared in this scope
   60 |         dfs(a);
      |             ^
a.cc:61:18: error: 'b' was not declared in this scope
   61 |         cout<<(d[b]%2?"Snuke":"Fennec")<<endl;
      |                  ^
Language: C++

#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <ctime>
#include <map>
#include <stack>
#include <sstream>
#include <set>
#include <cmath>
#include <functional>
#include <numeric>

using namespace std;

int n;
int color[100001];
vector <int> adj[100001];
int depth[2][100001];
const int INF = 210000000;
void bfs()
{

	queue <int> que;

	memset(depth, INF, sizeof(depth));
	//first fennce
	que.push(1);
	depth[0][1] = 0;

	while (!que.empty())
	{
		int a = que.front();
		que.pop();

		for (int i = 0; i < adj[a].size(); i++)
		{
			if (depth[0][adj[a][i]] == INF)
			{
				depth[0][adj[a][i]] = depth[0][a] + 1;
				que.push(adj[a][i]);
			}
		}
	}

	//second
	que.push(n);
	depth[1][n] = 0;

	while (!que.empty())
	{
		int a = que.front();
		que.pop();

		for (int i = 0; i < adj[a].size(); i++)
		{
			if (depth[1][adj[a][i]] == INF)
			{
				depth[1][adj[a][i]] = depth[1][a] + 1;
				que.push(adj[a][i]);
			}
		}
	}
}
int main()
{
	int a, b;
	int f = 0, s = 0;
	cin >> n;

	for (int i = 0; i < n - 1; i++)
	{
		cin >> a >> b;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}

	bfs();

	for (int i = 1; i <= n; i++)
	{
		if (depth[0][i] <= depth[1][i])
		{
			f++;
		}
		else
		{
			s++;
		}
	}

	if (f > s)
	{
		cout << "Fennec" << endl;
	}
	else
	{
		cout << "Snuke" << endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'void bfs()':
a.cc:27:9: error: 'memset' was not declared in this scope
   27 |         memset(depth, INF, sizeof(depth));
      |         ^~~~~~
a.cc:14:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
   13 | #include <numeric>
  +++ |+#include <cstring>
   14 |
Language: C++

#include<iostream>
#include<vector>
#include<queue>

using namespace std;

#define REP(i, n) for(int i=0; i<n; i++)
typedef pair<int, int> pii;

const int max_n = 10e5;
int INF = 10e8;

struct edge{
    int to, cost;
};

int d[max_n];
int n;
vector<edge> g[max_n];
vector<int> spath;

int pre[max_n];

void dijkstra(int s){
    priority_queue<pii, vector<pii>, greater<pii> > que;
    fill(d, d+n, INF);
    fill(pre, pre+n, -1);
    d[s] = 0;
    que.push(pii(0, s));

    while(!que.empty()){
        pii p = que.top();
        que.pop();
        int v = p.second;

        if(d[v]<p.first) continue;
        REP(i, g[v].size()){
            edge e = g[v][i];
            if(d[e.to] > d[v]+e.cost){
                d[e.to] = d[v]+e.cost;
                que.push(pii(d[e.to], e.to));
                pre[e.to] = v;
            }
        }
    }
}

vector<int> get_path(int t){
    vector<int> path;
    while(t!=-1){
        path.push_back(t);
        t = pre[t];
    }
    reverse(path.begin(), path.end());
    return path;
}

int node_size(int v){
    int sum = 0;
    bool used[max_n];
    REP(i, n) used[i] = false;
    REP(i, spath.size()){
        used[spath[i]] = true;
    }

    queue<int> que;
    que.push(v);
    while(!que.empty()){
        int p = que.front();
        que.pop();
        REP(i, g[p].size()){
            edge e = g[p][i];
            if(!used[e.to]){
                sum += 1;
                que.push(e.to);
                used[e.to] = true;
            }
        }
    }
    return sum;
}

int main(){
    cin >> n;

    REP(i, n) g[i].clear();
    REP(i, n-1){
        int a, b;
        cin >> a >> b;
        a = a-1;
        b = b-1;
        edge e;
        e.to = b;
        e.cost = 1;
        g[a].push_back(e);
        e.to = a;
        g[b].push_back(e);
    }
    
    dijkstra(0);
    spath = get_path(n-1);

    int fe = 0;
    int su = 0;
    int meet;
    vector<int> medge;
    if(spath.size()%2==0){
        meet = spath.size()/2;
    } else {
        meet = spath.size()/2 + 1;
    }

    fe += meet;
    su = spath.size() - meet;
    REP(i, spath.size()){
        if(i<meet){
            fe += node_size(spath[i]);
        } else {
            su += node_size(spath[i]);
        }
    }

    if(fe>su){
        cout << "Fennec" << endl;
    } else {
        cout << "Snuke" << endl;
    }
}


Compiler output:
a.cc: In function 'std::vector<int> get_path(int)':
a.cc:54:5: error: 'reverse' was not declared in this scope
   54 |     reverse(path.begin(), path.end());
      |     ^~~~~~~
Language: C++

#include<bits/stdc++.h>

using namespace std;

typedef pair <int, int> pii;

int N;
vector <pii> ab;
int res;
bool flag[100100]={0};
int F=0, S=0, SF=0;
int graph[100100]={0};

void rec(int n, int m, int gl){
        if(gl==n){
                return;
        }
        flag[n]=true;
        graph[n]+=m;
        for(int i=0;i<N;i++){
                if(!flag[ab[i].second]&&ab[i].first==n){
                        rec(ab[i].second, m, gl);
                }
                else if(!flag[ab[i].first]&&ab[i].second==n){
                        rec(ab[i].first, m, gl);
                }
        }
}

int main(){
        cin>>N;
        for(int i=0;i<N-1;i++){
                int aa, bb;
                cin>>aa>>bb;
                if(aa<bb){
                        ab.push_back(make_pair(aa, bb));
                }
                else{
                        ab.push_back(make_pair(bb, aa));
                }
        }
        rec(1, 1, N);
        for(int i=0;i<=N;i++){
                flag[i]=false;
        }
        rec(N, 2, 1);
        for(int i=2;i<=N-1;i++){
                //cout<<graph[i]<<" ";
                if(graph[i]==1){
                        F++;
                }
                else if(graph[i]==2){
                        S++;
                }
                else if(graph[i]==3){
                        SF++;
                }
        }
        //cout<<endl;
        //cout<<S<<":"<<F<<":"<<SF<<endl;
        if(SF%2!=0){
                F++;
        }
        if(F>=S){
                cout<<"Fennec"<<endl;
        }
        else{
                cout<<"Snuke"<<endl;
        }
        return 0;


Compiler output:
a.cc: In function 'int main()':
a.cc:70:18: error: expected '}' at end of input
   70 |         return 0;
      |                  ^
a.cc:30:11: note: to match this '{'
   30 | int main(){
      |           ^
Language: C++

#include <iostream>
#include <cstdio>
#include <vector>
#include <stack>
#include <cstdlib>
using namespace std;

typedef long long ll;

const int MAXN = (int)1e5+10;
struct edge {
    int to, next;
}ed[MAXN << 1];

int head[MAXN], cnt;
void addedge(int u, int v) {
    ed[cnt].to = v;
    ed[cnt].next = head[u];
    head[u] = cnt++;
}

int sz[MAXN], fa[MAXN], dep[MAXN];
void dfs(int u, int pre) {
    sz[u] = 1;
    dep[u] = dep[pre] + 1;
    fa[u] = pre;
    for ( int i = head[u]; i != -1; i = ed[i].next ) {
        int v = ed[i].to;
        if ( v != pre ) {
            dfs(v, u);
            sz[u] += sz[v];
        }
    }
}

int main() {
    memset(head, -1, sizeof(head));
    int n;
    cin >> n;
    for ( int i = 1; i < n; i++ ) {
        int u, v;
        cin >> u >> v;
        addedge(u, v);
        addedge(v, u);
    }
    dfs(1, 0);
    int d = (dep[n] - 2) / 2;
    int ans = n;
    while ( d ) {
        d--;
        ans = fa[ans];
    }
    if ( sz[ans] * 2 >= n ) cout << "Snuke" << endl;
    else cout << "Fennec" << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:37:5: error: 'memset' was not declared in this scope
   37 |     memset(head, -1, sizeof(head));
      |     ^~~~~~
a.cc:6:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    5 | #include <cstdlib>
  +++ |+#include <cstring>
    6 | using namespace std;
Language: C++

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

typedef long long ll;

const int MAXN = (int)1e5+10;
struct edge {
    int to, next;
}ed[MAXN << 1];

int head[MAXN], cnt;
void addedge(int u, int v) {
    ed[cnt].to = v;
    ed[cnt].next = head[u];
    head[u] = cnt++;
}

int sz[MAXN], fa[MAXN], dep[MAXN];
void dfs(int u, int pre) {
    sz[u] = 1;
    dep[u] = dep[pre] + 1;
    fa[u] = pre;
    for ( int i = head[u]; i != -1; i = ed[i].next ) {
        int v = ed[i].to;
        if ( v != pre ) {
            dfs(v, u);
            sz[u] += sz[v];
        }
    }
}

int main() {
    memset(head, -1, sizeof(head));
    int n;
    cin >> n;
    for ( int i = 1; i < n; i++ ) {
        int u, v;
        cin >> u >> v;
        addedge(u, v);
        addedge(v, u);
    }
    dfs(1, 0);
    int d = (dep[n] - 2) / 2;
    int ans = n;
    while ( d ) {
        d--;
        ans = fa[ans];
    }
    if ( sz[ans] * 2 >= n ) cout << "Snuke" << endl;
    else cout << "Fennec" << endl;
    
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:5: error: 'memset' was not declared in this scope
   36 |     memset(head, -1, sizeof(head));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <stack>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: Java

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        Map<Integer, Set<Integer>> graph = new HashMap<>(n);
        for (int i = 1; i <= n; i++) {
            graph.put(i, new HashSet<>());
        }

        for (int r = 0; r < n - 1; r++) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            graph.get(a).add(b);
            graph.get(b).add(a);
        }

        boolean[] claimedCache = new boolean[n + 1];
        Deque<List<Integer>> queue = new Deque<>();
        queue.addLast(Arrays.asList(1, 1));
        claimedCache[1] = true;
        queue.addLast(Arrays.asList(n, -1));
        claimedCache[n] = true;
        int fennecCount = 1;
        int snukeCount = 1;

        while (!queue.isEmpty()) {
            List<Integer> data = queue.removeFirst();
            int nodeId = data.get(0);
            int colorId = data.get(1);
            for (Integer neighbor : graph.get(nodeId)) {
                if (!claimedCache[neighbor]) {
                    claimedCache[neighbor] = true;
                    if (colorId == 1) {
                        fennecCount++;
                    }
                    else {
                        snukeCount++;
                    }
                    queue.addLast(Arrays.asList(neighbor, colorId));
                }
            }
        }

        System.out.println((fennecCount > snukeCount) ? "Fennec" : "Snuke");
    }
}


Compiler output:
Main.java:21: error: Deque is abstract; cannot be instantiated
        Deque<List<Integer>> queue = new Deque<>();
                                     ^
1 error
Language: C++

#include <iostream>
#include <vector>
#include <cstring>
using namespace std;
typedef long long ll;
int n, m;
vector<int> graph[100001];
int fennec, snuke;
bool visited[100001];
void dfsSnuke(int node, int prev){
    if(node == 0)return;
    visited[node] = true;
    snuke ++;
    for(int i =0 ; i < graph[node].size(); i ++){
        int sosed = graph[node][i];
        if(sosed == prev)continue;
        dfsSnuke(sosed, node);
    }
}
void dfsFennec(int node, int prev){
    if(visited[node] && node != 0)return;
    fennec ++;
    for(int i =0; i < graph[node].size(); i ++){
        int sosed = graph[node][i];
        if(sosed == prev)continue;
        dfsFennec(sosed, node);
    }
}
int main(int argc, const char * argv[]) {
    ios_base::sync_with_stdio(false);
    cin >> n;
    int a, b;
    for(int i =0 ; i < n - 1; i ++){
        cin >> a >> b;
        a --;
        b --;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }
    fennec = snuke = 0;
    memset(visited, false, sizeof visited);
    dfsSnuke(n - 1, -1);
    dfsFennec(0, -1);
    fennec --;
    snuke --;
//    cout << fennec << " " << snuke << endl;
    if(fenec == snuke){
        if(fennec % 2 == 1)puts("Fennec");
        else puts("Snuke") ;
        return 0;
    }
    if(fennec < snuke)puts("Snuke");
    else puts("Fennec");
    return 0;
}


Compiler output:
a.cc: In function 'int main(int, const char**)':
a.cc:47:8: error: 'fenec' was not declared in this scope; did you mean 'fennec'?
   47 |     if(fenec == snuke){
      |        ^~~~~
      |        fennec
Language: C++

int d[2][100000];
vector <int> v[100000];
 
void dfs(int x, int y, int z, int w) {
    int i;
    
    d[w][x] = z;
    
    for (i = 0; i < v[x].size(); i++) {
        if (v[x][i] == y) continue;
        
        dfs(v[x][i], x, z + 1, w);
    }
}
 
int main() {
    int n, c1 = 0, c2 = 0, i;
    
    scanf("%d", &n);
    
    for (i = 0; i < n - 1; i++) {
        int x, y;
        
        scanf("%d %d", &x, &y);
        
        x--;
        y--;
        
        v[x].push_back(y);
        v[y].push_back(x);
    }
    
    dfs(0, -1, 0, 0);
    dfs(n - 1, -1, 0, 1);
    
    for (i = 0; i < n; i++) {
        if (d[0][i] <= d[1][i]) {
            c1++;
        } else {
            c2++;
        }
    }
    
    if (c1 > c2) {
        puts("Fennec");
    } else {
        puts("Snuke");
    }
    
    return 0;
}

Compiler output:
a.cc:2:1: error: 'vector' does not name a type
    2 | vector <int> v[100000];
      | ^~~~~~
a.cc: In function 'void dfs(int, int, int, int)':
a.cc:9:21: error: 'v' was not declared in this scope
    9 |     for (i = 0; i < v[x].size(); i++) {
      |                     ^
a.cc: In function 'int main()':
a.cc:19:5: error: 'scanf' was not declared in this scope
   19 |     scanf("%d", &n);
      |     ^~~~~
a.cc:29:9: error: 'v' was not declared in this scope
   29 |         v[x].push_back(y);
      |         ^
a.cc:45:9: error: 'puts' was not declared in this scope
   45 |         puts("Fennec");
      |         ^~~~
a.cc:47:9: error: 'puts' was not declared in this scope
   47 |         puts("Snuke");
      |         ^~~~
Language: C++

#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
using namespace std;

int N;
vector<int> *g;
vector<int> bfn(int spoit); 
int main(){

  cin >> N;
  g = new vector<int>[N+1];
  int a, b;
  for(int i=1; i<N; i++){
    cin >> a >> b;
    g[a].push_back(b);
    g[b].push_back(a);
  }

  vector<int> dist1 = bfn(1);
  vector<int> dist2 = bfn(N);

  int l=0; int r=0;
  for(int i=1; i<=N; i++){
    if(dist1[i]<=dist2[i]) l++;
    else r++;
  }
  if(l>r) cout << "Fennec" << endl;
  else  cout << "Snuke" << endl;
}

vector<int> bfn(int spoit){
  vector<int> dist(N+1,-1);
  queue<int> q;
  dist[spoint] = 0;
  q.push(spoint);
  while(!q.empty()){
    int u = q.front();
    q.pop();
    for(auto i: g[u]){
      if(dist[i]==-1){
	dist[i] = dist[u] + 1;
	q.push(i);
      }
    }
  }    
  return dist;
}


Compiler output:
a.cc: In function 'std::vector<int> bfn(int)':
a.cc:46:8: error: 'spoint' was not declared in this scope; did you mean 'spoit'?
   46 |   dist[spoint] = 0;
      |        ^~~~~~
      |        spoit
Language: C++


    
}

int main(void) {
    
    int n;
    vector<vector<int>> v;
    
    cin >> n;
    
    for (int i = 0; i < n; ++i) {
        
        int a, b;
        
        cin >> a >> b;
        
        v[a - 1].push_back(b - 1);
        v[b - 1].push_back(a - 1);
        
        
    }
    
    
    if (isFirst(n, v)) {
        
        cout << "Fennec";
        
    }
    else {
        
        cout << "Sunuke";
        
    }
    
    return 0;
    
}






















Compiler output:
a.cc:3:1: error: expected declaration before '}' token
    3 | }
      | ^
a.cc: In function 'int main()':
a.cc:8:5: error: 'vector' was not declared in this scope
    8 |     vector<vector<int>> v;
      |     ^~~~~~
a.cc:8:19: error: expected primary-expression before 'int'
    8 |     vector<vector<int>> v;
      |                   ^~~
a.cc:10:5: error: 'cin' was not declared in this scope
   10 |     cin >> n;
      |     ^~~
a.cc:18:9: error: 'v' was not declared in this scope
   18 |         v[a - 1].push_back(b - 1);
      |         ^
a.cc:25:20: error: 'v' was not declared in this scope
   25 |     if (isFirst(n, v)) {
      |                    ^
a.cc:25:9: error: 'isFirst' was not declared in this scope
   25 |     if (isFirst(n, v)) {
      |         ^~~~~~~
a.cc:27:9: error: 'cout' was not declared in this scope
   27 |         cout << "Fennec";
      |         ^~~~
a.cc:32:9: error: 'cout' was not declared in this scope
   32 |         cout << "Sunuke";
      |         ^~~~
Language: C++

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

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

  vector<vector<int>> nvec;
  int check[100000];
  for (int i = 0; i < N; i++) {
    vector<int> temp;
    nvec.push_back(temp);
    check[i] = 0;
  }
  check[0] = check[N-1] = 1;

  for (int i = 0; i < N-1; i++) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    nvec.at(a).push_back(b);
    nvec.at(b).push_back(a);
  }

  set<int> vB, vW;
  vB.insert(0);
  vW.insert(N-1);
  int cB, cW;
  cB = cW = 1;
  while(1) {
    /*
    cout << "vB: ";
    for (auto x: vB) cout << x << " ";
    cout << endl;
    cout << "vW: ";
    for (auto x: vW) cout << x << " ";
    cout << endl;
    cout << "----" << endl;*/

    int tempB, tempW;
    tempB = tempW = 0;
    vector<int> delB, delW;
    
    for (auto x: vB) {
      bool isfound = false;
      for (auto y: nvec.at(x)) {
	if (check[y] == 0) {
	  isfound = true;
	  vB.push_back(y);
	  check[y] = 1;
	  tempB++;
	}
      }
      if (!isfound) delB.push_back(x);
    }
    for (auto x: delB) vB.erase(x);

    for (auto x: vW) {
      bool isfound = false;
      for (auto y: nvec.at(x)) {
	if (check[y] == 0) {
	  isfound = true;
	  vW.push_back(y);
	  check[y] = 1;
	  tempW++;
	}
      }
      if (!isfound) delW.push_back(x);
    }
    for (auto x: delW) vW.erase(x);
    
    if (tempB == 0 && tempW == 0) break;
    else {
      cB += tempB;
      cW += tempW;
    }
  }

  if (cB <= cW) {
    cout << "Snuke" << endl;
  } else {
    cout << "Fennec" << endl;
  }

  free(check);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:51:14: error: 'class std::set<int>' has no member named 'push_back'
   51 |           vB.push_back(y);
      |              ^~~~~~~~~
a.cc:65:14: error: 'class std::set<int>' has no member named 'push_back'
   65 |           vW.push_back(y);
      |              ^~~~~~~~~
Language: C++

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

//color
#define NOCOLOR 0
#define BLACK 1 //Fennec
#define WHITE 2 //Snuke
#define N 30000

using namespace std;
static const int INFTY = 1000;

int n, M[N][N];
int color[N];

void bfs(int s1, int s2, int turn){
    queue<int> q1;
    queue<int> q2;
    q1.push(s1); //init state(fennec)
    q2.push(s2); //init state(snuke)
    for(int i = 0; i < n; i++) color[i]=NOCOLOR;
    color[0]=BLACK;
    color[n-1]=WHITE;
    int u1,u2;
    while(!q1.empty() && !q2.empty()){
        if(turn==0){
            // cout<<"Fennec's Turn"<<endl;
            u1=q1.front(); q1.pop();
            for(int v = 0; v < n; v++){
                if(M[u1][v]==0) continue;
                if(color[v]!=NOCOLOR) continue;
                color[v] = BLACK;
                // cout<<"proceed"<<v<<endl;
                q1.push(v);
            }
            turn=1;//next snuke
        }else{
            // cout<<"Snuke's Turn"<<endl;
            u2=q2.front(); q2.pop();
            for(int v = 0; v < n; v++){
                if(M[u2][v]==0) continue;
                if(color[v]!=NOCOLOR) continue;
                color[v] = WHITE;
                // cout<<"proceed"<<v<<endl;
                q2.push(v);
            }
            turn=0;//next fennec
        }
    }
    if(!q1.empty()){
        cout<<"Fennec"<<endl;
    }else{
        cout<<"Snuke"<<endl;
    }
}

int main(void){
    cin.sync_with_stdio(false);
    int a,b;
    cin>>n;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            M[i][j] = 0;
        }
    }
    for(int i = 0; i < n-1; i++){
        int a,b;
        cin>>a>>b;
        a--; b--;
        M[a][b]=1;
        M[b][a]=1;
    }

    bfs(0,n-1,0);
    return 0;
}

Compiler output:
/tmp/ccFLtrni.o: in function `bfs(int, int, int)':
a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccFLtrni.o
a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccFLtrni.o
a.cc:(.text+0xbb): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccFLtrni.o
a.cc:(.text+0x145): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccFLtrni.o
a.cc:(.text+0x163): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccFLtrni.o
a.cc:(.text+0x22f): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccFLtrni.o
a.cc:(.text+0x24d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccFLtrni.o
collect2: error: ld returned 1 exit status
Language: C++

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

//color
#define NOCOLOR 0
#define BLACK 1 //Fennec
#define WHITE 2 //Snuke
#define N 40000

using namespace std;
static const int INFTY = 1000;

int n, M[N][N];
int color[N];

void bfs(int s1, int s2, int turn){
    queue<int> q1;
    queue<int> q2;
    q1.push(s1); //init state(fennec)
    q2.push(s2); //init state(snuke)
    for(int i = 0; i < n; i++) color[i]=NOCOLOR;
    color[0]=BLACK;
    color[n-1]=WHITE;
    int u1,u2;
    while(!q1.empty() && !q2.empty()){
        if(turn==0){
            // cout<<"Fennec's Turn"<<endl;
            u1=q1.front(); q1.pop();
            for(int v = 0; v < n; v++){
                if(M[u1][v]==0) continue;
                if(color[v]!=NOCOLOR) continue;
                color[v] = BLACK;
                // cout<<"proceed"<<v<<endl;
                q1.push(v);
            }
            turn=1;//next snuke
        }else{
            // cout<<"Snuke's Turn"<<endl;
            u2=q2.front(); q2.pop();
            for(int v = 0; v < n; v++){
                if(M[u2][v]==0) continue;
                if(color[v]!=NOCOLOR) continue;
                color[v] = WHITE;
                // cout<<"proceed"<<v<<endl;
                q2.push(v);
            }
            turn=0;//next fennec
        }
    }
    if(!q1.empty()){
        cout<<"Fennec"<<endl;
    }else{
        cout<<"Snuke"<<endl;
    }
}

int main(void){
    cin.sync_with_stdio(false);
    int a,b;
    cin>>n;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            M[i][j] = 0;
        }
    }
    for(int i = 0; i < n-1; i++){
        int a,b;
        cin>>a>>b;
        a--; b--;
        M[a][b]=1;
        M[b][a]=1;
    }

    bfs(0,n-1,0);
    return 0;
}

Compiler output:
/tmp/cc54CBue.o: in function `bfs(int, int, int)':
a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc54CBue.o
a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc54CBue.o
a.cc:(.text+0xbb): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc54CBue.o
a.cc:(.text+0x145): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc54CBue.o
a.cc:(.text+0x163): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc54CBue.o
a.cc:(.text+0x22f): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc54CBue.o
a.cc:(.text+0x24d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/cc54CBue.o
collect2: error: ld returned 1 exit status
Language: C++

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

//color
#define NOCOLOR 0
#define BLACK 1 //Fennec
#define WHITE 2 //Snuke
#define N 50000

using namespace std;
static const int INFTY = 1000;

int n, M[N][N];
int color[N];

void bfs(int s1, int s2, int turn){
    queue<int> q1;
    queue<int> q2;
    q1.push(s1); //init state(fennec)
    q2.push(s2); //init state(snuke)
    for(int i = 0; i < n; i++) color[i]=NOCOLOR;
    color[0]=BLACK;
    color[n-1]=WHITE;
    int u1,u2;
    while(!q1.empty() && !q2.empty()){
        if(turn==0){
            // cout<<"Fennec's Turn"<<endl;
            u1=q1.front(); q1.pop();
            for(int v = 0; v < n; v++){
                if(M[u1][v]==0) continue;
                if(color[v]!=NOCOLOR) continue;
                color[v] = BLACK;
                // cout<<"proceed"<<v<<endl;
                q1.push(v);
            }
            turn=1;//next snuke
        }else{
            // cout<<"Snuke's Turn"<<endl;
            u2=q2.front(); q2.pop();
            for(int v = 0; v < n; v++){
                if(M[u2][v]==0) continue;
                if(color[v]!=NOCOLOR) continue;
                color[v] = WHITE;
                // cout<<"proceed"<<v<<endl;
                q2.push(v);
            }
            turn=0;//next fennec
        }
    }
    if(!q1.empty()){
        cout<<"Fennec"<<endl;
    }else{
        cout<<"Snuke"<<endl;
    }
}

int main(void){
    cin.sync_with_stdio(false);
    int a,b;
    cin>>n;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            M[i][j] = 0;
        }
    }
    for(int i = 0; i < n-1; i++){
        int a,b;
        cin>>a>>b;
        a--; b--;
        M[a][b]=1;
        M[b][a]=1;
    }

    bfs(0,n-1,0);
    return 0;
}

Compiler output:
/tmp/ccqnUHFE.o: in function `bfs(int, int, int)':
a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccqnUHFE.o
a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccqnUHFE.o
a.cc:(.text+0xbb): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccqnUHFE.o
a.cc:(.text+0x145): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccqnUHFE.o
a.cc:(.text+0x163): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccqnUHFE.o
a.cc:(.text+0x22f): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccqnUHFE.o
a.cc:(.text+0x24d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccqnUHFE.o
collect2: error: ld returned 1 exit status
Language: C++

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

//color
#define NOCOLOR 0
#define BLACK 1 //Fennec
#define WHITE 2 //Snuke
#define N 60000

using namespace std;
static const int INFTY = 1000;

int n, M[N][N];
int color[N];

void bfs(int s1, int s2, int turn){
    queue<int> q1;
    queue<int> q2;
    q1.push(s1); //init state(fennec)
    q2.push(s2); //init state(snuke)
    for(int i = 0; i < n; i++) color[i]=NOCOLOR;
    color[0]=BLACK;
    color[n-1]=WHITE;
    int u1,u2;
    while(!q1.empty() && !q2.empty()){
        if(turn==0){
            // cout<<"Fennec's Turn"<<endl;
            u1=q1.front(); q1.pop();
            for(int v = 0; v < n; v++){
                if(M[u1][v]==0) continue;
                if(color[v]!=NOCOLOR) continue;
                color[v] = BLACK;
                // cout<<"proceed"<<v<<endl;
                q1.push(v);
            }
            turn=1;//next snuke
        }else{
            // cout<<"Snuke's Turn"<<endl;
            u2=q2.front(); q2.pop();
            for(int v = 0; v < n; v++){
                if(M[u2][v]==0) continue;
                if(color[v]!=NOCOLOR) continue;
                color[v] = WHITE;
                // cout<<"proceed"<<v<<endl;
                q2.push(v);
            }
            turn=0;//next fennec
        }
    }
    if(!q1.empty()){
        cout<<"Fennec"<<endl;
    }else{
        cout<<"Snuke"<<endl;
    }
}

int main(void){
    cin.sync_with_stdio(false);
    int a,b;
    cin>>n;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            M[i][j] = 0;
        }
    }
    for(int i = 0; i < n-1; i++){
        int a,b;
        cin>>a>>b;
        a--; b--;
        M[a][b]=1;
        M[b][a]=1;
    }

    bfs(0,n-1,0);
    return 0;
}

Compiler output:
/tmp/ccB9QZHS.o: in function `bfs(int, int, int)':
a.cc:(.text+0x81): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccB9QZHS.o
a.cc:(.text+0x9d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccB9QZHS.o
a.cc:(.text+0xbb): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccB9QZHS.o
a.cc:(.text+0x145): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccB9QZHS.o
a.cc:(.text+0x163): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccB9QZHS.o
a.cc:(.text+0x22f): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccB9QZHS.o
a.cc:(.text+0x24d): relocation truncated to fit: R_X86_64_PC32 against symbol `color' defined in .bss section in /tmp/ccB9QZHS.o
collect2: error: ld returned 1 exit status