Language: C++

        int v = n - 1;

        while (true) {
                path.push_back(v);
                v = parent[v];
                if (v == 0) break;
        }
        path.push_back(v);

        reverse(path);

        int length = path.size() - 1;
        return path[length / 2 + 1];
}

int main() {
        int i;

        cin >> n;
        for (i = 0; i < n - 1; i++) {
                int a, b;
                cin >> a >> b;
                a--;
                b--;
                et[a].push_back(b);
                et[b].push_back(a);
        }
        dfs(0, -1, 0);
        // for (i = 0; i < n - 1; i++) {
    //     cout << i << ": " << dist[i];
    //     cout << ", parent" << ": " << parent[i] << endl;
    // }
        int v = getCut();
        // int v = getCut();
    int len = dist[v];

    int get_node_num = 0;
        for (i = 0; i < n - 1; i++) {
        if(dist[i] < len)
            ++get_node_num;
    }

        if (get_node_num < n - get_node_num) { cout << "Snuke" << endl; }
        else { cout << "Fennec" << endl; }
        return 0;
}


Compiler output:
a.cc:1:17: error: 'n' was not declared in this scope
    1 |         int v = n - 1;
      |                 ^
a.cc:3:9: error: expected unqualified-id before 'while'
    3 |         while (true) {
      |         ^~~~~
a.cc:8:9: error: 'path' does not name a type
    8 |         path.push_back(v);
      |         ^~~~
a.cc:10:16: error: expected constructor, destructor, or type conversion before '(' token
   10 |         reverse(path);
      |                ^
a.cc:12:22: error: 'path' was not declared in this scope
   12 |         int length = path.size() - 1;
      |                      ^~~~
a.cc:13:9: error: expected unqualified-id before 'return'
   13 |         return path[length / 2 + 1];
      |         ^~~~~~
a.cc:14:1: error: expected declaration before '}' token
   14 | }
      | ^
a.cc: In function 'int main()':
a.cc:19:9: error: 'cin' was not declared in this scope
   19 |         cin >> n;
      |         ^~~
a.cc:19:16: error: 'n' was not declared in this scope
   19 |         cin >> n;
      |                ^
a.cc:25:17: error: 'et' was not declared in this scope
   25 |                 et[a].push_back(b);
      |                 ^~
a.cc:28:9: error: 'dfs' was not declared in this scope
   28 |         dfs(0, -1, 0);
      |         ^~~
a.cc:33:17: error: 'getCut' was not declared in this scope
   33 |         int v = getCut();
      |                 ^~~~~~
a.cc:35:15: error: 'dist' was not declared in this scope
   35 |     int len = dist[v];
      |               ^~~~
a.cc:43:48: error: 'cout' was not declared in this scope
   43 |         if (get_node_num < n - get_node_num) { cout << "Snuke" << endl; }
      |                                                ^~~~
a.cc:43:67: error: 'endl' was not declared in this scope
   43 |         if (get_node_num < n - get_node_num) { cout << "Snuke" << endl; }
      |                                                                   ^~~~
a.cc:44:16: error: 'cout' was not declared in this scope
   44 |         else { cout << "Fennec" << endl; }
      |                ^~~~
a.cc:44:36: error: 'endl' was not declared in this scope
   44 |         else { cout << "Fennec" << endl; }
      |                                    ^~~~