criyle/codenet-compile-errors huggingface dataset:
Language: Java

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

    private final static Scanner sc = new Scanner(System.in);

    /**
     * 本処理を実行します。
     */
    public static void execute() {
        int n = nextInt();
        List<Integer> a = nextInts(n);
        int size = a.size();

        int result = Integer.MAX_VALUE;
        if (size == 2) {
            result = Math.abs(a.get(0) - a.get(1));
        } else {
            for (int i = 0; i < size - 1; i++) {
                List<Integer> before = a.subList(0, i + 1);
                List<Integer> after = a.subList(i + 1, size);

                int beforeSum = before.parallelStream().mapToInt(bi -> bi).sum();
                int afterSum = after.parallelStream().mapToInt(ai -> ai).sum();
                int absSum = Math.abs(beforeSum - afterSum);

                if (absSum < result) {
                    result = absSum;
                }
            }
        }

        out(result);
    }

    /**
     * 次の標準入力をintで受け取ります。
     * @return 標準入力値(int)
     */
    public static int nextInt() {
        return sc.nextInt();
    }

    /**
     * 次の標準入力をStringで受け取ります。
     * @return 標準入力値(String)
     */
    public static String nextString() {
        return sc.next();
    }

    /**
     * 次の標準入力を指定回数分intで受け取ります。
     * @param n 取得回数
     * @return 取得した標準入力値の配列(int)
     */
    public static List<Integer> nextInts(int n) {
        List<Integer> list = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            list.add(nextInt());
        }

        return list;
    }

    /**
     * 標準出力にオブジェクトを出力します。
     * @param o 出力対象
     */
    public static void out(Object o) {
        System.out.println(o);
    }

    public static void main(String[] args) {
        execute();
    }

Compiler output:
Main.java:79: error: reached end of file while parsing
    }
     ^
1 error
Language: C++

#include <bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
ll n,i,j,k,s;
cin>>n;
s=0;
vector<int> a(n+1),b(n+1);
for(i=1;i<=n;i++){
    cin>>j;
    b[i]=j+b[i-1];
}
ll d=2e9+1;
for(i=1;i<=n-1;i++){
    d=min(d,abs(b[n]-2*b[i]));
}
cout<<d;

}

Compiler output:
a.cc: In function 'int main()':
a.cc:17:10: error: no matching function for call to 'min(long long int&, int)'
   17 |     d=min(d,abs(b[n]-2*b[i]));
      |       ~~~^~~~~~~~~~~~~~~~~~~~
In file included 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_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:17:10: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   17 |     d=min(d,abs(b[n]-2*b[i]));
      |       ~~~^~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:17:10: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   17 |     d=min(d,abs(b[n]-2*b[i]));
      |       ~~~^~~~~~~~~~~~~~~~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <numeric>
#include <cmath>
using namespace std;

