Language: C++



#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>

auto& in = std::cin;
auto& out = std::cout;


#include <queue>
#include <vector>
#include <functional>
#include <utility>
#include <algorithm>
#include <iterator>

using COST_T = uint32_t;
constexpr uint32_t N_MAX = 100000;
constexpr COST_T INF = 1000000000 + 1000;//std::numeric_limits<double>::infinity()

#if defined(_MSC_VER) && defined(_DEBUG)
//static_assert(false, "リリースでコンパイルしないと遅いよ！！");
#endif


std::vector<int32_t> graph[N_MAX];//木

//ダイクストラ
COST_T D1[N_MAX];
COST_T D2[N_MAX];
void Dijkstra(uint32_t s, COST_T(&D)[N_MAX])
{
	using P = std::pair<COST_T, uint32_t>;//cost pos
	std::priority_queue<P, std::vector<P>, std::greater<>> que;
	std::fill(std::begin(D), std::end(D), INF);

	D[s] = 0;
	que.emplace(0, s);
	while (!que.empty())
	{
		auto p = que.top(); que.pop();
		const auto& nowpos = p.second;
		const auto& nowcost = p.first;
		if (D[nowpos] < nowcost) { continue; }

		//for (int32_t to = 0; to < N; ++to)
		//{
		//	auto cost = nowcost + graph[nowpos][to];
		//	if (cost < D[to]) {
		//		D[to] = cost;
		//		que.emplace(D[to], to);
		//	}
		//}

		for (const auto& e : graph[nowpos])
		{
			auto cost = nowcost + e.cost;
			if (cost < D[e.to]) {
				D[e.to] = cost;
				que.emplace(cost, e.to);
			}
		}

	}
}
void input_tree()
{
	in >> N;
	for (int32_t i = 0; i < N - 1; ++i)
	{
		int a, b;
		in >> a >> b; --a; --b;
		graph[a].push_back(b);
		graph[b].push_back(a);
	}
}
int32_t N;

int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);

	input_tree();
	Dijkstra(0, D1);
	Dijkstra(N-1, D2);
	int32_t f = 0,s=0;
	for (int32_t i = 0; i < N; ++i)
	{
		if (D1[i] <= D2[i]) { ++f; }
		else { ++s; }
	}
	if (f > s) {
		out << "Fennec" << endl;
	}
	else {
		out << "Snuke" << endl;
	}

	return 0;
}
#endif


Compiler output:
a.cc: In function 'void Dijkstra(uint32_t, COST_T (&)[100000])':
a.cc:76:49: error: request for member 'cost' in 'e', which is of non-class type 'const int'
   76 |                         auto cost = nowcost + e.cost;
      |                                                 ^~~~
a.cc:77:40: error: request for member 'to' in 'e', which is of non-class type 'const int'
   77 |                         if (cost < D[e.to]) {
      |                                        ^~
a.cc:78:37: error: request for member 'to' in 'e', which is of non-class type 'const int'
   78 |                                 D[e.to] = cost;
      |                                     ^~
a.cc:79:53: error: request for member 'to' in 'e', which is of non-class type 'const int'
   79 |                                 que.emplace(cost, e.to);
      |                                                     ^~
a.cc: In function 'void input_tree()':
a.cc:87:15: error: 'N' was not declared in this scope
   87 |         in >> N;
      |               ^