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

#include <iostream>
#include <vector>
#include <cstring>

constexpr int MAX_N=(int)1e5;

int n;

std::vector<int> G[MAX_N];

bool path[MAX_N];

bool used[MAX_N];

void search(int s,int t){
  
  	used[s]=true;

    if(s==t){
      std::memcpy(path,used,sizeof(used))
      return;
    }

    for(int i=0;i<G[s].size();++i){
        int to=G[s][i];
        if(!path[to])
            search(to,t);
    }
  
    used[s]=false;
}

void _dfs(int m);

int dfs(int m){
    
    std::memcpy(used,path,sizeof(path));

    _dfs(m);

    int cnt=0;

    for(int i=0;i<n;++i){
        if(!path[i]&&used[i])
            ++cnt;
    }

    return cnt;
}

void _dfs(int m) {

    used[m]=true;

    for(int i=0;i<G[m].size();++i){
        int to=G[m][i];
        if(!used[to])
            _dfs(to);
    }
}

int main() {

    std::cin>>n;

    int a,b;

    for(int i=0;i<n-1;++i){
        std::cin>>a>>b;
        G[a-1].emplace_back(b-1);
        G[b-1].emplace_back(a-1);
    }

    search(0,n-1);

    int fst=dfs(0),snd=dfs(n-1);

    int res=0;

    for(int i=0;i<n;++i){
        if(path[i])
            ++res;
    }

    fst+=(res+1)/2;
    snd+=res-(res+1)/2;

    if(fst>snd)
        std::cout<<"Fennec"<<std::endl;
    else
        std::cout<<"Snuke"<<std::endl;

    return 0;
}


Compiler output:
a.cc: In function 'void search(int, int)':
a.cc:20:42: error: expected ';' before 'return'
   20 |       std::memcpy(path,used,sizeof(used))
      |                                          ^
      |                                          ;
   21 |       return;
      |       ~~~~~~
Language: C++

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

#define N 100000

using namespace std;


int e[N+1][N+1] = {};

vector<int> p;
bool used[N+1];

int dfs_goal(int s, int g, int n){
  for (int i=1;i<=n;i++) {
    if (!used[i] && e[s][i] == 1) {
      if (i==g) {
	p.push_back(i);
	return(i);
      }
      used[i] = true;
      int result = dfs_goal(i, g, n);
      if (result > 0) {
	p.push_back(i);
	return(i);
      }
    }
  }
  return(0);
}

int dfs_count(int s, int n){
  int c = 0;
  for (int i=1;i<=n;i++) {
    if (!used[i] && e[s][i] == 1) {
      c++;
      used[i] = true;
      //      cout << "i:" << i << endl;
      int result = dfs_count(i, n);
      //      cout << "result:" << result << endl;
      c += result;
    }
  }
  return(c);
}

int main(){
  int n;
  cin >> n;
  for (int i=0;i<n-1;i++) {
    int a, b;
    cin >> a >> b;
    e[a][b] = 1;
    e[b][a] = 1;
  }
  for (int i=0;i<=n;i++)used[i] = false;
  used[1] = true;
  dfs_goal(1, n, n);
  p.push_back(1);
  /*  for (auto it=p.begin();it!=p.end();it++)
    cout << *it << " ";
    cout << endl;*/

  
  int m = p.size()/2;

  
  e[p[m]][p[m-1]] = 0;
  e[p[m-1]][p[m]] = 0;

  for (int i=0;i<=n;i++)used[i] = false;
  int fenec = dfs_count(1, n);
  for (int i=0;i<=n;i++)used[i] = false;
  int snuke = dfs_count(n, n);

  
  if (fenec > snuke)
    cout << "Fennec" << endl;
  else
    cout << "Snuke" << endl;
  return(0);
}


