criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include "bits/stdc++.h"
static const int MOD = 998244353;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

template <class T, class U>
vector<T> make_v(U size, const T& init){ return vector<T>(static_cast<size_t>(size), init); }

template<class... Ts, class U>
auto make_v(U size, Ts... rest) { return vector<decltype(make_v(rest...))>(static_cast<size_t>(size), make_v(rest...)); }

template<class T> void chmin(T &a, const T &b){ a = (a < b ? a : b); }
template<class T> void chmax(T &a, const T &b){ a = (a > b ? a : b); }

template <class T>
T pow_ (T x, T n, T M){
    uint64_t u = 1, xx = x;
    while (n > 0){
        if (n&1) u = u * xx % M;
        xx = xx * xx % M;
        n >>= 1;
    }
    return static_cast<T>(u);
};



int main() {
    int n;
    cin >> n;
    vector<int> v(n);
    for (auto &&i : v) scanf("%d", &i);
    int sum = accumulate(v.begin(), v.end() , 0);
    auto dp = make_v(n+1, sum+1, 0LL);
    dp[0][0] = 1;
    auto dp2 = dp;
    int x = 0;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j <= x; ++j) {
            (dp[i+1][j+v[i]] += dp[i][j]) %= MOD;
            (dp[i+1][j] += dp[i][j]*2) %= MOD;
            (dp2[i+1][j+v[i]] += dp2[i][j]) %= MOD;
            (dp2[i+1][j] += dp2[i][j]) %= MOD;
        }
        x += v[i];
      	memset(dp[i],0,sizeof(dp));
    }
    ll ans = pow_(3, n-1, MOD);
    for (int i = (sum+1)/2; i <= sum; ++i) {
        (ans += MOD - dp[n][i]) %= MOD;
    }
    if(sum%2 == 0){
        (ans += dp2[n][sum/2]) %= MOD;
    }
    cout << (ans*3)%MOD << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:15: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int, std::allocator<long long int> > >, std::vector<long long int, std::allocator<long long int> > >::value_type' {aka 'std::vector<long long int, std::allocator<long long int> >'} to 'void*'
   58 |         memset(dp[i],0,sizeof(dp));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~
      |               |
      |               __gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int, std::allocator<long long int> > >, std::vector<long long int, std::allocator<long long int> > >::value_type {aka std::vector<long long int, std::allocator<long long int> >}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:10:
/usr/include/string.h:61:28: note:   initializing argument 1 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                      ~~~~~~^~~
Language: C++

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include "bits/stdc++.h"
static const int MOD = 998244353;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

template <class T, class U>
vector<T> make_v(U size, const T& init){ return vector<T>(static_cast<size_t>(size), init); }

template<class... Ts, class U>
auto make_v(U size, Ts... rest) { return vector<decltype(make_v(rest...))>(static_cast<size_t>(size), make_v(rest...)); }

template<class T> void chmin(T &a, const T &b){ a = (a < b ? a : b); }
template<class T> void chmax(T &a, const T &b){ a = (a > b ? a : b); }

template <class T>
T pow_ (T x, T n, T M){
    uint64_t u = 1, xx = x;
    while (n > 0){
        if (n&1) u = u * xx % M;
        xx = xx * xx % M;
        n >>= 1;
    }
    return static_cast<T>(u);
};



int main() {
    int n;
    cin >> n;
    vector<int> v(n);
    for (auto &&i : v) scanf("%d", &i);
    int sum = accumulate(v.begin(), v.end() , 0);
    auto dp = make_v(n+1, sum+1, 0LL);
    dp[0][0] = 1;
    auto dp2 = dp;
    int x = 0;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j <= x; ++j) {
            (dp[i+1][j+v[i]] += dp[i][j]) %= MOD;
            (dp[i+1][j] += dp[i][j]*2) %= MOD;
            (dp2[i+1][j+v[i]] += dp2[i][j]) %= MOD;
            (dp2[i+1][j] += dp2[i][j]) %= MOD;
        }
        x += v[i];
      	memset(dp[i],0,sizeof(dp[i]));
    }
    ll ans = pow_(3, n-1, MOD);
    for (int i = (sum+1)/2; i <= sum; ++i) {
        (ans += MOD - dp[n][i]) %= MOD;
    }
    if(sum%2 == 0){
        (ans += dp2[n][sum/2]) %= MOD;
    }
    cout << (ans*3)%MOD << "\n";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:58:15: error: cannot convert '__gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int, std::allocator<long long int> > >, std::vector<long long int, std::allocator<long long int> > >::value_type' {aka 'std::vector<long long int, std::allocator<long long int> >'} to 'void*'
   58 |         memset(dp[i],0,sizeof(dp[i]));
      |         ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
      |               |
      |               __gnu_cxx::__alloc_traits<std::allocator<std::vector<long long int, std::allocator<long long int> > >, std::vector<long long int, std::allocator<long long int> > >::value_type {aka std::vector<long long int, std::allocator<long long int> >}
In file included from /usr/include/c++/14/cstring:43,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:121,
                 from a.cc:10:
/usr/include/string.h:61:28: note:   initializing argument 1 of 'void* memset(void*, int, size_t)'
   61 | extern void *memset (void *__s, int __c, size_t __n) __THROW __nonnull ((1));
      |                      ~~~~~~^~~
Language: C++

#include <bits/stdc++.h>
#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define MOD 998244353
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

ll modpow(ll n,ll k){
  if(k == 1){
    return n;
  }else if(k == 0){
    return 1;
  }else if(k%2==0){
    ll memo = modpow(n,k/2)%MOD;
    return memo*memo%MOD;
  }else{
    return n * modpow(n,k-1)%MOD;
  }
}

