Language: C++

#include <bits/stdc++.h>  
#include <memory>
using namespace std;  
#define INF 0x3f3f3f3f  
typedef long long ll;  
const int N =  100005;  
#define FI first
#define SE second
typedef pair<int, int>pii;
int mod = 1000000007;
vector<int> tr[N];
int dep, n;
int next[N];
bool vis[N];
void dfs(int u, int pre, int d)
{
   
   if (u == n)
   {
      dep = d;
      next[pre] = u;
   }
   for (int i = 0; i < tr[u].size(); i++)
   {
      int v = tr[u][i];
      if (pre != v)
      {
         dfs(v, u, d + 1);
         if (~next[v])
            next[u] = v;
      }
   }

}
void white(int u, int pre, int &cnt)
{
   cnt++;
   for (int i = 0; i < tr[u].size(); i++)
   {
      int v = tr[u][i];
      if (!vis[v] && v != pre)
         white(v, u, cnt);
   }
}
int main()  
{  

   // ios::sync_with_stdio(0);
   while (~scanf("%d", &n))
   {
      int a, b;
      for (int i = 0; i < n; i++)
         tr[i].clear();
      memset(next, -1, sizeof(next));
      memset(vis, 0, sizeof(vis));
      for (int i = 1; i < n; i++)
      {
         scanf("%d%d", &a, &b);
         tr[a].push_back(b);
         tr[b].push_back(a);
      }
      dep = 0;
      dfs(1, -1, 1);
      dep -= 2;
      dep = (dep&1) + (dep>>1);
      int cur = 1;
      vis[1] = true;
      while (dep--)
      {
         vis[next[cur]] = true;
         cur = next[cur];
      }
      int cnt = 0;
      white(n, -1, cnt);
      int f = n - cnt;
      cnt--;
      f--;
      // printf("f:%d s:%d\n", f, cnt);
      printf("%s\n", f <= cnt?"Snuke":"Fennec");
   }
   return 0;
}  

Compiler output:
a.cc: In function 'void dfs(int, int, int)':
a.cc:21:7: error: reference to 'next' is ambiguous
   21 |       next[pre] = u;
      |       ^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:66,
                 from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:13:5: note:                 'int next [100005]'
   13 | int next[N];
      |     ^~~~
a.cc:29:15: error: reference to 'next' is ambiguous
   29 |          if (~next[v])
      |               ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:13:5: note:                 'int next [100005]'
   13 | int next[N];
      |     ^~~~
a.cc:30:13: error: reference to 'next' is ambiguous
   30 |             next[u] = v;
      |             ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:13:5: note:                 'int next [100005]'
   13 | int next[N];
      |     ^~~~
a.cc: In function 'int main()':
a.cc:54:14: error: reference to 'next' is ambiguous
   54 |       memset(next, -1, sizeof(next));
      |              ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:13:5: note:                 'int next [100005]'
   13 | int next[N];
      |     ^~~~
a.cc:54:31: error: reference to 'next' is ambiguous
   54 |       memset(next, -1, sizeof(next));
      |                               ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:13:5: note:                 'int next [100005]'
   13 | int next[N];
      |     ^~~~
a.cc:70:14: error: reference to 'next' is ambiguous
   70 |          vis[next[cur]] = true;
      |              ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:13:5: note:                 'int next [100005]'
   13 | int next[N];
      |     ^~~~
a.cc:71:16: error: reference to 'next' is ambiguous
   71 |          cur = next[cur];
      |                ^~~~
/usr/include/c++/14/bits/stl_iterator_base_funcs.h:232:5: note: candidates are: 'template<class _InputIterator> constexpr _InputIterator std::next(_InputIterator, typename iterator_traits<_Iter>::difference_type)'
  232 |     next(_InputIterator __x, typename
      |     ^~~~
a.cc:13:5: note:                 'int next [100005]'
   13 | int next[N];
      |     ^~~~