Compiler output:
/tmp/ccvs9Zv0.o: in function `dfs_goal(int, int, int)':
a.cc:(.text+0x25): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccvs9Zv0.o
a.cc:(.text+0x76): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccvs9Zv0.o
a.cc:(.text+0x8f): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccvs9Zv0.o
a.cc:(.text+0xbc): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccvs9Zv0.o
/tmp/ccvs9Zv0.o: in function `dfs_count(int, int)':
a.cc:(.text+0x10f): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccvs9Zv0.o
a.cc:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccvs9Zv0.o
/tmp/ccvs9Zv0.o: in function `main':
a.cc:(.text+0x254): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccvs9Zv0.o
a.cc:(.text+0x26a): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccvs9Zv0.o
a.cc:(.text+0x292): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccvs9Zv0.o
a.cc:(.text+0x2a1): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccvs9Zv0.o
a.cc:(.text+0x2be): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

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

#define N 100000

using namespace std;

int n;

int e[N+1][N+1] = {};

vector<int> p;
bool used[N+1];

int dfs_goal(int s, int g, int n){
  for (int i=1;i<=n;i++) {
    if (!used[i] && e[s][i] == 1) {
      if (i==g) {
	p.push_back(i);
	return(i);
      }
      used[i] = true;
      int result = dfs_goal(i, g, n);
      if (result > 0) {
	p.push_back(i);
	return(i);
      }
    }
  }
  return(0);
}

int dfs_count(int s, int n){
  int c = 0;
  for (int i=1;i<=n;i++) {
    if (!used[i] && e[s][i] == 1) {
      c++;
      used[i] = true;
      //      cout << "i:" << i << endl;
      int result = dfs_count(i, n);
      //      cout << "result:" << result << endl;
      c += result;
    }
  }
  return(c);
}

int main(){
  cin >> n;
  for (int i=0;i<n-1;i++) {
    int a, b;
    cin >> a >> b;
    e[a][b] = 1;
    e[b][a] = 1;
  }
  for (int i=0;i<=n;i++)used[i] = false;
  used[1] = true;
  dfs_goal(1, n, n);
  p.push_back(1);
  /*  for (auto it=p.begin();it!=p.end();it++)
    cout << *it << " ";
    cout << endl;*/

  
  int m = p.size()/2;

  
  e[p[m]][p[m-1]] = 0;
  e[p[m-1]][p[m]] = 0;

  for (int i=0;i<=n;i++)used[i] = false;
  int fenec = dfs_count(1, n);
  for (int i=0;i<=n;i++)used[i] = false;
  int snuke = dfs_count(n, n);

  
  if (fenec > snuke)
    cout << "Fennec" << endl;
  else
    cout << "Snuke" << endl;
  return(0);
}


Compiler output:
/tmp/ccT7VclH.o: in function `dfs_goal(int, int, int)':
a.cc:(.text+0x25): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccT7VclH.o
a.cc:(.text+0x76): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccT7VclH.o
a.cc:(.text+0x8f): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccT7VclH.o
a.cc:(.text+0xbc): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccT7VclH.o
/tmp/ccT7VclH.o: in function `dfs_count(int, int)':
a.cc:(.text+0x10f): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccT7VclH.o
a.cc:(.text+0x156): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccT7VclH.o
/tmp/ccT7VclH.o: in function `main':
a.cc:(.text+0x25a): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccT7VclH.o
a.cc:(.text+0x273): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccT7VclH.o
a.cc:(.text+0x2a1): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccT7VclH.o
a.cc:(.text+0x2b0): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccT7VclH.o
a.cc:(.text+0x2cd): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

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

#define N 100000

using namespace std;

int n;

int e[N+1][N+1] = {};

vector<int> p;
bool used[N+1];

int dfs_goal(int s, int g){
  for (int i=1;i<=n;i++) {
    if (!used[i] && e[s][i] == 1) {
      if (i==g) {
	p.push_back(i);
	return(i);
      }
      used[i] = true;
      int result = dfs_goal(i, g);
      if (result > 0) {
	p.push_back(i);
	return(i);
      }
    }
  }
  return(0);
}

int dfs_count(int s){
  int c = 0;
  for (int i=1;i<=n;i++) {
    if (!used[i] && e[s][i] == 1) {
      c++;
      used[i] = true;
      //      cout << "i:" << i << endl;
      int result = dfs_count(i);
      //      cout << "result:" << result << endl;
      c += result;
    }
  }
  return(c);
}

int main(){
  cin >> n;
  for (int i=0;i<n-1;i++) {
    int a, b;
    cin >> a >> b;
    e[a][b] = 1;
    e[b][a] = 1;
  }
  for (int i=0;i<=n;i++)used[i] = false;
  used[1] = true;
  dfs_goal(1, n);
  p.push_back(1);
  /*  for (auto it=p.begin();it!=p.end();it++)
    cout << *it << " ";
    cout << endl;*/

  
  int m = p.size()/2;

  
  e[p[m]][p[m-1]] = 0;
  e[p[m-1]][p[m]] = 0;

  for (int i=0;i<=n;i++)used[i] = false;
  int fenec = dfs_count(1);
  for (int i=0;i<=n;i++)used[i] = false;
  int snuke = dfs_count(n);

  
  if (fenec > snuke)
    cout << "Fennec" << endl;
  else
    cout << "Snuke" << endl;
  return(0);
}