int main(){
	int n,s,sum;
	cin >> n;
	vector<int>a(n),b(n - 1);
	for(auto& v : a){
		cin >> v;
	}
	s = sum = accumulate(a.begin(),a.end(),0);

	for(int i = 0; i < n - 1; ++i){
		sum -= a[i];
		b[i] = sum;
	}

	int out=INT_MAX;
	for(auto d : b){
		if(abs(d - (s - d))<out){
			out = abs(d - (s - d));
		}
	}

	cout << out << endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:21:17: error: 'INT_MAX' was not declared in this scope
   21 |         int out=INT_MAX;
      |                 ^~~~~~~
a.cc:5:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    4 | #include <cmath>
  +++ |+#include <climits>
    5 | using namespace std;
Language: C++

#include<iostream>
using namespace std;

long long abs(long long x){
  if(x < 0){
    return -x;
  }
  else{
    return x;
  }
}

int n;
long long a[200005], s[200005];

int main(void){
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  for(int i = 0; i < n; i++){
    s[i + 1] = a[i] + s[i];
  }
  long long m = 2 * s[1] - s[n];
  for(int i = 1; i < n; i++){
    m = min(m, abs(2 * s[i] - s[n]));
  }
  cout << m << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:19: error: call of overloaded 'abs(long long int)' is ambiguous
   26 |     m = min(m, abs(2 * s[i] - s[n]));
      |                ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 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/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
a.cc:4:11: note: candidate: 'long long int abs(long long int)'
    4 | long long abs(long long x){
      |           ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
Language: C++

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

int main()
{
int n,i,j,k,s;
cin>>n;
s=0;
vector<int> a(n+1),b(n+1);
for(i=1;i<=n;i++){
    cin>>j;
    b[i]=j+b[i-1];
}
int d=2e9+1;
for(i=1;i<=n-1;i++){
    d=min(d,abs(b[n]-2*b[i]));
}
cout<<d;

}

Compiler output:
cc1plus: error: '::main' must return 'int'
Language: C++

#include <iostream>
#include <limits>
#include <algorithm>
using namespace std;

int a[200011];

int f( int l, int r ) {
    int sum = 0;
    int i;
    for ( i = l; i <= r; i++ ) {
        sum += a[i];
    }
    return sum;
}

int main()
{
    int n;
    cin >> n;

    int i;
    for ( i = 1; i <= n; i++ ) {
        cin >>a[i];
    }

    int sum1 = 0, sum2 = 0;

    int sumT = f(1, n);

    int Min = INT_MAX;

    for ( i = 1; i < n; i++ ) {
        sum1 = f(1, i);
        sum2 = sumT - sum1;
        if ( abs(sum1 - sum2) < Min ) {
            Min = abs(sum1 - sum2);
        }
    }

    cout << Min;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:15: error: 'INT_MAX' was not declared in this scope
   31 |     int Min = INT_MAX;
      |               ^~~~~~~
a.cc:4:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <algorithm>
  +++ |+#include <climits>
    4 | using namespace std;
Language: C++

#include<iostream>
using namespace std;

long long int abs(long long int x){
  if(x < 0){
    return -x;
  }
  else{
    return x;
  }
}

int n;
long long int a[200005], s[200005];

int main(void){
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  for(int i = 0; i < n; i++){
    s[i + 1] = a[i] + s[i];
  }
  long long int m = 2 * s[1] - s[n];
  for(int i = 1; i < n; i++){
    m = min(m, abs(2 * s[i] - s[n]));
  }
  cout << m << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:19: error: call of overloaded 'abs(long long int)' is ambiguous
   26 |     m = min(m, abs(2 * s[i] - s[n]));
      |                ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 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/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
a.cc:4:15: note: candidate: 'long long int abs(long long int)'
    4 | long long int abs(long long int x){
      |               ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
Language: C++

#include <stdio.h>
#include <limits.h>
#include <stdlib.h>

int abs(int i){
  if(i < 0)
    return -1 * i;

  return i;
}

int main(void){
  int *c;
  int n;
  scanf("%d",&n);

  c = malloc(sizeof(int) * n);

  int sum = 0;
  int i;
  for(i = 0; i < n;i++){
    scanf("%d",&c[i]);
    sum += c[i];
  }

  int res = INT_MAX;
  int sunuke = 0;
  for(i = 0; i < n - 1;i++){
    sunuke += c[i];
    sum -= c[i];
    if(abs(sunuke - sum) < res)
      res = abs(sunuke - sum);
  }

  printf("%d\n",res);

  free(c);
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:17:13: error: invalid conversion from 'void*' to 'int*' [-fpermissive]
   17 |   c = malloc(sizeof(int) * n);
      |       ~~~~~~^~~~~~~~~~~~~~~~~
      |             |
      |             void*
Language: C++

#include <iostream>
#include <sstream>
#include <iomanip>
#include <limits>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;
const int MAXN = 1001000;
const int MOD = 1000000007;
const int INF = INT_MAX;

long long sum[MAXN];

int main()
{
	long long n, a;
	memset(sum, 0, sizeof(sum));

	cin >> n;
	for (int i = 1; i <= n; ++i)
	{
		cin >> a;
		sum[i] = sum[i - 1] + a;
	}

	long long ans = INF;
	for (int i = 1; i < n; ++i)
		ans = min(ans, abs(sum[n] - sum[i] - sum[i]));
	cout << ans << endl;

	//system("pause");
	return 0;
}

Compiler output:
a.cc:19:17: error: 'INT_MAX' was not declared in this scope
   19 | const int INF = INT_MAX;
      |                 ^~~~~~~
a.cc:15:1: note: 'INT_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
   14 | #include <cstring>
  +++ |+#include <climits>
   15 |
Language: C++

#include<iostream>
using namespace std;

long long int abs(long long int x){
  if(x < 0){
    return -x;
  }
  else{
    return x;
  }
}

int n;
long long int a[200005], s[200005];

int main(void){
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  for(int i = 0; i < n; i++){
    s[i + 1] = a[i] + s[i];
  }
  long long int m = s[n];
  for(int i = 1; i < n; i++){
    m = min(m, abs(2 * s[i] - s[n]));
  }
  cout << m << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:19: error: call of overloaded 'abs(long long int)' is ambiguous
   26 |     m = min(m, abs(2 * s[i] - s[n]));
      |                ~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/c++/14/ext/string_conversions.h:43,
                 from /usr/include/c++/14/bits/basic_string.h:4154,
                 from /usr/include/c++/14/string:54,
                 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/stdlib.h:980:12: note: candidate: 'int abs(int)'
  980 | extern int abs (int __x) __THROW __attribute__ ((__const__)) __wur;
      |            ^~~
a.cc:4:15: note: candidate: 'long long int abs(long long int)'
    4 | long long int abs(long long int x){
      |               ^~~
In file included from /usr/include/c++/14/cstdlib:81:
/usr/include/c++/14/bits/std_abs.h:137:3: note: candidate: 'constexpr __float128 std::abs(__float128)'
  137 |   abs(__float128 __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:85:3: note: candidate: 'constexpr __int128 std::abs(__int128)'
   85 |   abs(__GLIBCXX_TYPE_INT_N_0 __x) { return __x >= 0 ? __x : -__x; }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:79:3: note: candidate: 'constexpr long double std::abs(long double)'
   79 |   abs(long double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:75:3: note: candidate: 'constexpr float std::abs(float)'
   75 |   abs(float __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:71:3: note: candidate: 'constexpr double std::abs(double)'
   71 |   abs(double __x)
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:61:3: note: candidate: 'long long int std::abs(long long int)'
   61 |   abs(long long __x) { return __builtin_llabs (__x); }
      |   ^~~
/usr/include/c++/14/bits/std_abs.h:56:3: note: candidate: 'long int std::abs(long int)'
   56 |   abs(long __i) { return __builtin_labs(__i); }
      |   ^~~
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <cstdio>
#include <cmath>
#include <sstream>
#include <algorithm>

using namespace std;

int main() {
	int N;
	cin >> N;
	vector<long long> card;
	for (int i = 0; i < N; i++) {
		long long t;
		cin >> t;
		if (i != 0) {
			card.push_back(t + card[i - 1]);
		}
		else {
			card.push_back(t);
		}
	}
	long long total = card[N - 1];

	int count = 0;
	long long min = LLONG_MAX - 1;
	for (int i = 0; i < N - 1; i++) {
		long long x, y, z;
		x = card[i];
		y = total - card[i];
		z = abs(x - y);
		if (min > z) {
			min = z;
		}
	}
	cout << min << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:25: error: 'LLONG_MAX' was not declared in this scope
   29 |         long long min = LLONG_MAX - 1;
      |                         ^~~~~~~~~
a.cc:9:1: note: 'LLONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    8 | #include <algorithm>
  +++ |+#include <climits>
    9 |
Language: C++

#include<iostream>
using namespace std;

int abs(int x){
  if(x < 0){
    return -x;
  }
  else{
    return x;
  }
}

int n;
long long int a[200005], s[200005];

int main(void){
  cin >> n;
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  for(int i = 0; i < n; i++){
    s[i + 1] = a[i] + s[i];
  }
  int m = s[n];
  for(int i = 1; i < n; i++){
    m = min(m, abs(2 * s[i] - s[n]));
  }
  cout << m << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:12: error: no matching function for call to 'min(int&, long long int)'
   26 |     m = min(m, abs(2 * s[i] - s[n]));
      |         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 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/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:26:12: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   26 |     m = min(m, abs(2 * s[i] - s[n]));
      |         ~~~^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
Language: C++

//#include<bits/stdc++.h>
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<map>
#include<stack>
#include<cmath>
#define lowbit(x) ((x)&(-x))
#define Max(a,b) (a>b?a:b)
#define Min(a,b) (a>b?b:a)
#define INF 0x3f3f3f3f
#define sz size()
#define pb push_back
#define ph push
#define mem(x, y) memset(x, y, sizeof(x));
#define mem0(x) mem(x,0)
#define mem1(x) mem(x,-1)
#define memINF(x) mem(x,INF)
#define all(x) x.begin(),x.end()
#define fi first
#define se second
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define per(i,a,b) for(int i=a;i>(b);--i)
using namespace std;
typedef __int64 ll;

int const Max_N = 1e6+5;
ll a[Max_N];
ll sum[Max_N] = {0};
int main()
{
 	int N;
	cin >> N;
	rep(i,1,N+1)
	{
		cin >> a[i];
		sum[i] += sum[i-1] + a[i];
	}


	ll ans = 1e18;
	rep(i,1,N)
	{
	//	cout << sum[i] << endl;
	//	cout << sum[N] - 2*sum[i] << endl;
		ans = min(ans,abs(sum[N] - 2*sum[i]));
	}
	cout << ans << endl;
	return 0;
}
	//freopen("in.txt","r",stdin);
//std::ios::sync_with_stdio(false);



Compiler output:
a.cc:29:9: error: '__int64' does not name a type; did you mean '__int64_t'?
   29 | typedef __int64 ll;
      |         ^~~~~~~
      |         __int64_t
a.cc:32:1: error: 'll' does not name a type; did you mean 'all'?
   32 | ll a[Max_N];
      | ^~
      | all
a.cc:33:1: error: 'll' does not name a type; did you mean 'all'?
   33 | ll sum[Max_N] = {0};
      | ^~
      | all
a.cc: In function 'int main()':
a.cc:40:24: error: 'a' was not declared in this scope
   40 |                 cin >> a[i];
      |                        ^
a.cc:41:17: error: 'sum' was not declared in this scope
   41 |                 sum[i] += sum[i-1] + a[i];
      |                 ^~~
a.cc:45:9: error: 'll' was not declared in this scope; did you mean 'all'?
   45 |         ll ans = 1e18;
      |         ^~
      |         all
a.cc:50:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   50 |                 ans = min(ans,abs(sum[N] - 2*sum[i]));
      |                 ^~~
      |                 abs
a.cc:50:35: error: 'sum' was not declared in this scope
   50 |                 ans = min(ans,abs(sum[N] - 2*sum[i]));
      |                                   ^~~
a.cc:52:17: error: 'ans' was not declared in this scope; did you mean 'abs'?
   52 |         cout << ans << endl;
      |                 ^~~
      |                 abs
Language: C++

#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main()
{
	long N;
	long ans = LONG_MAX;
	cin >> N;

	vector<int> A(N);
	vector<long> subSum(N);
	for (int i = 0; i < N; i++)
	{
		cin >> A[i];

		if (i > 0)
			subSum[i] = subSum[i - 1] + A[i];
		else
			subSum[i] = A[i];
	}

	long sum = subSum[N - 1];
	for (int i = 0; i < N - 1; i++)
	{
		long num = abs(subSum[i] - (sum - subSum[i]));
		if (ans > num)
			ans = num;
	}

	cout << ans << endl;

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:10:20: error: 'LONG_MAX' was not declared in this scope
   10 |         long ans = LONG_MAX;
      |                    ^~~~~~~~
a.cc:4:1: note: 'LONG_MAX' is defined in header '<climits>'; this is probably fixable by adding '#include <climits>'
    3 | #include <cmath>
  +++ |+#include <climits>
    4 |
Language: C++

#include <bits/stdc++.h>
#dedine int long long
using namespace std;


/* エイリアス */
#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define endl '\n'

#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define em emplace


/* 関数マクロ */
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, n, m) for (ll i = n; i <= m; ++i)
#define rep3(i, n, m) for (ll i = n; i >= m; --i)
#define all(v) v.begin(), v.end()
#define si(v) int(v.size())
#define UNIQUE(v) sort(all(v)), v.erase(unique(all(v)),v.end())


/* 定数 */
const ll mod = 1e9 + 7;
const ll infll = (1LL << 62) - 1;
const ll inf = (1LL << 30) - 1;


/* その他 */
template<class S, class T> inline bool chmax(S &a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class S, class T> inline bool chmin(S &a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> using pq = priority_queue<T>;
template<class T> using pqg = priority_queue<T, vector<T>, greater<T>>;

int n;
vector<vi> edge(100001);

vi dijkstra(int start)
{
  vi ret(n, inf);
  ret[start] = 0;
  pqg<pii> que;
  que.em(0, start);

  while (!que.empty()) {
    pii p = que.top(); que.pop();

    int d = p.fi, v = p.se;
    if (ret[v] < d) continue;

    for (auto to : edge[v]) {
      if (ret[to] > d + 1) {
        ret[to] = d + 1;
        que.em(d + 1, to);
      }
    }
  }
  
  return ret;
}

signed main()
{
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);
  
  cin >> n;

  rep(i, n-1) {
    int a, b; cin >> a >> b;
    edge[a-1].eb(b-1);
    edge[b-1].eb(a-1);
  }

  auto black = dijkstra(0);
  auto white = dijkstra(n-1);

  int b = 0, w = 0;
  rep(i, n) {
    if (black[i] <= white[i]) ++b;
    else ++w;
  }
  
  if (b > w) cout << "Fennec" << endl;
  else cout << "Snuke" << endl;
}


Compiler output:
a.cc:2:2: error: invalid preprocessing directive #dedine; did you mean #define?
    2 | #dedine int long long
      |  ^~~~~~
      |  define
Language: C++

#include <bits/stdc++.h>
#define REP(i, n) for(long long i=0; i<n; i++)
#define REPR(i, n) for(long long i=n-1; i>=0; i--)
#define FOR(i, m, n) for(long long i=m; i<=n; i++)
#define FORR(i, m, n) for(long long i=m; i>=n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;
using ll = long long;
using ull = unsigned long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;
const ll inf = 1e15;
ll power(ll a,ll b){return b?power(a*a%mod,b/2)*(b%2?a:1)%mod:1;}


int main(){FIN
    
    ll n;cin>>n;
    vvll path(n);
    REP(i,n-1) {
        ll aa, bb;cin>>aa>>bb;
        aa--; bb--;
        path[aa].push_back(bb);
        path[bb].push_back(aa);
    }

    vll vis(n,0);

    queue<ll> que1, que2;
    que1.push(0); que2.push(n-1);
    ll c1=0, c2=0;


    while(que1.size() && que2.size()){      

        REP(i,que1.size()){
            ll p = que1.front();
            que1.pop();
            vis[p]=1;
            c1++;
            for(auto pp: path[p]){
                if (vis[pp]==0) {que1.push(pp); vis[pp]=1;}
            }
        }

        REP(i,que2.size()){
            ll p = que2.front();
            que2.pop();
            vis[p]=1;
            c2++;
            for(auto pp: path[p]){
                if (vis[pp]==0) {que2.push(pp); vis[pp]=1:}
            }
        }

    }
    if(c2>=c1) cout<<"Snuke"<<endl;
    else cout<<"Fennec"<<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:58: error: expected ';' before ':' token
   59 |                 if (vis[pp]==0) {que2.push(pp); vis[pp]=1:}
      |                                                          ^
      |                                                          ;
Language: C++

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);
static const int INF = 1e9+7;



/*

BFSで距離を求める．
1からの距離 <= N からの距離　ならば黒
1からの距離 > N からの距離　ならば白
*/
using Graph = vector<vector<int>>;

int main(){
  int N;
  cin >> N;

  Graph G(N);

  REP(i,N-1){
    int a, b;
    cin >> a >>b;
    --a; --b;
    G[a].push_back(b);
    G[b].push_back(a);
  }

  vector<int> distf(N, -1); //未訪問に初期化
  queue<int> que;

  //init
  distf[0] = 0;
  que.push(0);

  //BFS
  while(!que.empty()){
    int v = que.front(); que.pop();

    for( int nv : G[v]){
      if( distf[nv] != -1) continue;
      distf[nv] = distf[v] + 1;
      que.push(nv);
    }

  }

   //REP(i,N) cout << i << ": " << distf[i] << endl;


   vector<int> dists(N, -1); //未訪問に初期化
   queue<int> ques;

   //init
   dists[0] = 0;
   ques.push(0);

   //BFS
   while(!ques.empty()){
     int v = ques.front(); ques.pop();

     for( int nv : G[v]){
       if( dists[nv] != -1) continue;
       dists[nv] = dists[v] + 1;
       ques.push(nv);
     }

   }

   REP(i,n){
     if(distf[i] <= dists[i]) ++cntf;
     else ++cnts;
   }

   if(cntf > cnts) cout << "Fennec" << endl;
   else cout << "Sunuke" << endl;




  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:77:10: error: 'n' was not declared in this scope
   77 |    REP(i,n){
      |          ^
a.cc:2:38: note: in definition of macro 'REP'
    2 | #define REP(i,n) for (int i = 0; i <(n); ++i)
      |                                      ^
a.cc:78:33: error: 'cntf' was not declared in this scope
   78 |      if(distf[i] <= dists[i]) ++cntf;
      |                                 ^~~~
a.cc:79:13: error: 'cnts' was not declared in this scope
   79 |      else ++cnts;
      |             ^~~~
a.cc:82:7: error: 'cntf' was not declared in this scope
   82 |    if(cntf > cnts) cout << "Fennec" << endl;
      |       ^~~~
a.cc:82:14: error: 'cnts' was not declared in this scope
   82 |    if(cntf > cnts) cout << "Fennec" << endl;
      |              ^~~~
Language: C++

use std::io::*;
const INF: usize = 1 << 30;

fn dfs(v: usize, p: usize, d: &mut Vec<usize>, g: &Vec<Vec<usize>>) {
    for &nv in g[v].iter() {
        if nv != p {
            d[nv] = d[v] + 1;
            dfs(nv, v, d, &g);
        }
    }
}
fn main() {
    let mut s: String = String::new();
    stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let n: usize = itr.next().unwrap().parse().unwrap();
    let mut g = vec![Vec::new(); n];
    for _ in 1..n {
        let a = itr.next().unwrap().parse::<usize>().unwrap() - 1;
        let b = itr.next().unwrap().parse::<usize>().unwrap() - 1;
        g[a].push(b);
        g[b].push(a);
    }

    // 0から / n - 1から
    let mut d1 = vec![INF; n];
    let mut d2 = vec![INF; n];
    d1[0] = 0;
    d2[n - 1] = 0;
    dfs(0, 0, &mut d1, &g);
    dfs(n - 1, n - 1, &mut d2, &g);

    let mut w = 0;
    let mut b = 0;
    for i in 0..n {
        if d1[i] <= d2[i] {
            b += 1;
        } else {
            w += 1;
        }
    }
    if b > w {
        println!("Fennec");
    } else {
        println!("Snuke");
    }
}


Compiler output:
a.cc:18:14: error: too many decimal points in number
   18 |     for _ in 1..n {
      |              ^~~~
a.cc:35:14: error: too many decimal points in number
   35 |     for i in 0..n {
      |              ^~~~
a.cc:1:1: error: 'use' does not name a type
    1 | use std::io::*;
      | ^~~
a.cc:2:10: error: found ':' in nested-name-specifier, expected '::'
    2 | const INF: usize = 1 << 30;
      |          ^
      |          ::
a.cc:2:7: error: 'INF' does not name a type
    2 | const INF: usize = 1 << 30;
      |       ^~~
a.cc:4:1: error: 'fn' does not name a type
    4 | fn dfs(v: usize, p: usize, d: &mut Vec<usize>, g: &Vec<Vec<usize>>) {
      | ^~
a.cc:12:1: error: 'fn' does not name a type
   12 | fn main() {
      | ^~
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int INF =1001001001;

void dfs(int x, int n, int count, vector<vector<int>> graph, vector<int> &dist, vector<bool> &visit){
   visit[x] = true;
   dist[x] = count;
  // printf("dist:%d\n",dist[x]);
   ++count;
   for(auto g :graph[x]){
      if(visit[g]) continue;
      dfs(g,n,count,graph,dist,visit);
   }
}

int main()
{   
   int n;
   cin >> n;

   // 5-7-4-1-2 
   //       L3-6
   // 1-4-2-3
   vector<vector<ll>> graph(n);
   vector<int> distA(n);
   vector<int> distB(n);
   vector<bool> visit(n);


   rep(i,n-1){
      int a,b;
      cin >> a >> b;
      --a; --b;
      graph[a].push_back(b);
      graph[b].push_back(a);
   }

   //それぞれからの距離を求める
   //フェネックA
   dfs(0,n,0,graph, distA,visit);
   //リセット
   rep(i,n) visit[i] = false;
   //スヌケ
   dfs(n-1,n,0,graph, distB, visit);

   int A = 0;
   int B = 0;

   rep(i,n){
      if(distA[i] <= distB[i]) A++;
      else B++;
   }
  // rep(i,n) printf("A:%d B:%d\n",distA[i], distB[i]);

   if(A > B) cout << "Fennec" << endl;
   else cout << "Snuke" << endl;
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:42:14: error: could not convert 'graph' from 'vector<vector<long long int>>' to 'vector<vector<int>>'
   42 |    dfs(0,n,0,graph, distA,visit);
      |              ^~~~~
      |              |
      |              vector<vector<long long int>>
a.cc:46:16: error: could not convert 'graph' from 'vector<vector<long long int>>' to 'vector<vector<int>>'
   46 |    dfs(n-1,n,0,graph, distB, visit);
      |                ^~~~~
      |                |
      |                vector<vector<long long int>>
Language: C++

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, 1000000007)
	sc.Split(bufio.ScanWords)
	n, _ := strconv.Atoi(Scanner())
	tree := make([][]int, n)
	for i := 0; i < n-1; i++ {
		a, _ := strconv.Atoi(Scanner())
		b, _ := strconv.Atoi(Scanner())
		a--
		b--
		tree[a] = append(tree[a], b)
		tree[b] = append(tree[b], a)
	}
	fq := []int{0}
	fd := make([]int, n)
	for i := 1; i < n; i++ {
		fd[i] = -1
	}
	for {
		v := fq[0]
		fq = fq[1:]
		for _, j := range tree[v] {
			if fd[j] == -1 {
				fq = append(fq, j)
				fd[j] = fd[v] + 1
			}
		}
		if len(fq) == 0 {
			break
		}
	}
	sq := []int{n - 1}
	sd := make([]int, n)
	for i := 0; i < n-1; i++ {
		sd[i] = -1
	}
	for {
		v := sq[0]
		sq = sq[1:]
		for _, j := range tree[v] {
			if sd[j] == -1 {
				sq = append(sq, j)
				sd[j] = sd[v] + 1
			}
		}
		if len(sq) == 0 {
			break
		}
	}
	f, s := -1, -1
	for i := 0; i < n; i++ {
		if fd[i] == sd[i] || sd[i]-1 == fd[i] {
			f = i
			for _, j := range tree[i] {
				if sd[j] == sd[i]-1 {
					s = j
				}
			}
			break
		}
	}
	fq = []int{0}
	fd[0] = 1
	for i := 1; i < n; i++ {
		fd[i] = -1
	}
	fc := 1
	for {
		v := fq[0]
		fq = fq[1:]
		for _, j := range tree[v] {
			if fd[j] == -1 && j != s {
				fq = append(fq, j)
				fd[j] = 1
				fc++
			}
		}
		if len(fq) == 0 {
			break
		}
	}
	sq = []int{n - 1}
	sd[n-1] = 1
	for i := 0; i < n-1; i++ {
		sd[i] = -1
	}
	sc := 1
	for {
		v := sq[0]
		sq = sq[1:]
		for _, j := range tree[v] {
			if sd[j] == -1 && j != f {
				sq = append(sq, j)
				sd[j] = 1
				sc++
			}
		}
		if len(sq) == 0 {
			break
		}
	}
	if fc > sc {
		fmt.Println("Fennec")
	} else {
		fmt.Println("Snuke")
	}
}


Compiler output:
a.cc:1:1: error: 'package' does not name a type
    1 | package main
      | ^~~~~~~
a.cc:17:1: error: 'func' does not name a type
   17 | func main() {
      | ^~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
using namespace std;
int N;
vector<int> graph[100010];
int memo[100010];
int solve(int indx, bool fennec) {
    if (memo[indx] != -1) {
        return memo[indx];
    }
    memo[indx] = 0;
    int enemy = N-1;
    if (!fennec) {
        enemy = 0;
    }
    if (indx == enemy) {
        return memo[indx] = 0;
    }
    bool flg = false;
    for (int i = 0; i < graph[indx].size(); ++i) {
        if (memo[graph[indx][i]] == -1) {
            flg = true;
            break;
        }
    }
    if (!flg) {
        return memo[indx] = 0;
    }
    int ans = 0;
    for (int i = 0; i < graph[indx].size(); ++i) {
        if (memo[graph[indx][i]] == -1) {
            ans += solve(graph[indx][i], fennec) + 1;   
        }
    }
    return memo[indx] = ans;
}
int main() {
    cin >> N;
    for (int i = 0; i < N-1; ++i) {
        int a,b;
        cin >> a >> b;
        --a; --b;
        graph[a].emplace_back(b);
        graph[b].emplace_back(a);
    }

    // Fennec
    memset(memo, -1, sizeof(memo));
    int x = solve(0, true);
    //cout << x << endl;

    // Snuke
    memset(memo, -1, sizeof(memo));
    int y = solve(N-1, false);
    //cout << y << endl;
    puts(x>=y?"Fennec":"Snuke");  

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:50:5: error: 'memset' was not declared in this scope
   50 |     memset(memo, -1, sizeof(memo));
      |     ^~~~~~
a.cc:5:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
    4 | #include <vector>
  +++ |+#include <cstring>
    5 | using namespace std;
Language: C++

#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){std::cout << e << std::endl;}
template<class T> void DEBUG(string str, T e){std::cout <<str << ">>" << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ DEBUG(v); } }
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T> void SORT_(std::vector<T>& v,bool GREATER = 0){if(GREATER == 0)sort(v.begin(),v.end());else{sort(v.begin(),v.end(),std::greater<T>());}}

void DFS(int V,vector<vector<int> >&GRAPH,vector<int>&dist,int depth)
{
  dist[V] = depth;
  for (int i = 0; i < GRAPH[V].size(); i++)
  {
    if(dist[GRAPH[V][i]] == -1)
    {
      DFS(GRAPH[V][i],GRAPH,dist,depth+1);
    }
  }
  return;
}
void solve(void)
{
  int N;
  cin>>N;
  vector<vector<int> >GRAPH(N);
  for (int i = 0; i < N-1; i++)
  {
    int A,B;
    cin>>A>>B;
    A--;B--;
    GRAPH[A].push_back(B);
    GRAPH[B].push_back(A);
  }
  vector<int> dist0(N,-1);
  vector<int> distN(N,-1);

  DFS(0,GRAPH,dist0,0);
  dist0[0] = 0;
  distN[N-1] = 0;
  DFS(N-1,GRAPH,distN,0);

  int count = 0;
  for (int i = 0; i < N; i++)
  {
    if(dist0[i] =< distN[i])
    {
      count++;
    }
  }

  if(count*2 > N)
  {
    cout<<"Fennec"<<endl;
  }
  else
  {
    cout<<"Snuke"<<endl;
  }
  
  
  
  
  
  return; 
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:81:18: error: expected primary-expression before '<' token
   81 |     if(dist0[i] =< distN[i])
      |                  ^
Language: C++


using namespace std;

int main() {
  cout << "Snuke" << endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:5:3: error: 'cout' was not declared in this scope
    5 |   cout << "Snuke" << endl;
      |   ^~~~
a.cc:1:1: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | 
a.cc:5:22: error: 'endl' was not declared in this scope
    5 |   cout << "Snuke" << endl;
      |                      ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 |
Language: C++

#include<bits/stdc++.h>
#define loop(a,b) for(b=0;b<a;b++)
#define append push_back
vector<int>a[10000];
void dfs(int,int,int,int*);
int main(){
// 	freopen("1.txt","r",stdin);
	int black[10000]={},white[10000]={};
	int n,i;
	cin>>n;
	n--;
	loop(n,i){
		int x,y;
		cin>>x>>y;
		x--;y--;
		a[x].append(y);
		a[y].append(x);
	}
	dfs(0,-1,1,black);
	dfs(n,-1,1,white);
	int b=0,w=0;
	loop(n,i){
		if(black[i]<=white[i])b++;
		else w++;
	}
//	cerr<<"B:"<<b<<" ;W:"<<w<<endl;
	if(b>w)puts("Fennec");
	else puts("Snuck");
	return 0;
}
void dfs(int node,int last,int depth,int*graph){
	graph[node]=depth;
	for(int i=0;i<a[node].size();i++){
		if(a[node][i]==last)continue;
		dfs(a[node][i],node,depth+1,graph);
	}
}

Compiler output:
a.cc:4:1: error: 'vector' does not name a type
    4 | vector<int>a[10000];
      | ^~~~~~
a.cc: In function 'int main()':
a.cc:10:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   10 |         cin>>n;
      |         ^~~
      |         std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:16:17: error: 'a' was not declared in this scope
   16 |                 a[x].append(y);
      |                 ^
a.cc: In function 'void dfs(int, int, int, int*)':
a.cc:33:23: error: 'a' was not declared in this scope
   33 |         for(int i=0;i<a[node].size();i++){
      |                       ^
Language: C++

//#include <tourist>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <iomanip>
#include <limits>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <tuple>
#include <deque>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <utility>
#include <complex>
#include <functional>
using namespace std;
const int MOD = 1000000007;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = (1 << 28);
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
//setprecision(15)有効数字15桁
//-std=c++14
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b)
{
    return a * b / gcd(a, b);
}
struct edge {
    int to, cost;
};
int n, b, c;
int a[10000];
vector<vector<int> > v(100000);
vector<bool> used(100000,false);
int center;
int dfsc(int a,int count){
    if(a==n-1) return count;
    used[a]=true;
    int res=0;
    for(int i=0;i<v[a].size();i++){
        if(used[v[a][i]]) continue;
        res=max(res,dfsc(v[a][i],count+1));
    }
    if(res/2=count) center=a;
    return res;
}
int dfs(int a){
    used[a]=true;
    int res=1;
    for(int i=0;i<v[a].size();i++){
        if(used[v[a][i]]) continue;
        res+=dfs(v[a][i]);
    }
    return res;
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;

    for (int i = 0; i < n-1; i++)
    {
        int tempa, tempb;
        cin >> tempa>>tempb;
        tempa--;
        tempb--;
        v[tempa].push_back(tempb);
        v[tempb].push_back(tempa);
    }
    center=0;
    int c=dfsc(0,0);
    used=vector<bool> (100000,false);
    cout<<center<<"\n";
    used[center]=true;
    int ans=dfs(n-1);
    cout<<ans<<"\n";
    if(ans*2>=n)
    return cout <<"Snuke"<< "\n",0;
    else{
        return cout <<"Fennec"<< "\n",0;
    }
}



Compiler output:
a.cc: In function 'int dfsc(int, int)':
a.cc:63:11: error: lvalue required as left operand of assignment
   63 |     if(res/2=count) center=a;
      |        ~~~^~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using Graph = vector<vector<ll>>;
const ll mod = 1000000007;

int main() {
    int n;
    cin >> n;

    Graph to(n), cost(n);
    rep(i, n-1) {
        ll a, b;
        cin >> a >> b;
        a--;  b--;
        to[a].push_back(b);
        to[b].push_back(a);
        cost[a].push_back(1LL);
        cost[b].push_back(1LL);
    }

    vector<ll> dist0(n, -1LL), distN(n, -1LL);
    queue<ll> Q0, QN;

    dist0[0] = 0;
    Q0.push(root0);
    while(!Q0.empty()) {
        
        ll v = Q0.front();
        Q0.pop();

        rep(i, to[v].size()) {
            
            ll u = to[v][i];
            
            if(dist0[u] != -1) {
                continue;
            }
            
            dist0[u] = dist0[v] + cost[v][i];
            Q0.push(u);
        }
    }

    distN[n-1] = 0;
    QN.push(rootN);
    while(!QN.empty()) {
        
        ll v = QN.front();
        QN.pop();

        rep(i, to[v].size()) {
            
            ll u = to[v][i];
            
            if(distN[u] != -1) {
                continue;
            }
            
            distN[u] = distN[v] + cost[v][i];
            QN.push(u);
        }
    }

    int cnt0 = 0, cntN = 0;
    rep(i, n) { 
        if(dist0[i] <= distN[i]) {
            cnt0++;
        }
        else {
            cntN++;
        }
    }

    if(cnt0 > cntN) {
        cout << "Fennec";
    }
    else {
        cout << "Snuke";
    }
    
    cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:13: error: 'root0' was not declared in this scope
   36 |     Q0.push(root0);
      |             ^~~~~
a.cc:56:13: error: 'rootN' was not declared in this scope
   56 |     QN.push(rootN);
      |             ^~~~~
Language: C++

#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using Graph = vector<vector<ll>>;
const ll mod = 1000000007;

int main() {
    int n;
    cin >> n;

    Graph to(n), cost(n);
    rep(i, n-1) {
        ll a, b;
        cin >> a >> b;
        a--;  b--;
        to[a].push_back(b);
        to[b].push_back(a);
        cost[a].push_back(1LL);
        cost[b].push_back(1LL);
    }

    vector<ll> dist0(n, -1LL), distN(n, -1LL);
    queue<ll> Q0, QN;

    const ll root0 = 0LL, 
    dist0[root0] = 0;
    Q0.push(root0);
    while(!Q0.empty()) {
        
        ll v = Q0.front();
        Q0.pop();

        rep(i, to[v].size()) {
            
            ll u = to[v][i];
            
            if(dist0[u] != -1) {
                continue;
            }
            
            dist0[u] = dist0[v] + cost[v][i];
            Q0.push(u);
        }
    }

    const ll rootN = n-1;
    distN[rootN] = 0;
    QN.push(rootN);
    while(!QN.empty()) {
        
        ll v = QN.front();
        QN.pop();

        rep(i, to[v].size()) {
            
            ll u = to[v][i];
            
            if(distN[u] != -1) {
                continue;
            }
            
            distN[u] = distN[v] + cost[v][i];
            QN.push(u);
        }
    }

    int cnt0 = 0, cntN = 0;
    rep(i, n) { 
        if(dist0[i] <= distN[i]) {
            cnt0++;
        }
        else {
            cntN++;
        }
    }

    if(cnt0 > cntN) {
        cout << "Fennec";
    }
    else {
        cout << "Snuke";
    }
    
    cout << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:5: error: conflicting declaration 'const ll dist0 [0]'
   36 |     dist0[root0] = 0;
      |     ^~~~~
a.cc:32:16: note: previous declaration as 'std::vector<long long int> dist0'
   32 |     vector<ll> dist0(n, -1LL), distN(n, -1LL);
      |                ^~~~~