int main(){

  ll n;cin>>n;
  ll a[n];
  ll sum = 0;
  REP(i,n){
    cin>>a[i];
    sum += a[i];
  }

  ll dp[n+1][n+1][sum+1];
  REP(i,n+1){
    REP(j,n+1){
      REP(k,sum+1){
        dp[i][j][k] = 0;
      }
    }
  }
  dp[0][0][0] = 1;


  /*for(int i=0;i<n;i++){
    REP(j,i+1){
      REP(k,sum+1){
        //cout<<i<<" "<<j<<" "<<k<<endl;
        if(dp[i][j][k]>0){
          dp[i+1][j+1][k+a[i]] = (dp[i+1][j+1][k+a[i]] + dp[i][j][k])%MOD;
          dp[i+1][j][k] = (dp[i+1][j][k] + dp[i][j][k])%MOD;
        }
      }
    }
  }


  ll ans = 0;
 
  for(int i=1;i<=n-2;i++){
    for(int j=(sum+1)/2;j<=sum;j++){
      if(dp[n][i][j]>0){
        ans = (ans + dp[n][i][j] * (modpow(2,n-i)-2)%MOD)%MOD;
      }
    }
  }*/



  ll zenbu = (modpow(3,n) - 3 * modpow(2,n) + 3)%MOD;
  //cout<<zenbu<<endl;
  //cout<<ans<<endl;
  ans = zenbu - ans*3;
  while(ans<0){
    ans += MOD;
  }

  cout<<ans<<endl;

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:83:3: error: 'ans' was not declared in this scope; did you mean 'abs'?
   83 |   ans = zenbu - ans*3;
      |   ^~~
      |   abs
Language: C++

#include <ctime>
#include <cstdlib>

int main(){
  srand(time(NULL));
  printf("%d\n", rand());
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'printf' was not declared in this scope
    6 |   printf("%d\n", rand());
      |   ^~~~~~
a.cc:3:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
    2 | #include <cstdlib>
  +++ |+#include <cstdio>
    3 |
Language: C++

#include <stdio.h>
long long p = 998244353;
long long b[100000];
long long c[100000];
long long a[400];
long long t;
long long k[305];
long long inv[305];
long long rui(long long a, long long b) {
	if (b == 0)return 1;
	if (b == 1)return a;
	if (b == 2)return a * a % p;
	if (b % 2)return rui(rui(a, b / 2), 2) * a % p;
	return rui(rui(a, b / 2), 2);
}
int main(){
	long long n;
	scanf("%lld", &n);
	for (int i = 0; i < n; i++)scanf("%lld", &a[i]);
	for (int i = 0; i < n; i++)t += a[i];
	b[0]++;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j <= 90000; j++)c[j] = b[j];
		for (int j = 90000 - 1; j >= 0; j--) {
			b[j + a[i]] += b[j];
		}
		for (int j = 0; j <= 90000; j++)b[j] += c[j];
		for (int j = 0; j <= 90000; j++) {
			b[j] %= p;
		}
	}
	for (int i = 0; i < 10; i++)
	long long kaai;
	kaai=1;
	for (int i = 0; i < n; i++) {
		kaai *= 3;
		kaai %= p;
	}
	for (int i = 0; i < (t / 2) + (t % 2);i++) {
		kaai -= b[i];
		kaai += p;
		kaai %= p;
	}
	if (t % 2 == 0)kai -= b[t / 2] / 2;
	kaai += p;
	kaai %= p;
	long long all = 0;
	k[0] = 1;
	for (int i = 1; i < 303; i++) {
		k[i] = k[i - 1] * i % p;
	}
	for (int i = 0; i < 303; i++) {
		inv[i] = rui(k[i], p - 2);
	}
	for (int i = 0; i <= n; i++) {
		for (int j = 0; j <= n - i; j++) {
			all += k[n] * inv[i] % p * inv[j] % p * inv[n - i - j] % p;
		}
	}
	all -= kaai * 3;
	all += p * 3;
	printf("%lld\n", all % p);
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:9: error: 'kaai' was not declared in this scope
   34 |         kaai=1;
      |         ^~~~
a.cc:44:24: error: 'kai' was not declared in this scope
   44 |         if (t % 2 == 0)kai -= b[t / 2] / 2;
      |                        ^~~
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<vector>
#include<set>
#include<iomanip>
#include<cmath>
using namespace std;
typedef long long ll;
typedef long long int llint;
typedef pair<ll, ll> pa;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define MAX_T 1001
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define INF (1 << 29) //536870912
const long double PI = acos(-1);
const ll DEP = 1e18;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
const ll TMP = 998244353;
int R[300][90009][90009],G[300][90009][90009],B[300][90009][90009];
int main(){
    int N; vector<int> a(N);
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> a[i];
    }
    R[0][a[0]][0] = 0; G[0][0][a[0]] = 0; B[0][0][0] = a[0];
    for(int i = 1; i < N; i++){
        for(int j = 0; j < 90001; j++){
            for(int k = 0; k < 90001; k++){
                if(j >= a[i]) R[i][j][k] = R[i-1][j-a[i]][k];
                if(k >= a[i]) G[i][j][k] = G[i-1][j][k-a[i]];
                if(B[i-1][j][k]) B[i][j][k] = B[i-1][j][k] + a[i];
            }
        }
    }
    ll ans = 0;
    for(int j = 1; j < 90001; j++){
        for(int k = 1; k < 90001; k++){
            int r = R[N-1][j][k]; int g = G[N-1][j][k]; int b = B[N-1][j][k];
            if(max(r,max(j,k)) > (r+g+b)/2 && B[N-1][j][k]) ans++;
        }
        ans %= TMP;
    }
    ans %= TMP;
    cout << ans << endl;
}

