Language: C++

#include<bits/stdc++.h>
#define int long long
using namespace std;
typaedef pair<int,int> P;

int N;
vector<int> color[100010]; //color[i] = 0は無色、1は黒、2は白
vector<bool> 
vector<int> graph[100010];
int fennec[100010];
int snuke[100010];

void bfsf(int s)  {
    priority_queue<int,vector<int>,greater<int>> que;
    que.push(s);
    fennec[s] = 0;
    while(true) {
        int p = que.top();
        que.pop();
        bool update = false;
        for(int i = 0;i < graph[p].size();i++) {
            if(fennec[p] + 1 < fennec[graph[p].at(i)]) {
                fennec[graph[p].at(i)] = fennec[p] + 1;
                que.push(graph[p].at(i));
                update = true;
            }
        }
        if(update == false) {
            greak;
        }
    }
}

void bfss(int s)  {
    priority_queue<int,vector<int>,greater<int>> que;
    que.push(s);
    snuke[s] = 0;
    while(true) {
        int p = que.top();
        que.pop();
        bool update = false;
        for(int i = 0;i < graph[p].size();i++) {
            if(snuke[p] + 1 < snuke[graph[p].at(i)]) {
                snuke[graph[p].at(i)] = snuke[p] + 1;
                que.push(graph[p].at(i));
                update = true;
            }
        }
        if(update == false) {
            greak;
        }
    }
}

signed main() {
    cin >> N;
    for (int i = 0; i < N; i++) {
        int A,B;
        cin >> A >> B;
        graph[A - 1].push_back(B - 1);
        graph[B - 1].push_back(A - 1);
    }
    for(int i = 0;i < N;i++) {
        color(i) = 0;
    }
    bfsf(0);
    bfss(N - 1);
    int F = 0;
    int S = 0;
    for (int i = 0; i < N; i++) {
        if(fennec[i] > snuke[i]) {
            S++;
        }
        else {
            F++;
        }
    }
    if(S >= F) {
        cout << "snuke" << endl;
    }
    else {
        cout << "fennec" << endl;
    }
}

Compiler output:
a.cc:4:1: error: 'typaedef' does not name a type; did you mean 'typedef'?
    4 | typaedef pair<int,int> P;
      | ^~~~~~~~
      | typedef
a.cc:9:13: error: invalid declarator before 'graph'
    9 | vector<int> graph[100010];
      |             ^~~~~
a.cc: In function 'void bfsf(long long int)':
a.cc:21:27: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
   21 |         for(int i = 0;i < graph[p].size();i++) {
      |                           ^~~~~
      |                           isgraph
a.cc:29:13: error: 'greak' was not declared in this scope
   29 |             greak;
      |             ^~~~~
a.cc: In function 'void bfss(long long int)':
a.cc:42:27: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
   42 |         for(int i = 0;i < graph[p].size();i++) {
      |                           ^~~~~
      |                           isgraph
a.cc:50:13: error: 'greak' was not declared in this scope
   50 |             greak;
      |             ^~~~~
a.cc: In function 'int main()':
a.cc:60:9: error: 'graph' was not declared in this scope; did you mean 'isgraph'?
   60 |         graph[A - 1].push_back(B - 1);
      |         ^~~~~
      |         isgraph
a.cc:64:14: error: 'color' cannot be used as a function
   64 |         color(i) = 0;
      |         ~~~~~^~~