Language: C++

#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,x,y;
bool vis[300000];
vector<int>v[300000];
int dfs(int x){
  vis[x]=1;
  int res=1;
  for(int i=0;i<v[x].size();i++){
    if(!vis[v[x][i]]&&v[x][i]!=n){
      res+=dfs(v[x][i]);
    }
  }
  return res;
}
int dfs2(int x){
  vis[x]=1;
  int res=1;
  for(int i=0;i<v[x].size();i++){
    if(!vis[v[x][i]]&&v[x][i]!=1){
      res+=dfs2(v[x][i]);
    }
  }
  return res;
}
int dfs4(int x){
  vis[x]=1;
  int res=1;
  for(int i=0;i<v[x].size();i++){
    if(!vis[v[x][i]]){
      res+=dfs4(v[x][i]);
    }
  }
  return res;
}
int dfs3(int x,int d){
  if(x==1)return d;
  vis[x]=1;
  for(int i=0;i<v[x].size();i++){
    if(!vis[v[x][i]]){
      int p=dfs3(v[x][i],d+1);
      if(p)return p;
    }
  }
  return 0;
}
main(){
  cin>>n;
  r(i,n-1){
    cin>>x>>y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  memset(vis,0,sizeof(vis));
  int a1=dfs(1);
  memset(vis,0,sizeof(vis));
  int a2=dfs2(n);
  memset(vis,0,sizeof(vis));
  int a3=dfs3(n,0);
  if(a3%2)a1+=a3/2+1,a2+=a3/2;
  else a2+=a3/2,a1+=a3/2;
  if(a1>=a2)cout<<"Fennec"<<endl;
  else cout<<"Snuke"<<endl;
}#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int n,x,y;
bool vis[300000];
vector<int>v[300000];
int dfs(int x){
  vis[x]=1;
  int res=1;
  for(int i=0;i<v[x].size();i++){
    if(!vis[v[x][i]]&&v[x][i]!=n){
      res+=dfs(v[x][i]);
    }
  }
  return res;
}
int dfs2(int x){
  vis[x]=1;
  int res=1;
  for(int i=0;i<v[x].size();i++){
    if(!vis[v[x][i]]&&v[x][i]!=1){
      res+=dfs2(v[x][i]);
    }
  }
  return res;
}
int dfs4(int x){
  vis[x]=1;
  int res=1;
  for(int i=0;i<v[x].size();i++){
    if(!vis[v[x][i]]){
      res+=dfs4(v[x][i]);
    }
  }
  return res;
}
int dfs3(int x,int d){
  if(x==1)return d;
  vis[x]=1;
  for(int i=0;i<v[x].size();i++){
    if(!vis[v[x][i]]){
      int p=dfs3(v[x][i],d+1);
      if(p)return p;
    }
  }
  return 0;
}
main(){
  cin>>n;
  r(i,n-1){
    cin>>x>>y;
    v[x].push_back(y);
    v[y].push_back(x);
  }
  memset(vis,0,sizeof(vis));
  int a1=dfs(1);
  memset(vis,0,sizeof(vis));
  int a2=dfs2(n);
  memset(vis,0,sizeof(vis));
  int a3=dfs3(n,0);
  if(a3%2)a1+=a3/2+1,a2+=a3/2;
  else a2+=a3/2,a1+=a3/2;
  if(a1>=a2)cout<<"Fennec"<<endl;
  else cout<<"Snuke"<<endl;
}

Compiler output:
a.cc:65:2: error: stray '#' in program
   65 | }#include<bits/stdc++.h>
      |  ^
a.cc:48:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   48 | main(){
      | ^~~~
a.cc:65:3: error: 'include' does not name a type
   65 | }#include<bits/stdc++.h>
      |   ^~~~~~~
a.cc:68:5: error: redefinition of 'int n'
   68 | int n,x,y;
      |     ^
a.cc:4:5: note: 'int n' previously declared here
    4 | int n,x,y;
      |     ^
a.cc:68:7: error: redefinition of 'int x'
   68 | int n,x,y;
      |       ^
a.cc:4:7: note: 'int x' previously declared here
    4 | int n,x,y;
      |       ^
a.cc:68:9: error: redefinition of 'int y'
   68 | int n,x,y;
      |         ^
a.cc:4:9: note: 'int y' previously declared here
    4 | int n,x,y;
      |         ^
a.cc:69:6: error: redefinition of 'bool vis [300000]'
   69 | bool vis[300000];
      |      ^~~
a.cc:5:6: note: 'bool vis [300000]' previously declared here
    5 | bool vis[300000];
      |      ^~~
a.cc:70:12: error: redefinition of 'std::vector<int> v [300000]'
   70 | vector<int>v[300000];
      |            ^
a.cc:6:12: note: 'std::vector<int> v [300000]' previously declared here
    6 | vector<int>v[300000];
      |            ^
a.cc:71:5: error: redefinition of 'int dfs(int)'
   71 | int dfs(int x){
      |     ^~~
a.cc:7:5: note: 'int dfs(int)' previously defined here
    7 | int dfs(int x){
      |     ^~~
a.cc:81:5: error: redefinition of 'int dfs2(int)'
   81 | int dfs2(int x){
      |     ^~~~
a.cc:17:5: note: 'int dfs2(int)' previously defined here
   17 | int dfs2(int x){
      |     ^~~~
a.cc:91:5: error: redefinition of 'int dfs4(int)'
   91 | int dfs4(int x){
      |     ^~~~
a.cc:27:5: note: 'int dfs4(int)' previously defined here
   27 | int dfs4(int x){
      |     ^~~~
a.cc:101:5: error: redefinition of 'int dfs3(int, int)'
  101 | int dfs3(int x,int d){
      |     ^~~~
a.cc:37:5: note: 'int dfs3(int, int)' previously defined here
   37 | int dfs3(int x,int d){
      |     ^~~~
a.cc:112:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
  112 | main(){
      | ^~~~
a.cc:112:1: error: redefinition of 'int main()'
a.cc:48:1: note: 'int main()' previously defined here
   48 | main(){
      | ^~~~