Compiler output:
/tmp/cc9xODUF.o: in function `main':
a.cc:(.text+0xd5): relocation truncated to fit: R_X86_64_PC32 against symbol `G' defined in .bss section in /tmp/cc9xODUF.o
a.cc:(.text+0xf5): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/cc9xODUF.o
a.cc:(.text+0x257): relocation truncated to fit: R_X86_64_PC32 against symbol `G' defined in .bss section in /tmp/cc9xODUF.o
a.cc:(.text+0x296): relocation truncated to fit: R_X86_64_PC32 against symbol `G' defined in .bss section in /tmp/cc9xODUF.o
a.cc:(.text+0x2d8): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/cc9xODUF.o
a.cc:(.text+0x322): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/cc9xODUF.o
a.cc:(.text+0x37a): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/cc9xODUF.o
a.cc:(.text+0x453): relocation truncated to fit: R_X86_64_PC32 against symbol `G' defined in .bss section in /tmp/cc9xODUF.o
a.cc:(.text+0x498): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/cc9xODUF.o
a.cc:(.text+0x51e): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/cc9xODUF.o
collect2: error: ld returned 1 exit status
Language: C++

#include<iostream>
#include<algorithm>
#include<string>
#include<map>
#include<vector>
#include<set>
#include<iomanip>
#include<cmath>
using namespace std;
typedef long long ll;
typedef long long int llint;
typedef pair<ll, ll> pa;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define MAX_T 1001
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define INF (1 << 29) //536870912
const long double PI = acos(-1);
const ll DEP = 1e18;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
const ll TMP = 998244353;
int N; vector<int> a(N);
int R[300][90009][90009],G[300][90009][90009],B[300][90009][90009];
int main(){
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> a[i];
    }
    R[0][a[0]][0] = 0; G[0][0][a[0]] = 0; B[0][0][0] = a[0];
    for(int i = 1; i < N; i++){
        for(int j = 0; j < 90001; j++){
            for(int k = 0; k < 90001; k++){
                if(j >= a[i]) R[i][j][k] = R[i-1][j-a[i]][k];
                if(k >= a[i]) G[i][j][k] = G[i-1][j][k-a[i]];
                if(B[i-1][j][k]) B[i][j][k] = B[i-1][j][k] + a[i];
            }
        }
    }
    ll ans = 0;
    for(int j = 1; j < 90001; j++){
        for(int k = 1; k < 90001; k++){
            int r = R[N-1][j][k]; int g = G[N-1][j][k]; int b = B[N-1][j][k];
            if(max(r,max(j,k)) > (r+g+b)/2 && B[N-1][j][k]) ans++;
        }
        ans %= TMP;
    }
    ans %= TMP;
    cout << ans << endl;
}

Compiler output:
/tmp/ccS1BcaT.o: in function `main':
a.cc:(.text+0xb3): relocation truncated to fit: R_X86_64_PC32 against symbol `G' defined in .bss section in /tmp/ccS1BcaT.o
a.cc:(.text+0xd6): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccS1BcaT.o
a.cc:(.text+0x240): relocation truncated to fit: R_X86_64_PC32 against symbol `G' defined in .bss section in /tmp/ccS1BcaT.o
a.cc:(.text+0x27f): relocation truncated to fit: R_X86_64_PC32 against symbol `G' defined in .bss section in /tmp/ccS1BcaT.o
a.cc:(.text+0x2c1): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccS1BcaT.o
a.cc:(.text+0x30b): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccS1BcaT.o
a.cc:(.text+0x365): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccS1BcaT.o
a.cc:(.text+0x447): relocation truncated to fit: R_X86_64_PC32 against symbol `G' defined in .bss section in /tmp/ccS1BcaT.o
a.cc:(.text+0x48f): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccS1BcaT.o
a.cc:(.text+0x518): relocation truncated to fit: R_X86_64_PC32 against symbol `B' defined in .bss section in /tmp/ccS1BcaT.o
collect2: error: ld returned 1 exit status
Language: C++

#include <bits/stdc++.h>

#define ARC(i, a, b) for(ll i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(ll i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)

#define ll long long

ll dp[312][91234] = {1};

#define MOD 998244353

ll add(ll a, ll b){
	ll ret = a + b;
	if(ret >= MOD) ret -= MOD;
	return ret;
}

ll minus(ll a, ll b){
	ll ret = a - b;
	if(ret < 0) ret += MOD;
	return ret;
}

ll modpow(ll a, ll b){
	ll ret = 1;
	while(b){
		if(b & 1) ret = ret * a % MOD;
		a = a * a % MOD;
		b >>= 1;
	}
	return ret;
}

int main(){
	ll n;
	scanf("%lld", &n);
	ll sum = 0, ans = 0;
	RC(i, n){
		ll tmp;
		scanf("%lld", &tmp);
		RCH(j, i + 1) RC(k, sum + 1) dp[j + 1][k + tmp] = add(dp[j + 1][k + tmp], dp[j][k]);
		sum += tmp;
	}
	RC(i, n + 1){
		ll sub = 0;
		ARC(j, (sum + 1) / 2, sum + 1) sub = add(sub, dp[i][j]);
		//printf("%lld\n", sub);
		ans = add(ans, sub * 3 * modpow(2, n - i));
	}
	/*
	RC(i, n + 1){
		RC(j, sum + 1) printf("%lld ", dp[i][j]);
		putchar('\n');
	}
	*/
	if(sum % 2 == 0){
		ll sub = 0;
		RC(i, n + 1) sub = add(sub, dp[i][sum / 2]);
		sub = sub * 3 % MOD;
		ans = minus(ans, sub);
	}
	printf("%lld\n", minus(modpow(3, n), ans));
}


Compiler output:
/tmp/ccl2Qev9.s: Assembler messages:
/tmp/ccl2Qev9.s: Fatal error: can't fill 256 bytes in section .data of /tmp/cc58XLl5.o: 'No space left on device'
Language: C++

#include <bits/stdc++.h>

#define ARC(i, a, b) for(int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(int i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)

#define ll long long

ll dp[312][91234] = {1};

#define MOD 998244353

ll add(ll a, ll b){
	ll ret = a + b;
	if(ret >= MOD) ret -= MOD;
	return ret;
}

ll minus(ll a, ll b){
	ll ret = a - b;
	if(ret < 0) ret += MOD;
	return ret;
}

ll modpow(ll a, ll b){
	ll ret = 1;
	while(b){
		if(b & 1) ret = ret * a % MOD;
		a = a * a % MOD;
		b >>= 1;
	}
	return ret;
}

int main(){
	ll n;
	scanf("%lld", &n);
	ll sum = 0, ans = 0;
	RC(i, n){
		ll tmp;
		scanf("%lld", &tmp);
		RCH(j, i + 1) RC(k, sum + 1) dp[j + 1][k + tmp] = add(dp[j + 1][k + tmp], dp[j][k]);
		sum += tmp;
	}
	RC(i, n + 1){
		ll sub = 0;
		ARC(j, (sum + 1) / 2, sum + 1) sub = add(sub, dp[i][j]);
		ans = add(ans, sub * 3 * modpow(2, n - i));
	}
	if(sum % 2 == 0){
		ll sub = 0;
		RC(i, n + 1) sub = add(sub, dp[i][sum / 2]);
		sub = sub * 3 % MOD;
		ans = minus(ans, sub);
	}
	printf("%lld\n", minus(modpow(3, n), ans));
}


Compiler output:
/tmp/ccGM5BQq.s: Assembler messages:
/tmp/ccGM5BQq.s: Fatal error: can't fill 256 bytes in section .data of /tmp/ccNUlKDs.o: 'No space left on device'
Language: C++

#include <bits/stdc++.h>

#define ARC(i, a, b) for(int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(int i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)

#define ll long long

ll dp[312][91234] = {1};

#define MOD 998244353

ll add(ll a, ll b){
	ll ret = a + b;
	if(ret >= MOD) ret -= MOD;
	return ret;
}

ll minus(ll a, ll b){
	ll ret = a - b;
	if(ret < 0) ret += MOD;
	return ret;
}

ll modpow(ll a, ll b){
	ll ret = 1;
	while(b){
		if(b & 1) ret = ret * a % MOD;
		a = a * a % MOD;
		b >>= 1;
	}
	return ret;
}

int main(){
	ll n;
	scanf("%lld", &n);
	ll sum = 0, ans = 0;
	RC(i, n){
		ll tmp;
		scanf("%lld", &tmp);
		RCH(j, i + 1) RC(k, sum + 1) dp[j + 1][k + tmp] = add(dp[j + 1][k + tmp], dp[j][k]);
		sum += tmp;
	}
	RC(i, n + 1){
		ll sub = 0;
		ARC(j, (sum + 1) / 2, sum + 1) sub = add(sub, dp[i][j]);
		//printf("%lld\n", sub);
		ans = add(ans, sub * 3 * modpow(2, n - i));
	}
	/*RC(i, n + 1){
		RC(j, sum + 1) printf("%lld ", dp[i][j]);
		putchar('\n');
	}*/
	if(sum % 2 == 0){
		ll sub = 0;
		RC(i, n + 1) sub = add(sub, dp[i][sum / 2]);
		sub = sub * 3 % MOD;
		ans = minus(ans, sub);
	}
	printf("%lld\n", minus(modpow(3, n), ans));
}


Compiler output:
/tmp/ccFjGQC8.s: Assembler messages:
/tmp/ccFjGQC8.s: Fatal error: can't fill 256 bytes in section .data of /tmp/cc6j5lRb.o: 'No space left on device'
Language: C++

#include <bits/stdc++.h>

#define ARC(i, a, b) for(int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(int i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)

template<typename T> T ant(const T &a, const T &b){ return a > b ? a : b; }
template<typename T> T ont(const T &a, const T &b){ return a < b ? a : b; }
template<typename T> T anti(const T &a, const T &b){ return a == -1 || b == -1 ? -1 : ant(a, b); }
template<typename T> T onti(const T &a, const T &b){ return a == -1 ? b : b == -1 ? a : ont(a, b); }
template<typename T> T rng(const T &a, const T &b){ return a > b ? a - b : b - a; }
template<typename T> T &th(T &a, const T &b, T (*f)(const T &l, const T &r)){ return a = f(a, b); }
#define ANTH(a, b) th(a, b, ant)
#define ONTH(a, b) th(a, b, ont)

template<typename T> T make_v(T val){ return val; }
template<typename... Ts> auto make_v(size_t n, Ts... ts){ return std::vector<decltype(make_v(ts...))>(n, make_v(ts...)); }

#define ll long long

ll dp[312][91234] = {1};

#define MOD 998244353

ll add(ll a, ll b){
	ll ret = a + b;
	if(ret >= MOD) ret -= MOD;
	return ret;
}

ll minus(ll a, ll b){
	ll ret = a - b;
	if(ret < 0) ret += MOD;
	return ret;
}

ll modpow(ll a, ll b){
	ll ret = 1;
	while(b){
		if(b & 1) ret = ret * a % MOD;
		a = a * a % MOD;
		b >>= 1;
	}
	return ret;
}

int main(){
	ll n;
	scanf("%lld", &n);
	ll sum = 0, ans = 0;
	RC(i, n){
		ll tmp;
		scanf("%lld", &tmp);
		RCH(j, i + 1) RC(k, sum + 1) dp[j + 1][k + tmp] = add(dp[j + 1][k + tmp], dp[j][k]);
		sum += tmp;
	}
	RC(i, n + 1){
		ll sub = 0;
		ARC(j, (sum + 1) / 2, sum + 1) sub = add(sub, dp[i][j]);
		//printf("%lld\n", sub);
		ans = add(ans, sub * 3 * modpow(2, n - i));
	}
	/*RC(i, n + 1){
		RC(j, sum + 1) printf("%lld ", dp[i][j]);
		putchar('\n');
	}*/
	if(sum % 2 == 0){
		ll sub = 0;
		RC(i, n + 1) sub = add(sub, dp[i][sum / 2]);
		sub = sub * 3 % MOD;
		ans = minus(ans, sub);
	}
	printf("%lld\n", minus(modpow(3, n), ans));
}


Compiler output:
/tmp/ccDmXbgR.s: Assembler messages:
/tmp/ccDmXbgR.s: Fatal error: can't fill 256 bytes in section .data of /tmp/ccdnbeAJ.o: 'No space left on device'
Language: C++

#include <bits/stdc++.h>

using namespace std;

template <class T> T gcd(T a, T b) {
	if (a < b) swap(a, b);
	while (b) {
		a = a % b;
		swap(a, b);
	}
	return a;
}

vector<int> sieve(int n) {
	vector<int> primes;
	vector<bool> isPrime(n + 1, true);
	isPrime[0] = isPrime[1] = false;
	for (int i = 2; i <= n; i++) {
		if (!isPrime[i]) continue;
		primes.push_back(i);
		for (int j = i + i; j <= n; j += i) {
			isPrime[j] = false;
		}
	}
	return primes;
}

class Solution {
public:
	void solve() {
		int n;
		cin >> n;
		vector<int> a(n + 1, 0);
		vector<int> ans;
		vector<int> primes = sieve(1000000);
		for (auto& x : a) cin >> x;
		int y = aabs([0]);
		for (auto x : a)
			if (x != 0) y = gcd(y, abs(x));
		for (auto p : primes) {
			if (!(y % p)) {
				ans.push_back(p);
				while (!(y % p)) y /= p;
			}
			if (y == 1) break;
		}
		if (y != 1) ans.push_back(y);

		for (auto p : primes) {
			if (p > n) break;
			if (abs(a[n]) % p) continue;
			vector<long long> f(p);
			for (int i = 0; i < n; i++) {
				f[i % (p - 1)] += a[i];
			}
			bool ok = true;
			for (int i = 0; i < p; i++) {
				if (f[i] % p) {
					ok = false;
					break;
				}
			}
			if (ok) ans.push_back(p);
		}

		sort(ans.begin(), ans.end());
		ans.erase(unique(ans.begin(), ans.end()), ans.end());
		for (auto x : ans) cout << x << " ";
		cout << "\n";

		return;
	};
};

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	Solution solution;
	solution.solve();
	return 0;
}

Compiler output:
a.cc: In member function 'void Solution::solve()':
a.cc:37:31: error: expected identifier before numeric constant
   37 |                 int y = aabs([0]);
      |                               ^
a.cc: In lambda function:
a.cc:37:33: error: expected '{' before ')' token
   37 |                 int y = aabs([0]);
      |                                 ^
a.cc: In member function 'void Solution::solve()':
a.cc:37:25: error: 'aabs' was not declared in this scope; did you mean 'labs'?
   37 |                 int y = aabs([0]);
      |                         ^~~~
      |                         labs
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define inf 0x3f3f3f3f
typedef long long ll;
const int N=1e4+5;
int n,a[N],sum[N];
bool vis[N];
int pow(int a,int n)
{
    if(n>=9) return 1e9;
    int ans=1;
    for(int i=1;i<=n;i++) ans=ans*10;
    return ans;
}
bool check(int p)
{
    int t=20;
    while(t--)
    {
        int f=rand()*rand()%1000000000+1;
        ll ans=0;
        for(int i=n;i>=0;i--)
            ans=(ans*f+a[i])%mod;
        if(ans) return false;
    }
    return true;
}
vector<int>v;
int main()
{
    scanf("%d",&n);
    int k=0;
    for(int i=n;i>=0;i--)
    {
        scanf("%d",&a[i]);
        k=__gcd(k,a[i]);
    }
    k=abs(k);
    for(int j=2;j*j<=k;j++)
        if(k%j==0)
    {
        v.push_back(j);
        while(k%j==0) k/=j;
    }
    if(k>1) v.push_back(k);
    for(int i=2;i<=n;i++)
        if(!vis[i])
    {
        if(check(i)) v.push_back(i);
        for(int j=i+i;j<=n;j+=i)
            vis[j]=true;
    }
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++)
        if(i==v.size()-1||v[i]!=v[i+1])
    {
        printf("%d\n",v[i]);
    }
}


Compiler output:
a.cc: In function 'bool check(int)':
a.cc:23:30: error: 'mod' was not declared in this scope; did you mean 'modf'?
   23 |             ans=(ans*f+a[i])%mod;
      |                              ^~~
      |                              modf
Language: C++

#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
//#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int N = 35000;
const int K = 19;
int mod =  998244353;
int a[N], n, b[N];
int binpow(int x, int y, int mod){
    if (y == 0) return 1;
    if (y % 2) return x * binpow(x, y - 1, mod) % mod;
    int z = binpow(x, y / 2, mod);
    return z * z % mod;
}
bool prime(int x){
    for (int i = 2; i * i <= x; i++){
        if (x % i == 0) return 0;
    }
    return 1;
}
int poly(int x, int mod){
    int res = 0;
    int p = 1;
    for (int i = 0; i <= n; i++){
        res = (res + b[i] * p) ;
        p = 1LL p * x % mod;
    }
    return res % mod;
}
bool check (int x){
    int r = min(x - 1, n);
    for (int i = 0; i <= n; i++) b[i] = a[i] % x;
    for (int i = 0; i <= r; i++){
        if (poly(i, x) != 0) return 0;
    }
    return 1;
}
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
   // freopen("input.txt", "r", stdin);
    cin >> n;
    int s = 0;
    for (int i = n; i >= 0; i--){
        cin >> a[i];
        s += a[i];
    }
    int l = 0;
    while(a[l] == 0) l++;
    int x = a[l];
    vector < int > ans;
    set < int > r;
    x = abs(x);
    for (int i = 2; i * i <= x; i++){
        if (x % i == 0){
            r.insert(i);
            while(x % i == 0) x /= i;
        }
    }
    if (x != 1) r.insert(x);
    int d = 0;
    for (int i = 2; i <= n; i++){
        if (prime(i)){
            r.insert(i);
            d += i;
        }
    }
    for (auto i: r) if (check(i)){
        ans.pb(i);
    }
    for (auto i: ans) cout << i << " ";
}


Compiler output:
a.cc: In function 'int poly(int, int)':
a.cc:37:16: error: expected ';' before 'p'
   37 |         p = 1LL p * x % mod;
      |                ^~
      |                ;
a.cc: At global scope:
a.cc:49:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   49 | main(){
      | ^~~~
Language: C++

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second

using vint=vector<int>;
using pint=pair<int,int>;
using vpint=vector<pint>;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

template<class A,class B>
ostream& operator<<(ostream& ost,const pair<A,B>&p){
	ost<<"{"<<p.first<<","<<p.second<<"}";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost,const vector<T>&v){
	ost<<"{";
	for(int i=0;i<v.size();i++){
		if(i)ost<<",";
		ost<<v[i];
	}
	ost<<"}";
	return ost;
}

int N;
int A[11111];

bool prime[11111];
signed main(){
	cin>>N;
	rep(i,N+1)cin>>A[N-i];


	int X=abs(A[N]);

	set<int>s;
	auto f=[&](int p){
		for(int i=0;i<=N;i++)if(A[i]%p)return false;
		return true;
	};

	for(int i=2;i*i<=X;i++){
		if(X%i)continue;
		if(f(i))s.insert(i);
		while(X%i==0)X/=i;
	}
	if(X!=1&&f(X))s.insert(X);

	fill_n(prime,11111,1);
	prime[0]=prime[1]=0;


	auto g=[&](int p){
		for(int i=0;i<p-1&&i<=N;i++){
			int sum=0;
			for(int j=i;j<=N;j+=p-1)sum+=A[j];
			if(sum%p)return false;
		}
		return true;
	};


	for(int i=2;i<11111;i++){
		if(!prime[i])continue;
		if(s.find(i)==s.end()&&g(i)&&A[0]%p==0)s.insert(i);
		for(int j=i+i;j<11111;j+=i)prime[j]=0;
	}
	
	for(auto x:s)cout<<x<<endl;
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:78:51: error: 'p' was not declared in this scope
   78 |                 if(s.find(i)==s.end()&&g(i)&&A[0]%p==0)s.insert(i);
      |                                                   ^
Language: C++

#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <functional>
#include <numeric>
#include <set>
#include <cmath>
// #include <bits/stdc++.h>

using namespace std;
typedef long long li;

const long long __prime_base[] = {2, 325, 9375, 28178, 450775, 9780504, 1795265022};
bool is_prime(long long n) {
    for (int i = 0; i < 7; ++i) {
        if (n % __prime_base[i] == 0) {
            return false;
        }
    }
    return true;
}

vector<long long> factor(long long n) {
    vector<long long> factors;
    for (long long p = 2; p * p <= n; ++p) {
        while (n % p == 0) {
            factors.push_back(p);
            n /= p;
        }
    }
    if (n > 1) {
        factors.push_back(n);
    }
    return factors;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);

    li n;
    cin >> n;
    vector<li> coefs(n + 1);
    for (int i = 0; i < n + 1; ++i) {
        cin >> coefs[n - i];
    }

    set<li> candidates;
    for (int i = 2; i <= n; ++i) {
        if (is_prime(i)) {
            candidates.insert(i);
        }
    }

    li g = abs(coefs[n]);
    for (const auto &coef : coefs) {
        if (coef != 0) {
            g = __algo_gcd(g, abs(coef));
        }
    }

    for (const auto &prime : factor(g)) {
        candidates.insert(prime);
    }

    for (const auto &p : candidates) {
        vector<li> r = coefs;
        for (auto &&rv : r) {
            rv %= p;
            if (rv < 0) {
                rv += p;
            }
        }
        while (r.size() - 1 >= p) {
            const li degree = r.size() - 1;
            const li head = r.back(); r.pop_back();
            r[degree - p + 1] -= -head;
            r[degree - p + 1] %= p;
            if (r[degree - p + 1] < 0) {
                r[degree - p + 1] += p;
            }
        }
        bool ok = true;
        for (const auto &rv : r) {
            ok &= rv == 0;
        }
        if (ok) {
            cout << p << endl;
        }
    }
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:17: error: '__algo_gcd' was not declared in this scope
   59 |             g = __algo_gcd(g, abs(coef));
      |                 ^~~~~~~~~~
Language: C++

// #includes {{{
#ifdef MY_DEBUG
#include "header/header.hpp"
#else
#include <bits/stdc++.h>
#endif

using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define RREP(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define LET(x,a) __typeof(a) x(a)
//#define IFOR(i,it,c) for(__typeof((c).begin())it=(c).begin();it!=(c).end();++it,++i)
#define ALL(c) (c).begin(), (c).end()
#define MP make_pair

#define EXIST(e,s) ((s).find(e)!=(s).end())

#define RESET(a) memset((a),0,sizeof(a))
#define SET(a) memset((a),-1,sizeof(a))
#define PB push_back
#define DEC(it,command) __typeof(command) it=command

//debug

#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)

typedef long long Int;
typedef unsigned long long uInt;
typedef long double rn;

template<class T>
constexpr T inf = numeric_limits<T>::has_infinity ? numeric_limits<T>::infinity():(numeric_limits<T>::max()/2);

int __inf_ignore(){
	int t = inf<int>;
	return t;
}

typedef pair<int,int> pii;

#ifdef MY_DEBUG
#include"print.hpp"
#include"debug.hpp"
#endif
// }}}

Int N;
vector<Int> a;

bool judge(int p){
	bool valid = true;
	REP(i,N+1){
		if(a[i]%p!=0)valid = false;
	}
	if(valid)return true;
	if(p>N)return false;
	vector<Int> c(p-1);
	REP(i,N+1){
		c[i%(p-1)] += a[i];
	}
	valid = true;
	REP(i,c.size())if(c[i]%p!=0)valid = false;
	if(valid)return true;
	for(int x = 1;x <= (p-1)/2;x++){
		Int x0 = 1;
		Int s0 = 0, s1 = 1;
		for(int i = 0;i <= N;i++){
			s0 += c[i] * x0;
			if(i%2==0){
				s1 += c[i] * x0;
			}else{
				s1 -= c[i] * x0;
			}
			x0 *= x;x0 %= p;
			s0 %= p; s1 %= p;
			if(s1<0)s1 += p;
		}
		dump(x,s0,s1);
		if(s0%p!=0)return false;
		if(s1%p!=0)return false;
	}
	
	return true;
}

void solve(){
	reverse(ALL(a));
	Int a_ = a[0];
	vector<Int> pdiv;
	for(Int p = 2;p*p<=a_;p++){
		if(a_%p==0){
			pdiv.push_back(p);
			while(a_%p==0)a_/=p;
		}
	}
	if(a_>1)pdiv.push_back(a_);
	sort(ALL(pdiv));
	for(auto &&p:pdiv){
		if(judge(p)){
			cout<<p<<endl;
		}
	}
}
//{{{ main fucnction
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	cin >> N;
    a.assign(N-0+1,Int());
    for(int i = 0 ; i < N-0+1 ; i++){
        cin >> a[i];
    }
	solve();
	return 0;
}
//}}}

Compiler output:
a.cc: In function 'bool judge(int)':
a.cc:80:17: error: 'dump' was not declared in this scope; did you mean 'dup'?
   80 |                 dump(x,s0,s1);
      |                 ^~~~
      |                 dup
Language: C++

x^2-x+2≡0(modp)
(x^2-x+2)^(p-1)!≡1(mod p) count...1
xについての制約がない,0<=x<p
f(x)=x^2-x+2, f(p)=0を満たしたい
1を使えばxもd-1まで調べたらすみそう 
O(d^2*logd)d<1000なので多分間に合う
d<10000だったから間に合わない,自明な枝刈りng
d^2の次元をどうにかして一つ落とす
恐らくまとめられる
剰余式をどうにかするしかなさそう
拡張ユークリッドで中国剰余定理でd->loglogdにならないか
割といけそうだったけどO(d^2*logloglogd)になっただけ
？？？



Compiler output:
a.cc:1:7: error: extended character ≡ is not valid in an identifier
    1 | x^2-x+2≡0(modp)
      |       ^
a.cc:2:17: error: extended character ≡ is not valid in an identifier
    2 | (x^2-x+2)^(p-1)!≡1(mod p) count...1
      |                 ^
a.cc:1:1: error: 'x' does not name a type
    1 | x^2-x+2≡0(modp)
      | ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vt = vector<T>;
template<class T> using vvt = vector<vt<T>>;
template<class T> using ttt = tuple<T,T>;
using tii = tuple<int,int>;
using tiii = tuple<int,int,int>;
using vi = vector<int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define DIV 998244353
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-10;
//const double PI = M_PI;  
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;}

/* Coding space */
map<int,bool> ans;
vt<ll> primes;
bool is_prime(ll a){
  if(a < 2) return 0;
  for(ll i = 2; i*i <= a; ++i)
    if(a % i == 0)  return 0;
  return 1;
}
vt<ll> in;
int n;


ll F(ll x,ll p){
  ll ret = 0;
  for(int i = n; i >= 0; --i)
    ret += pow2(x,(i%p),p)*in[n-i],ret %= p;
  return ret%p;
}
int main(){
  rep(i,10001)  if(is_prime(i))  primes.pb(i);
  cin >> n;
  in.resize(n+1);
   rep(i,n+1) cin >> in[i];
  
  ll gcd_ = abs(in[0]);
  rep(i,n)  gcd_ = __gcd(gcd_, abs(in[i]));
  if( is_prime(gcd_) )  ans[gcd_] = 1;
  for(auto p : primes)if(gcd_ % p == 0)  ans[p] = 1;
  for(auto p: primes){
    if(p > n)  break;
    bool flag = 1;
    for(auto pp: primes){
      if(pp > p)  break;
      if(F(pp,p))  {flag = 0;  break;}
    }
    if(flag) ans[p]  = 1;
  }
  for(auto i: ans)  cout << i.FST << endl;
}


Compiler output:
a.cc: In function 'll F(ll, ll)':
a.cc:41:12: error: 'pow2' was not declared in this scope; did you mean 'powl'?
   41 |     ret += pow2(x,(i%p),p)*in[n-i],ret %= p;
      |            ^~~~
      |            powl
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;

/*
*/

ll n,g;
vector<ll> prime,fact,a;
set<ll> ans;

void prime_list(ll n,vector<ll>& p){
	ll visited[300010]={};
	reg(i,2,n){
		if(visited[i]==0){
			p.push_back(i);
			reg(j,2,n){
				if(j*i>n)break;
				visited[i*j]=1;
			}
		}
	}
}
void factoring(ll n,vector<ll>& v,vector<ll>& p){
	rep(i,p.size()){
		while(n%p[i]==0){
			n/=p[i];
			v.push_back(p[i]);
		}
	}
	if(n>1)v.push_back(n);
}

long long gcd(long long a,long long b){
	if(b==0)return a;
	return gcd(b,a%b);
}

bool division(vector<ll> v,ll p){//ここは変更するのでコピーにしないといけない
	bool ok=true;
	rep(i,v.size())v[i]%=p;
	rep(i,v.size()){
		//今回は計算量短縮のために多項式を陽に与える
		if(i+(p-1)>=v.size()-1)break;//最後は定数なので変えられない
		ll t=v[i];
		v[i]-=t;
		v[i+(p-1)]+=t;
	}
	rep(i,v.size())if(v[i]%p!=0)ok=false;
	return ok;
}

void init(){
	cin>>n;
	reg(i,0,n){
		ll b;
		cin>>b;
		a.push_back(b);
	}
	g=abs(a[0]);
	reg(i,1,n)g=gcd(g,abs(a[i]));
	prime_list(100010,prime);
	factoring(g,fact,prime);
	rep(i,fact.size())ans.insert(fact[i]);
	cerr<<"初期化終了"<<endl;
}

int main(void){
	init();
	rep(i,p.size()){
		if(p[i]>n)break;
		if(division(a,p[i]))ans.insert(p[i]);
	}
	for(auto itr=ans.begin();itr!=ans.end();itr++){
		cout<<*itr<<endl;
	}
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:15: error: 'p' was not declared in this scope
   74 |         rep(i,p.size()){
      |               ^
a.cc:3:41: note: in definition of macro 'rep'
    3 | #define rep(i,n) for(int i = 0;i<((int)(n));i++)
      |                                         ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;

bool is_prime(int x){
  if(x<2){return false;}
  for (int i=2;i*i<=x;++i){
    if(x%i==0){return false;}
  }
  return true;
}

//a.size()=deg +1
bool poly_quotient(vll a, vll b, ll p){
  int d=a.size()-1;
  int e=b.size()-1;
  vll r=a;
  vll q(d-e+1);
  for (int i=d-e+1;i>=0;--i){
    q[i]=r[i+e];
    for (int j=e;i>=0;--i){
      r[j+i]-=q[i]*r[j];
    }
  }

  for (int i=0;i<e;++i){
    if(r[i]%p!=0){return false;}
  }
  return true;
}

int main(){
  int N;cin>>N;
  vll a(N+1);
  vll ans;
  ll g;
  ll c_;cin >> c_;a[N]=c_;g=c_;
  for (int i=N-1;i>=0;--i){
    ll a_;cin>> a_;a[i]=a_;
    g=__gcd(g, a_);
  }


  for (int i=2;i<=N;++i){
    if (is_prime(i)){
      vll b(i+1);
      b[0]=0;b[1]=1;b[i]=1;
      for (int j=2;j<i;++j){b[j]=0;}
    }
    if(poly_quotient(a, b, i)){ans.push_back(i);}
  }
  if(g>N){
    for (int i=N+1;i*i<=g;++i){
      if(is_prime(i)&&g%i==0){
        ans.push_back(i);
      }
    }
    if(is_prime(g)){ans.push_back(g);}
  }

  int L=ans.size();
  if(L==0){cout << ' ' << endl;}
  else{
    for (int i=0;i<L;++i){
      cout << ans[i] << endl;
    }
  }
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:52:25: error: 'b' was not declared in this scope
   52 |     if(poly_quotient(a, b, i)){ans.push_back(i);}
      |                         ^
Language: C++

#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;

const std::int64_t max_value = 1000'000'000;

bool check(int N, std::vector<std::int64_t>const& poly, std::int64_t p)
{
	auto mp = (max_value / p + 1) * p;
	for (std::int64_t i : boost::irange(1LL, std::min<std::int64_t>(N + 2, p)))
	{
		auto x = 1LL;
		auto v = 0LL;
		for (int d : boost::irange(0, N + 1) | adaptor::reversed)
		{
			v += x * (mp + poly[d]);
			v %= p;
			x *= i;
		}
		if (v != 0)
		{
			return false;
		}
	}
	return true;
}

std::vector<std::int64_t> answer(int N, std::vector<std::int64_t>const& poly, std::vector<std::int64_t>const& primes)
{
	std::vector<std::int64_t> ret;
	for (auto p : primes)
	{
		if (check(N, poly, p))
		{
			ret.emplace_back(p);
		}
	}
	return ret;
}

std::vector<std::int64_t> run(int N, std::vector<std::int64_t>const& vec)
{
	std::vector<std::int64_t> prime_factor;
	while (vec[N] == 0)
	{
		--N;
	}
	auto val = std::abs(vec[N]);
	std::vector<unsigned char> sieve(100001);
	for (int p = 2; p <= 100000; ++p)
	{
		if (sieve[p])
		{
			continue;
		}
		if (val % p == 0)
		{
			prime_factor.emplace_back(p);
			while (val % p == 0)
			{
				val /= p;
			}
		}
		for (int k = p; k <= 100000; k += p)
		{
			sieve[k] = true;
		}
	}
	if (val != 1)
	{
		prime_factor.emplace_back(val);
	}
	return answer(N, vec, prime_factor);
}

void Main()
{
	int N;
	std::cin >> N;
	std::vector<std::int64_t> vec(N + 1);	
	for (auto& v : vec)
	{
		std::cin >> v;
	}
	for (auto const& v : run(N, vec))
	{
		std::cout << v << std::endl;
	}
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}


Compiler output:
a.cc:2:9: fatal error: boost/multi_array.hpp: No such file or directory
    2 | #include<boost/multi_array.hpp>
      |         ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include"bits/stdc++.h"
using namespace std;
 
#define MAX 10002
 
int n;
 
vector<int> v;
 
long long int z;
 
set<long long int> vec;
 
long long int calc(long long int term, long long int md) {
  term+=md;
  term% =md;
	long long int g = 0;
	for (int i = 0; i < v.size(); i++) {
		g *= term;
		g %= md;
		g += v[i];
		g %= md;
	}
	return g % md;
}
 
long long int gcd(long long int a, long long int b) {
	if (a > b)swap(a, b);
	while (a) {
		swap(a, b);
		a %= b;
	}
	return b;
}
long long int calc2(long long int term) {
	long long int g = 0;
	for (int i = 0; i < v.size(); i++) {
		g *= term;
		//g %= md;
		g += v[i];
		//g %= md;
	}
	//return g % md;
	return g;
}
bool check(long long int pt,long long int val) {
	long long int z = 1;
	for (int i = 0; i < val; i++)z *= pt;
	for (int i = -20; i < 20; i++) {
		if (calc(i, z) != 0) {
			return false;
		}
	}
	return true;
}
 
map<long long int, int> mp;
vector<long long int> vs;
 
vector<long long int> ans;
inline void dfs(int b,long long int c) {
	if (b == vs.size()) {
		return;
	}
	for (int i = 0; i <mp[vs[b]]; i++) {
		
		dfs(b + 1, c);
		c *= vs[b];
	}
}
 
int main() {
	cin >> n;
	for (int i = 0; i <= n; i++) {
		int a;
		scanf("%d", &a);
		v.push_back(a);
	}
	z = abs(v.back());
	z = gcd(z, abs(calc2(-1)));
	z = gcd(z, abs(calc2(1)));
	for (long long int i = 2; i*i <= z; i++) {
		if (z%i == 0LL) {
			vec.insert(i);
			while (z%i == 0LL) {
				mp[i]++;
				z /= i;
			}
		}
	}
	if (z > 1) {
		mp[z] = 1;
		z = 1;
	}
	for (auto it : mp) {
		/*int mint = 0;
		int maxt = it.second;
		while (mint + 1 < maxt) {
			int mid = (mint + maxt+1) / 2;
			if (check(mid)) {
				mint = mid;
			}
			else {
				maxt = mid - 1;
			}
		}
		if (mint!=maxt&&check(maxt)) {
			mint = maxt;
		}
		else {
			maxt = mint;
		}
		mp[it.first] = mint;*/
		if (check(it.first,1)) {
			ans.push_back(it.first);
		}
	}
	//cout << ans.size() << endl;
	for (int i = 0; i < ans.size(); i++) {
		printf("%lld\n", ans[i]);
	}
	return 0;
}

Compiler output:
a.cc: In function 'long long int calc(long long int, long long int)':
a.cc:16:9: error: expected primary-expression before '=' token
   16 |   term% =md;
      |         ^
Language: C++

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

typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<ll, int> lli;
typedef vector<lli> vlli;

ll prime[100010];
bool is_prime[100010];

//poly fの係数を並べたものがベクトルf
//fがZpの元としてgで割り切れるかどうかを調べる
bool poly_quotient(vll f, vll g, ll p){
  int k=f.size(); //deg(f)+1
  int m=g.size();

  vll q(k-m+1);
  
  vll r(k+1);
  for (int i=0;i<=k;++i){r[i]=f[i]%p;}

  for (int i=k-m;i>=0;--i){
    q[i]=r[i+m]%p;
    for (int j=m;j>=0;--j){
      (r[i+j]-=q[i]*g[j])%=p;
    }
  }

  for (int i=m-1;i>=0;--i){
    if(r[i]!=0){return false;}
  }
  return true;
}

ll gcd(ll x, ll y){
  if(y==0){return x;}
  return gcd(y, x%y);
}



ll multi_gcd(vll a){
  ll ans=a[0];
  int N=a.size();
  for (int i=1;i<N;++i){
    ans=gcd(ans, a[i]);
  }
  return ans;
}

int prime(int N){
  int p=0;
  //initialization
  for (int i=0;i<=N;++i){is_prime[i]=ture;}
  is_prime[0]=false;is_prime[1]=false;
  for (int i=2;i<N;++i){
    if(is_prime[i]){
      prime[p++]=i;
      for(int j=2*i;j<=N;j+=i){is_prime[j]=false;}
    }
  }
  return p;
}

map<ll, int> prime_factor(int g){
  map<ll, int> res;
  for (int i=2;i*i<=g;++i){
    while(n%i==0){res[i]++;g/=i;}
  }
  if(n!=1)res[g]=1;
  return res;
}


int main(){
  int N;cin>>N;
  vll a(N+1);
  for (int i=N;i>=0;--i){
    ll a_;cin>>a_;a[i]=a_;
  }

  vll ans;

  int n=prime(N);
  for (int i=0;i<N;++i){
    ll p=prime[i];
    if(poly_quotient){ans.push_back(p);}
  }

  ll g=multi_gcd(a);
  map<ll, int> prime_factors=prime_factor(g);
  for (auto q:prime_factors){
    ll p=q.first;
    if(p>N){
      ans.push_back(p);
    }
  }
  sort(ans.begin(), ans.end());

  int L=ans.size();
  if(L==0){cout << ' ' << endl;}else{
    for (int i=0;i<L;++i){
      cout << ans[i] << endl;
    }
  }
  return 0;
  
}



Compiler output:
a.cc:53:16: error: 'int prime(int)' redeclared as different kind of entity
   53 | int prime(int N){
      |                ^
a.cc:10:4: note: previous declaration 'll prime [100010]'
   10 | ll prime[100010];
      |    ^~~~~
a.cc: In function 'int prime(int)':
a.cc:56:38: error: 'ture' was not declared in this scope
   56 |   for (int i=0;i<=N;++i){is_prime[i]=ture;}
      |                                      ^~~~
a.cc: In function 'std::map<long long int, int> prime_factor(int)':
a.cc:70:11: error: 'n' was not declared in this scope
   70 |     while(n%i==0){res[i]++;g/=i;}
      |           ^
a.cc:72:6: error: 'n' was not declared in this scope
   72 |   if(n!=1)res[g]=1;
      |      ^
a.cc: In function 'int main()':
a.cc:86:14: error: 'prime' cannot be used as a function
   86 |   int n=prime(N);
      |         ~~~~~^~~
Language: C++

#ifndef UTIL_INCLUDED
#define UTIL_INCLUDED

#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()
#define DEBUGGING

template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;
template <typename T, typename U> using P = pair<T, U>;
using ll = int64_t;
using PLL = P<ll, ll>;

template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename Head, typename... Tail> const Head& var_min(const Head &head, const Tail&... tail) { return min(head, var_min(tail...)); }
template <typename Head, typename... Tail> const Head& var_max(const Head &head, const Tail&... tail) { return max(head, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }

namespace __init {

struct InitIO {
    InitIO() {
        cin.tie(0);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

}

#ifndef DEBUG_FILE
#ifdef DEBUGGING
#include "../debug.cpp"
#else
#define DEBUG(...) 0
#endif
#endif

#endif

V<ll> A;
ll N;

bool check(ll idx, ll want_mod, ll p) {
    if(idx == -1) return want_mod == 0;
    ll mod = A[idx] % p;
    (want_mod += p - mod) %= p;
    return check(idx - 1, want_mod, p);
}

int main() {
    cin >> N;
    N++;
    A.resize(N);
    for(ll &e : A) cin >> e;

    V<ll> ps;
    {
        ll cpy = abs(A.back());
            for(ll i = 2; i * i <= cpy; i++) {
                ll cnt = 0;
                while(cpy % i == 0) {
                    cpy /= i;
                    cnt++;
                }
                if(cnt) ps.push_back(i);
            }
        if(cpy > 1) ps.push_back(cpy);
    }


    for(ll p : ps) if(check(N - 1, 0, p)) cout << p << endl;
    return 0;
}


Compiler output:
a.cc:38:10: fatal error: ../debug.cpp: No such file or directory
   38 | #include "../debug.cpp"
      |          ^~~~~~~~~~~~~~
compilation terminated.