Language: C++

#include <iostream>
#include <cmath>
using namespace std;
int end[100005],next[100005],last[100005],fu[10005],n,flag,son[100005];
int dfs(int p,int deep)
{
	int sum=0,t,b;
	if(p==n)flag=deep;
	if(son[p]==0)return 0;
	t=last[p];
	while(t)
	{
		b=end[t];
		sum+=1+dfs(b,deep+1);
		t=next[t];
	}
	return sum;
}
int main()
{
	int ans1,ans2,i,x,y,m,k=0;
	cin>>n;
	for(i=1;i<=n-1;i++)
	{
		cin>>x>>y;
		son[x]++;
		end[++k]=y;
		next[k]=last[x];
		last[x]=k;
		fu[y]=x;
	}
	ans1=dfs(1,1);
	m=flag-(flag/2+1)-1;
	for(i=1;i<=m;i++)
	{
		n=fu[n];
		flag--;
	}
	ans2=dfs(n,flag);
	if(ans1-ans2+1<=ans2)cout<<"Snuke";
	else cout<<"Fennec";
}

Compiler output:
a.cc: In function 'int dfs(int, int)':
a.cc:13:19: error: reference to 'end' is ambiguous
   13 |                 b=end[t];
      |                   ^~~
In file included from /usr/include/c++/14/string:53,
                 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/range_access.h:116:37: note: candidates are: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
/usr/include/c++/14/bits/range_access.h:115:31: note:                 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
  115 |   template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept;
      |                               ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
In file included from /usr/include/c++/14/bits/range_access.h:36:
/usr/include/c++/14/initializer_list:99:5: note:                 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
a.cc:4:5: note:                 'int end [100005]'
    4 | int end[100005],next[100005],last[100005],fu[10005],n,flag,son[100005];
      |     ^~~
a.cc:15:19: error: reference to 'next' is ambiguous
   15 |                 t=next[t];
      |                   ^~~~
In file included from /usr/include/c++/14/string:47:
/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:4:17: note:                 'int next [100005]'
    4 | int end[100005],next[100005],last[100005],fu[10005],n,flag,son[100005];
      |                 ^~~~
a.cc: In function 'int main()':
a.cc:27:17: error: reference to 'end' is ambiguous
   27 |                 end[++k]=y;
      |                 ^~~
/usr/include/c++/14/bits/range_access.h:116:37: note: candidates are: 'template<class _Tp> const _Tp* std::end(const valarray<_Tp>&)'
  116 |   template<typename _Tp> const _Tp* end(const valarray<_Tp>&) noexcept;
      |                                     ^~~
/usr/include/c++/14/bits/range_access.h:115:31: note:                 'template<class _Tp> _Tp* std::end(valarray<_Tp>&)'
  115 |   template<typename _Tp> _Tp* end(valarray<_Tp>&) noexcept;
      |                               ^~~
/usr/include/c++/14/bits/range_access.h:106:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::end(_Tp (&)[_Nm])'
  106 |     end(_Tp (&__arr)[_Nm]) noexcept
      |     ^~~
/usr/include/c++/14/bits/range_access.h:85:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(const _Container&)'
   85 |     end(const _Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/bits/range_access.h:74:5: note:                 'template<class _Container> constexpr decltype (__cont.end()) std::end(_Container&)'
   74 |     end(_Container& __cont) -> decltype(__cont.end())
      |     ^~~
/usr/include/c++/14/initializer_list:99:5: note:                 'template<class _Tp> constexpr const _Tp* std::end(initializer_list<_Tp>)'
   99 |     end(initializer_list<_Tp> __ils) noexcept
      |     ^~~
a.cc:4:5: note:                 'int end [100005]'
    4 | int end[100005],next[100005],last[100005],fu[10005],n,flag,son[100005];
      |     ^~~
a.cc:28:17: error: reference to 'next' is ambiguous
   28 |                 next[k]=last[x];
      |                 ^~~~
/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:4:17: note:                 'int next [100005]'
    4 | int end[100005],next[100005],last[100005],fu[10005],n,flag,son[100005];
      |                 ^~~~