Compiler output:
/tmp/ccdtBgG9.o: in function `dfs_goal(int, int)':
a.cc:(.text+0x22): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccdtBgG9.o
a.cc:(.text+0x73): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccdtBgG9.o
a.cc:(.text+0x8c): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccdtBgG9.o
a.cc:(.text+0xb6): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccdtBgG9.o
/tmp/ccdtBgG9.o: in function `dfs_count(int)':
a.cc:(.text+0x10b): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccdtBgG9.o
a.cc:(.text+0x152): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccdtBgG9.o
/tmp/ccdtBgG9.o: in function `main':
a.cc:(.text+0x254): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccdtBgG9.o
a.cc:(.text+0x26d): relocation truncated to fit: R_X86_64_PC32 against symbol `used' defined in .bss section in /tmp/ccdtBgG9.o
a.cc:(.text+0x295): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccdtBgG9.o
a.cc:(.text+0x2a4): relocation truncated to fit: R_X86_64_PC32 against symbol `p' defined in .bss section in /tmp/ccdtBgG9.o
a.cc:(.text+0x2c1): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status
Language: C++

#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <bitset>
typedef long long ll;
typedef unsigned long long ull;

using namespace std;

# define INF 0x3f3f3f3f

template <typename T>
struct Edge {
  int src, dst;
  T weight;
  Edge(int src, int dst, T weight) :
    src(src), dst(dst), weight(weight) { }
};
template <typename T>
bool operator < (const Edge<T> &e, const Edge<T> &f) {
  return e.weight != f.weight ? e.weight > f.weight :
    e.src != f.src ? e.src < f.src : e.dst < f.dst;
}

template <typename T>
struct Graph {
  int V;    // 頂点数
  vector<Edge<T>> *adj;

  explicit Graph(int V) {
    this->V = V;
    adj = new vector<Edge<T>> [V];
  }
  void add_edge(int src, int dst, T weight) {
    assert(src >= 0 && src < V);
    assert(dst >= 0 && dst < V);
    adj[src].push_back(Edge<T>(src, dst, weight));
  }
  vector<T> shortest_path(int s);
  // vector<vector<T>> shortest_paths();
  // Graph<T> spanning_tree();
};

template <typename T>
vector<T> Graph<T>::shortest_path(int src) {
  vector<T> dist(V, INF);
  dist[src] = 0;

  for (int i = 0; i < V; i++) {
    bool updated = false
    for (int u = 0; u < V; u++) {
      for (const auto& e : adj[u]) {
        if (dist[u] != INF && dist[e.dst] > dist[u] + e.weight) {
          dist[e.dst] = dist[u] + e.weight;
          updated = true;
          if (i == V - 1) {
            dist = vector<T>(V, -INF);
            return dist;
          }
        }
      }
    }
    if (!updated) break;
  }
  return dist;
}

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

  ll N;
  cin >> N;

  Graph<int> g(N);

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

  vector<int> dist1 = g.shortest_path(0);
  vector<int> dist2 = g.shortest_path(N - 1);

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


Compiler output:
a.cc: In member function 'std::vector<_Tp> Graph<T>::shortest_path(int)':
a.cc:65:5: error: expected ',' or ';' before 'for'
   65 |     for (int u = 0; u < V; u++) {
      |     ^~~
a.cc:65:21: error: 'u' was not declared in this scope
   65 |     for (int u = 0; u < V; u++) {
      |                     ^
Language: C++

#include<iostream>
#include<vector>

using namespace std;
int x[100010], y[100010];
vector<int> adjacent[100010];
void DFSx(int a) {
  for (int b : adjacent[a]) {
    if (x[b] == -1) {
      x[b] = x[a] + 1;
      DFSx(b);
    }
  }
}
void DFSy(int a) {
  for (int b : adjacent[a]) {
    if (y[b] == -1) {
      y[b] = y[a] + 1;
      DFSy(b);
    }
  }
}

int main() {
  memset(x, -1, sizeof(x));
  memset(y, -1, sizeof(y));
  int n;
  cin >> n;
  int i;
  for (i = 0; i < n-1; i++) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    adjacent[a].push_back(b);
    adjacent[b].push_back(a);
  }
  x[0] = 0;
  y[n-1] = 0;
  DFSx(0);
  DFSy(n-1);
  int X = 0, Y = 0;
  for (i = 0; i < n; i++) {
    if (x[i] <= y[i]) {
      X++;
    } else {
      Y++;
    }
  }
  if (X <= Y) {
    cout << "Snuke" << endl;
  } else {
    cout << "Fennec" << endl;
  }
}
  
  


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

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
using namespace std;
 
int n, a, b;
int fenv, snuv, pathv;
 
vector<int> g[100005];
bool used[100005];
 
// fennec
void bfs() {
    queue<pair<int, int> > que;
    pair<int, int> tmp;
    que.push(make_pair(0, 0));
 
    while (!que.empty()) {
        tmp = que.front();
        que.pop();
        bool flag = false;
 
        int size_ = g[tmp.first].size();
 
        if (tmp.first == n - 1) {
            pathv = tmp.second - 1;
            continue;
        }
 
 
        for (int i = 0; i < size_; ++i) {
            if (!used[g[tmp.first][i]]) {
                que.push(make_pair(g[tmp.first][i], tmp.second + 1));
                flag = true;
used[g[tmp.first][i]] = true;
            }
        }
 
        if (!flag) {
            fenv += tmp.second;
        }
    }
}
 
// snuke
void bfs2() {
    queue<pair<int, int> > que;
    pair<int, int> tmp;
    que.push(make_pair(n - 1, 0));
 
    while (!que.empty()) {
        tmp = que.front();
        que.pop();
        bool flag = false:
 
        int size_ = g[tmp.first].size();
 
        for (int i = 0; i < size_; ++i) {
            if (!used[g[tmp.first][i]]) {
                que.push(make_pair(g[tmp.first][i], tmp.second + 1));
used[g[tmp.first][i]] = true;
                flag = true;
            }
        }
 
        if (!flag) {
            snuv += tmp.second;
        }
        
    }
}
 
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
 
    cin >> n;
    for (int i = 0; i < n-1; ++i) {
        cin >> a >> b;
        a--; b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
 
    bfs();
    bfs2();
 
    int fv, sv;
    fv = sv = 0;
 
    if (pathv % 2) {
        fv = pathv / 2 + 1;
        sv = pathv / 2;
    }
    else {
        fv = sv = pathv / 2;
    }
 
    fv += fenv;
    sv += snuv;
 
    if (fv > sv) {
        cout << "Fennec" << endl;
    }
    else {
        cout << "Snuke" << endl;
    }
 
    return 0;
}

Compiler output:
a.cc: In function 'void bfs2()':
a.cc:56:26: error: expected ',' or ';' before ':' token
   56 |         bool flag = false:
      |                          ^
a.cc:60:29: error: 'size_' was not declared in this scope; did you mean 'size_t'?
   60 |         for (int i = 0; i < size_; ++i) {
      |                             ^~~~~
      |                             size_t
Language: C++

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

Compiler output:
a.cc:5:15: error: 'INT_MAX' was not declared in this scope
    5 | const int INF=INT_MAX/2;
      |               ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include<queue>
  +++ |+#include <climits>
    3 | #include<vector>
Language: C++

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

Compiler output:
a.cc:5:15: error: 'INT_MAX' was not declared in this scope
    5 | const int INF=INT_MAX/2;
      |               ^~~~~~~
a.cc:3:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    2 | #include<queue>
  +++ |+#include <climits>
    3 | #include<vector>
a.cc: In function 'std::vector<int> bfs(int, std::vector<std::vector<int> >&, int)':
a.cc:7:25: error: 'INT_MAX' was not declared in this scope
    7 |         vector<int> d(N,INT_MAX/2);
      |                         ^~~~~~~
a.cc:7:25: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
Language: C++

#include<iostream>
#include<cctype>
#include<queue>
#include<cstdio>
#include<cmath>
#include<sstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<ctime>
#include<cstdlib>
#include<map>
#include<utility>
#include<iomanip>
#include<set>
using namespace std;
typedef long long ll;
const int maxn=1<<18;
int n;
vector<int> e[maxn];
int cnt[maxn];
vector<int> vec;
int first;
void dfs(int v,int pr)
{
	cnt[v]=1;
	vec.push_back(v);
	if(v==n-1)
		first=vec[((int)vec.size()+1)/2];
	for(int k : e[v])
	{
		if(k==pr) continue;
		dfs(k,v);
		cnt+=cnt[k];
	}
	vec.pop_back();
}
int main()
{
	while(cin>>n)
	{
		for(int i=0;i<n;i++)
			e[i].clear();
	}
	for(int i=0;i<n;i++)
	{
		int a,b;
		cin>>a>>b;
		e[a].push_back(b);
		e[b].push_back(a);
	}
	first=-1;
	dfs(0,0);
	bool win=cnt[first]*2<n;
	string ans=win?"Fennec":"Snuke";
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:35:20: error: incompatible types in assignment of 'int' to 'int [262144]'
   35 |                 cnt+=cnt[k];
      |                 ~~~^~~~~~~~
Language: C++

#include<iostream>
#include<cctype>
#include<queue>
#include<cstdio>
#include<cmath>
#include<sstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<ctime>
#include<cstdlib>
#include<map>
#include<utility>
#include<iomanip>
#include<set>
using namespace std;
typedef long long ll;
const int maxn=1<<18;
int n;
vector<int> e[maxn];
int cnt[maxn];
vector<int> vec;
int first;
void dfs(int v,int pr)
{
	cnt[v]=1;
	vec.push_back(v);
	if(v==n-1)
		first=vec[((int)vec.size()+1)/2];
	for(int to : e[v])
	{
		if(to==pr) continue;
		dfs(to,v);
		cnt+=cnt[to];
	}
	vec.pop_back();
}
int main()
{
	while(cin>>n)
	{
		for(int i=0;i<n;i++)
			e[i].clear();
	}
	for(int i=0;i<n;i++)
	{
		int a,b;
		cin>>a>>b;
		e[a].push_back(b);
		e[b].push_back(a);
	}
	first=-1;
	dfs(0,0);
	bool win=cnt[first]*2<n;
	string ans=win?"Fennec":"Snuke";
	cout<<ans<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:35:20: error: incompatible types in assignment of 'int' to 'int [262144]'
   35 |                 cnt+=cnt[to];
      |                 ~~~^~~~~~~~~
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 <limits>
#include <map>
#include <iomanip>
#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 <conio.h>
#include <numeric>
#include <list>
#include <windows.h>
#include <cfloat>
#include <climits>
using namespace std;
int n;
vector<int> neigh[100005];
int cnt[100005],L[100005],P[100005];
inline int dfs(int v)
{
	cnt[v]=1;
	for(int i=0;i<neigh[v].size();i++)
	{
		int u=neigh[v][i];
		if(P[v]==u)continue;
		L[u]=L[v]+1;
		P[u]=v;
		dfs(u);
		cnt[u]+=cnt[v];
	}
}
int main()
{
	cin>>n;
	for(int i=0;i<n-1;i++)
	{
		int a,b;
		cin>>a>>b;
		neigh[a].push_back(b);
		neigh[b].push_back(a);
	}
	int up=(L[n]-1)/2;
	int v=n;
	while(up--)v=P[v];
	if(cnt[v]>=n-cnt[v])cout<<"Snuke"<<endl;
	else cout<<"Fennec"<<endl;
	return 0;
}

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

#include<iostream>
#include<cctype>
#include<queue>
#include<cstdio>
#include<cmath>
#include<sstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<ctime>
#include<cstdlib>
#include<map>
#include<utility>
#include<iomanip>
#include<set>
using namespace std;
typedef long long ll;
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);
	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);
	}
	vector<int> d1=bfs(n,G,0);
	vector<int> d2=bfs(n,G,n-1);
	int n1=0,n2=0;
	for(int u=0;u<n;u++)
		if(d1[u]<=d2[u])
			n1++;
		else n2++;
	cout<<(n1>n2?"Fennec":"Snuke")<<endl;
	return 0;
}

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

#include<iostream>
#include<cctype>
#include<queue>
#include<cstdio>
#include<cmath>
#include<sstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<vector>
#include<ctime>
#include<cstdlib>
#include<map>
#include<utility>
#include<iomanip>
#include<set>
using namespace std;
typedef long long ll;
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;i
	cin>>n;
	vector<vector<int> >G(n);
	for(itn i=0;i<n-1;i++)
	{
		int a,b;
		cin>>a>>b;
		a--;
		b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	vector<int> d1=bfs(n,G,0);
	vector<int> d2=bfs(n,G,n-1);
	int n1=0,n2=0;
	for(int u=0;u<n;u++)
		if(d1[u]<=d2[u])
			n1++;
		else n2++;
	else n2++;
	cout<<(n1>n2?"Fennec":"Snuke")<<endl;
	return 0;
}

Compiler output:
a.cc:19:15: error: 'INT_MAX' was not declared in this scope
   19 | const int INF=INT_MAX/2;
      |               ^~~~~~~
a.cc:17:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   16 | #include<set>
  +++ |+#include <climits>
   17 | using namespace std;
a.cc: In function 'int main()':
a.cc:41:15: error: 'i' was not declared in this scope
   41 |         int n;i
      |               ^
a.cc:44:13: error: 'itn' was not declared in this scope; did you mean 'int'?
   44 |         for(itn i=0;i<n-1;i++)
      |             ^~~
      |             int
a.cc:60:9: error: 'else' without a previous 'if'
   60 |         else n2++;
      |         ^~~~
Language: C++

//code by 27.
#include<stdio.h>
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<queue>
#include<map>
#include<stack>
#include<fstream>
#include<stdlib.h>
#include<set>
#include<cassert>
#include<climits>
#include<cmath>
#include<memory.h>
#include<conio.h>
#include<windows.h>
#include<ctime>
using namespace std;
vector<int>vt[10001];
int f[10001];
queue<int>que;
int n;
int main()
{
	int g1=0,g2=0;
	cin>>n;
	int x,y;
	for(int i=1;i<n;i++)
	{
		scanf("%d%d",&x,&y);
		vt[x].push_back(y);
		vt[y].push_back(x);
	}
	que.push(1);
	g1++;
	g2++;
	que.push(n);
	f[1]=1;
	f[n]=-1;
	while(!que.empty())
	{
		if(f[que.front()]>0)
		{
			for(int i=0;i<vt[que.front()].size();i++)
			{
				if(f[vt[que.front()][i]]==0)
				{
					f[vt[que.front()][i]]=f[que.front()]+1;
					que.push(vt[que.front()][i]);
					g1++;
				}
			}
		}
		if(f[que.front()]<0)
		{
			for(int i=0;i<vt[que.front()].size();i++)
			{
				if(f[vt[que.front()][i]]==0)
				{
					f[vt[que.front()][i]]=f[que.front()]-1;
					que.push(vt[que.front()][i]);
					g2++;
				}
			}
		}
		que.pop();
	}
	if(g1>g2)cout<<"Fennec";
	else cout<<"Snuke";
    return 0;
}

Compiler output:
a.cc:19:9: fatal error: conio.h: No such file or directory
   19 | #include<conio.h>
      |         ^~~~~~~~~
compilation terminated.
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 <limits>
#include <map>
#include <iomanip>
#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 <conio.h>
#include <numeric>
#include <list>
#include <windows.h>
#include <cfloat>
#include <climits>
using namespace std;
int n;
vector<int> road[10005];
int main()
{
	cin>>n;
	for(int i=0;i<n-1;i++)
	{
		int a,b;
		cin>>a>>b;
		a--;
		b--;
		road[a].push_back(b);
		road[b].push_back(a);
	}
	if(n%2==1)
	{
		cout<<"Fennec"<<endl;
	}
	else
	{
		cout<<"Snuke"<<endl;
	}
	return 0;
}

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

#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long LL;
const int MAXN=1e5+5;
int n;
vector<int> g[MAXN*2];
int d1[MAXN],d2[MAXN];

void dfs(int rt,int fa,int d,int dist[])
{
    dist[rt]=d;
    for(int x:g[rt])
    {
        if(x!=fa)
            dfs(x,rt,d+1,dist);
    }
}

int main()
{
    ios::sync_with_stdio(false);
    while(cin>>n)
    {
        for(int i=0;i<n;i++)
            g[i].clear();
        int u,v;
        for(int i=0;i<n-1;i++)
        {
            cin>>u>>v;
            u--;v--;
            g[u].push_back(v);
            g[v].push_back(u);
        }
        dfs(0,-1,0,d1);
        dfs(n-1,-1,0,d2);
        int ans=0;
        for(int i=0;i<n;i++)
        {
            if(d1[i]<=d2[i])  ++ans;
            else --ans;
        }
        if(ans>0)
            cout<<"Fennec"<<endl;
        else
            cout<<"Snuke"<<endl;
    }
    return 0;

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

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;
#define B 1
#define W 2
int N;
vector<int> G[100001];
int Order[100001];
int Order2[100001];
int prev[100001];
int color[100001];
int cnt=0;
void dfs(int v,int p,int *order){
  order[v]=order[p]+1;
  prev[v]=p;
  for(int i=0;i<G[v].size();i++){
    int u=G[v][i];
    if(u==p)continue;
    dfs(u,v,order);
  }
}

void paint(int v,int p,int c){
  color[v]=c;
  for(int i=0;i<G[v].size();i++){
    int u=G[v][i];
    if(u==p || (color[u]!=c && color[u]!=0))continue;
    paint(u,v,c);
  }
}
int main(){
  cin >> N;
  for(int i=0;i<N-1;i++){
    int s,t;
    cin >> s >> t;
    s;t;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  for(int i=0;i<=N;i++){
    Order[i]=-1;
    Order2[i]=-1;
  }
  dfs(1,0,Order);
  dfs(N,0,Order2);

  vector<int> path;
  int t=1;
  while(1){
    if(t==0)break;
    path.push_back(t);
    t=prev[t];
  }
  for(int i=0;i<path.size();i++){
    int v=path[i];
    if(Order[v]<=Order2[v])color[v]=B;
    else color[v]=W;
  }
 
  paint(1,0,B);
  paint(N,0,W);
  for(int i=1;i<=N;i++){
    if(color[i]==B)cnt++;
  }
  for(int i=1;i<=N;i++)printf("%d ",color[i]);
  if(cnt>N-cnt)printf("Fennec\n");
  else printf("Snuke\n");
  return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, int, int*)':
a.cc:17:3: error: reference to 'prev' is ambiguous
   17 |   prev[v]=p;
      |   ^~~~
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:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:12:5: note:                 'int prev [100001]'
   12 | int prev[100001];
      |     ^~~~
a.cc: In function 'int main()':
a.cc:55:7: error: reference to 'prev' is ambiguous
   55 |     t=prev[t];
      |       ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:244:5: note: candidates are: 'template<class _BidirectionalIterator> constexpr _BidirectionalIterator std::prev(_BidirectionalIterator, typename iterator_traits<_Iter>::difference_type)'
  244 |     prev(_BidirectionalIterator __x, typename
      |     ^~~~
a.cc:12:5: note:                 'int prev [100001]'
   12 | int prev[100001];
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<string>
#include<sstream>
#include<windows.h>
#include<algorithm>
#include<list>
#include<ctime>
#include<set>
#include<map>
#include<cmath>
using namespace std;
#define R freopen("666input.txt","r",stdin);
#define W freopen("666output.txt","w",stdout);
#define N 100005
int i,t,a,b,dis[N],dis2[N],vis[N],cnt,cnt2;
queue <int> q;
vector<int> v[N];
int main()
{
    
   
    cin>>n;
    for(i=1;i<n;i++)
    {
        scanf("%d%d",&a,&b);
        v[a].push_back(b);
        v[b].push_back(a);

    }
    q.push(1);
    vis[1]=1;
    while(!q.empty())
    {
        int cur=q.front();
        q.pop();
        int sz=v[cur].size();
        for(i=0;i<sz;i++)
        {
            if(!vis[v[cur][i]])
            {
                vis[v[cur][i]]=1;
                q.push(v[cur][i]);
                dis[v[cur][i]]=dis[cur]+1;
            }
        }
    }
    memset(vis,0,sizeof(vis));
    q.push(n);
    vis[n]=1;
    while(!q.empty())
    {
        int cur=q.front();
        q.pop();
        int sz=v[cur].size();
        for(i=0;i<sz;i++)
        {
            if(!vis[v[cur][i]])
            {
                vis[v[cur][i]]=1;
                q.push(v[cur][i]);
                dis2[v[cur][i]]=dis2[cur]+1;
            }
        }
    }
    for(i=1;i<=n;i++)
        if(dis[i]<=dis2[i])cnt++;
        else cnt2++;
    if(cnt>cnt2)cout<<"Fennec";
    else cout<<"Snuke";
    return 0;
}


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

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

typedef long long ll;
typedef pair<int,int>i_i;

//const int MOD=1e9+7;
const int INF=INT_MAX/2;

int n1=0,n2=0;
int N;
vector<int> G[1000000+5];
int vis[100005]; 

//vector<int> bfs(int N,vector<vector<int>>&G,int s){
vector<int> bfs(int N,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);
			}
		}*/
	for(int i=0;i<(int)G[u].size();i++){
		//printf("u=%d\n",u);
		int v=G[u][i];
		if(d[v]>d[u]+1){
			d[v]=d[u]+1;
		q.push(v); 
	}
	}
}
return d;
} 

int main(){
	//int i; 
	//cin>>N;
	scanf("%d",&N);
	//vector<vector<int>> G(N);
	for(int i=0;i<N-1;i++){
		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);
	vector<int> d1=bfs(N,0);
	vector<int> d2=bfs(N,N-1);
	//printf("N=%d\n",N);
	for(int u=0;u<N;u++){
		//printf("d1[%d]=%d\n",u,d1[u]); 
		//printf("d2[%d]=%d\n",u,d2[u]);
	if(d1[u]<=d2[u])
	n1++;
	else n2++;
	}
	//printf("n1=%d\n",n1);
	//printf("n2=%d\n",n2);
	if(n1<n2)
	printf("Snuke\n");
	else
	printf("Fennec\n");
	return 0;
}
/*input1:
7
3 6
1 2
3 1
7 4
5 7
1 4
output1:
Fennec
*/
  
/*inout2:
4
1 4
4 2
2 3
output2:
Snuke  
*/ 

Compiler output:
a.cc:14:15: error: 'INT_MAX' was not declared in this scope
   14 | const int INF=INT_MAX/2;
      |               ^~~~~~~
a.cc:7:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    6 | #include<queue>
  +++ |+#include <climits>
    7 | #include<vector>
Language: C++

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

int main()
{
    int n; cin>>n;
    vector<vector<int>> g(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);
    }

    vector<int> x(n);
    queue<int> q;
    q.push(0); x[0]=1;
    q.push(n-1); x[n-1]=-1;

    while (q.size()) {
        int v=q.front(); q.pop();
        int k=x[v];
        for(int u: g[v]) if (!x[u]) {
            x[u]=k;
            q.push(u);
        }
    }
    int fennec=count(begin(x), end(x), 1);
    int snuke=n-fennec;
    cout<<(fennec>sunuke ? "Fennec" : "Snuke")<<endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:19: error: 'sunuke' was not declared in this scope; did you mean 'snuke'?
   30 |     cout<<(fennec>sunuke ? "Fennec" : "Snuke")<<endl;
      |                   ^~~~~~
      |                   snuke
Language: C++

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

const int maxn = int(1e5)+5;

int sz[maxn], P[maxn];
vector<int> graph[maxn];

void dfs(int node, int par)
{
	sz[node] = 1, P[node] = par;
	for(auto it: graph[node])
	{
		if(it != par)
		{
			dfs(it, node);
			sz[node] += sz[it];
		}
	}
}

int main(void)
{
	int n, a, b;
	scanf("%d", &n);

	for(int i = 1;i < n;i++)
	{
		scanf("%d%d", &a, &b);
		a--, b--;
		graph[a].push_back(b), graph[b].push_back(a);
	}

	dfs(0, -1);

	int cur = n-1;
	vector<int> path;
	while(cur != -1)
	{
		path.push_back(cur);
		cur = P[cur];
	}
	reverse(path.begin(), path.end());

	int meet = path[ceil(int(path.size())/2.0)];
	//cout << meet << "\n";
	if(sz[meet] > n-sz[meet]) printf("Snuke\n");
	else printf("Fennec\n");
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:9: error: 'reverse' was not declared in this scope
   46 |         reverse(path.begin(), path.end());
      |         ^~~~~~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long LL;

vector<int> d[2];
vector<int> v[100000];

void dfs(int x, int y, int dist, int s) {
    d[s][x] = dist;
    for (int i = 0; i < v[x].size(); i++) {
        if (v[x][i] != y) {
            dfs(v[x][i], visit, dist + 1, s);
        }
    }
}

int main() {
    int n;
    cin >> n;
    d[0].resize(n);
    d[1].resize(n);

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

    dfs(0, -1, 0, 0);
    dfs(n - 1, -1, 0, 1);

    int f = 0, ss = 0;
    for (int i = 0; i < n; i++) {
        if (d[0][i] <= d[1][i]) {
            f++;
        } else {
            ss++;
        }
    }

    if (f > ss) {
        cout << "Fennec" << endl;
    } else {
        cout << "Snuke" << endl;
    }

    return 0;
}


Compiler output:
a.cc: In function 'void dfs(int, int, int, int)':
a.cc:14:16: error: cannot resolve overloaded function 'visit' based on conversion to type 'int'
   14 |             dfs(v[x][i], visit, dist + 1, s);
      |             ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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


using namespace std;

#define pb push_back
#define mp make_pair
#define F first
#define S second
#define fast_cin() ios_base::sync_with_stdio(false);

typedef long long ll;

const int INF = 1e7;
const int MAX_SIZE = 1e5 + 10;

vector<int> graph[MAX_SIZE];
vector<bool> visited;

vector<int> LIST;

void bfs(int s, int n, vector<int> &d)
{
	for(int i = 1; i<= n; i++)
	{
		visited[i] = false;
		d[i] = INF;
	}
	visited[s] = true;
	queue<int> q1;
	q1.push(s);
	d[s] = 0;
	while(!q1.empty())
	{
		int u = q1.front();
		q1.pop();
		for(auto &v: graph[u])
		{
			if(!visited[v])
			{
				visited[v] = true;
				d[v] = d[u] + 1;
				q1.push(v);
			}
		}
	}
}

void dfs(int a, int n)
{
	for()
}

int main()
{
	int n;
	cin >> n;
	int x, y;
	for(int i = 1; i < n; i++)
	{
		cin >> x >> y;
		graph[x].pb(y);
		graph[y].pb(x);
	}
	vector<int> d1, dN;
	d1.resize(n + 1);
	dN.resize(n + 1);
	visited.resize(n + 1);
	bfs(1, n, d1);
	bfs(n, n, dN);
	int b = 0 , w = 0;
	for(int i = 1; i <= n; i++)
	{
		if(d1[i] <= dN[i])
			b++;
		else if(d1[i] > dN[i])
			w++;
	}
	// cout << ÷
	if(w >= b)
		cout << "Snuke" << endl;
	else
		cout << "Fennec" << endl;
	return 0;
}

Compiler output:
a.cc: In function 'void dfs(int, int)':
a.cc:54:13: error: expected primary-expression before ')' token
   54 |         for()
      |             ^
a.cc:55:1: error: expected primary-expression before '}' token
   55 | }
      | ^
a.cc:54:14: error: expected ';' before '}' token
   54 |         for()
      |              ^
      |              ;
   55 | }
      | ~             
a.cc:55:1: error: expected primary-expression before '}' token
   55 | }
      | ^
a.cc:54:14: error: expected ')' before '}' token
   54 |         for()
      |            ~ ^
      |              )
   55 | }
      | ~             
a.cc:55:1: error: expected primary-expression before '}' token
   55 | }
      | ^
Language: C++

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)
typedef vector<int> Array;
typedef vector<Array> Graph;
int dist1[100005] = {};
int dist2[100005] = {};
Graph G(100005);
int N;

void dfs1(int now, int dist){
    dist1[now] = dist;
    for(int i=0;i<G[now].size();i++){
        if(dist1[G[now][i]]==-1){
            dfs1(G[now][i], ++dist);
        }
    }
}

void dfs2(int now, int dist){
    dist2[now] = dist;
    for(int i=0;i<G[now].size();i++){
        if(dist2[G[now][i]]==-1){
            dfs2(G[now][i], ++dist);
        }
    }
}

int main(){
    cin >> N;
    int as[N];
    int bs[N];
    REP(i, N-1){
        int a, b;
        cin >> a >> b;
        a--;b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    dfs1();
    dfs2();
    int x=0;
    REP(i, N){
        if(dist1[i]>=dist2[i]) x++;
    }
    cout << (x>N-x?"Fennec":"Snuke") << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:47:9: error: too few arguments to function 'void dfs1(int, int)'
   47 |     dfs1();
      |     ~~~~^~
a.cc:18:6: note: declared here
   18 | void dfs1(int now, int dist){
      |      ^~~~
a.cc:48:9: error: too few arguments to function 'void dfs2(int, int)'
   48 |     dfs2();
      |     ~~~~^~
a.cc:27:6: note: declared here
   27 | void dfs2(int now, int dist){
      |      ^~~~
Language: C++

#include <iostream>
#include <vector>
#include <cstring>

constexpr int MAX_N = (int)1e5;

int n;

std::vector<int> G[MAX_N];

bool used[MAX_N];

bool Isroute[MAX_N];

std::vector<int> routes;

int cnt, len;

bool init(int m) {

	if (m == n - 1) {

		len = cnt;

		return true;
	}

	used[m] = true;

	++cnt;

	for (auto e : G[m]) {

		if (!used[e] && init(e)) {

			Isroute[e] = true;

			return true;
		}
	}

	--cnt;

	used[m] = false;

	return false;
}

int dfs(int m) {

	used[m] = true;

	int res = 1;

	for (auto e : G[m]) {

		if (!used[e] && !Isroute[e])
			res += dfs(e);
	}

	used[m] = false;

	return res;
}

int main() {

	std::cin >> n;

	int a, b;

	for (int i = 0; i < n - 1; ++i) {

		std::cin >> a >> b;

		G[a - 1].emplace_back(b - 1);

		G[b - 1].emplace_back(a - 1);
	}

	init(0);

	--len;

	Isroute[0] = true;
	Isroute[n - 1] = true;

	int f = 0, s = 0;

	int cnt = 0, m = 0;

	for (int i = 0; i < n; ++i) {
		if (Isroute[i])
			routes.emplace_back(i);
	}

	while (len / 2 > cnt) {

		std::memset(used, false, sizeof(used));

		f += dfs(m);

		m = routes[cnt++];
	}

	cnt = 0, m = n - 1;

	std::reverse(routes.begin(), routes.end());

	while (len / 2 > cnt) {

		std::memset(used, false, sizeof(used));


		s += dfs(m);


		++cnt;

		m = routes[cnt++];
	}

	if (len % 2 == 1) {

		std::memset(used, false, sizeof(used));

		f += dfs(m);
	}

	if (f > s)
		std::cout << "Fennec" << std::endl;
	else if (f == s)
		std::cout << "Snuke" << std::endl;
	else
		std::cout << "Snuke" << std::endl;

	system("pause");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:108:14: error: 'reverse' is not a member of 'std'
  108 |         std::reverse(routes.begin(), routes.end());
      |              ^~~~~~~
Language: C++

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

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)

const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

#define clr(a,i) memset((a), (i) ,sizeof(a))

int n, a, b;
vector<int> G[1e5+2];
std::vector<int> se;
set<int> fe;
void tansaku(int now, int prev, vector<int> a){
  rep(i, G[now].size()){
    std::vector<int> tmp=a;
    if(i==now||i==prev) continue;
    if(G[now][i]!=7){
      tmp.emplace_back（now）;
      tansaku(i, now, a);
    }else {
      se = a;
    }
  }
}

void coun(int now, int prev, int fukasa){
  if(fukasa<cell((double)se.size()/2.0)&&se[fukasa-1]==now)
  else{
    if(now!=1) fe.insert(now);
    rep(i, G[now].size()){
      if(i==now||i==prev) continue;
      if(G[now][i]){
        tansaku(i, now, a);
      }
    }
  }
}

int main() {
  std::cin >> n;
  rep(i,n) {
      std::cin >> a >> b;
      G[a].push_back(b);
      G[b].push_back(a);    
  }
  std::vector<int> a;
  tansaku(1,0,a);
  coun(1,0,0);
  f=fe.size();
  if(f>n-2-f) std::cout << "Fennec" << '\n';
  else std::cout << "Snuke" << '\n';
  return 0;
}


Compiler output:
a.cc:29:18: error: conversion from 'double' to 'long unsigned int' in a converted constant expression
   29 | vector<int> G[1e5+2];
      |               ~~~^~
a.cc:29:18: error: could not convert '(1.0e+5 + (double)2)' from 'double' to 'long unsigned int'
   29 | vector<int> G[1e5+2];
      |               ~~~^~
      |                  |
      |                  double
a.cc:29:18: error: size of array 'G' has non-integral type 'double'
a.cc: In function 'void tansaku(int, int, std::vector<int>)':
a.cc:37:11: error: 'class std::vector<int>' has no member named 'emplace_back\U0000ff08now\U0000ff09'
   37 |       tmp.emplace_back（now）;
      |           ^~~~~~~~~~~~~~~~~~~
a.cc: In function 'void coun(int, int, int)':
a.cc:46:13: error: 'cell' was not declared in this scope; did you mean 'ceill'?
   46 |   if(fukasa<cell((double)se.size()/2.0)&&se[fukasa-1]==now)
      |             ^~~~
      |             ceill
a.cc:47:3: error: expected primary-expression before 'else'
   47 |   else{
      |   ^~~~
a.cc: In function 'int main()':
a.cc:68:3: error: 'f' was not declared in this scope
   68 |   f=fe.size();
      |   ^