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

// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__)
#define int long long int
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
typedef pair<int, int> pii;
typedef long long ll;
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

vector<int> get_primes(int N) {
    vector<int> res;
    for(int i=2; i*i<=N; i++) {
        if(N % i == 0) {
            res.push_back(i);
            while(N % i == 0) N /= i;
        }
    }
    if(N > 1) res.push_back(N);
    return res;
}

bool expr_div(const vector<int> &A, const int &p) {
    int N = A.size();
    vector<int> vec(p);
    for(int i=0; i<N; i++) {
        int mo = (A[i] >= 0 ? A[i] : p - (-A[i] % p));
        (vec[i % (p - 1)] += mo) %= p;
    }

    bool all_zero = true;
    for(int i=0; i<p; i++) {
        // fprintf(stderr, "p = %lld, vec[%lld] = %lld\n", p, i, vec[i]);
        all_zero &= (vec[i] == 0);
    }
    return all_zero;
}

// エラトステネスの篩
// [0,n) の範囲の i について、primes[i] != 0 ⇔ i は素数
vector<int> erat(int n) {
    vector<int> primes(n);
    for (int i = 2; i < n; ++i) primes[i] = i;
    for (int i = 2; i*i < n; ++i)
        if (primes[i])
            for (int j = i*i; j < n; j+=i) primes[j] = 0;
    // 素数のみをvectorに格納する場合は以下の行を追加 (0 である要素を全削除)
    primes.erase(remove(primes.begin(), primes.end(), 0), primes.end());
    return primes;
}

signed main() {
    int N; cin >> N;
    vector<int> A(N+1);

    int g = 0;
    set<int> ans;
    vector<int> primes = erat(N+2);
    for(int i=N; i>=0; i--) {
        cin >> A[i];
        g = __gcd(g, abs(A[i]));
    }
    
    vector<int> p0 = get_primes(g);
    for(auto e : p0) ans.insert(e);

    for(auto e : primes) {
        if(A[N] % p != 0) continue;
        if(expr_div(A, e)) ans.insert(e);
    }

    for(auto e : ans) cout << e << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:101:19: error: 'p' was not declared in this scope
  101 |         if(A[N] % p != 0) continue;
      |                   ^
Language: C++

#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <tuple>
#include <cassert>

using namespace std;


#define all(c) (c).begin(), (c).end()
#define iter(c) __typeof((c).begin())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(c, i) for (iter(c) i = (c).begin(); i != (c).end(); ++i)
#define pb(e) push_back(e)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define mp(a,b) make_pair((a), (b))
#define mt(a,b,c) make_tuple((a),(b),(c))

typedef long long ll;

vector<int> prime_table;
void prime_fill(int n){
    for(int i=2; i<=n;i++){
        bool flag = true;
        for(auto x: prime_table) if(i % x == 0){flag = false; break;}
        if(flag) prime_table.push_back(i);
    }
}
long long int gcd(long long int x,long long int y){
    long long int r;
    if(x == 0 || y == 0)  return 0;

    while((r = x % y) != 0) 
    {
         x = y;
        y = r;
    }
    return y;
}

int main(){
    int n; cin >> n;
    vector<int> a(n+1); rep(i,n+1) cin >> a[n-i];
    prime_fill(10000);
    set<int> ans;
    for(int j=0; j < prime_table.size() && prime_table[j] <= n;j++){
        vector<int> b(p);
        b[0] = a[0] % p;
        for(int i=1;i<=n;i++){
            b[i % (p-1) + 1] =  (b[i % (p-1) + 1] + a[i]) % p;
        }
        bool flag = true;
        for(auto x: b) if(x % p != 0){flag = false; break;}
        if(flag)  ans.insert(p);
    }
    long long int gc = a[0];
    for(auto x: a) gc = gcd(gc, (long long) x);
    while(gc!=1){
        bool di = true;
        for(auto x: prime_table) if(gc % x == 0){
            di = false;
            gc = gc  / x;
            ans.insert(x);
            break;
        }
        if(di){
            ans.insert(gc);
            break;
        }
    }
    for(auto x: ans) cout << x <<endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:59:23: error: 'p' was not declared in this scope
   59 |         vector<int> b(p);
      |                       ^
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 = 1000000000;

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)
	{
		std::int64_t max = 0;
		for (auto i : boost::irange<std::int64_t>(0, p))
		{
			std::int64_t v = 0;
			for (int k : boost::irange<int>(i, N + 1, p))
			{
				v += (max_value * p + poly[N - k]);
				v %= p;
			}
			max = std::max(max, v);
		}
		if (max == 0)
		{
			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;
	auto val = std::abs(vec[N]);
	if (val == 1)
	{
		return {};
	}
	if (val % 2 == 0)
	{
		prime_factor.emplace_back(2);
		while (val % 2 == 0)
		{
			val /= 2;
		}
	}
	for (int p = 3; p * p <= val; p += 2)
	{
		if (val % p == 0)
		{
			prime_factor.emplace_back(p);
			while (val % p == 0)
			{
				val /= p;
			}
		}
	}
	if (val != 1)
	{
		prime_factor.emplace_back(val);
	}
	out::debug(prime_factor);
	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"
#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 = 1000000000;

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)
	{
		std::int64_t max = 0;
		for (auto i : boost::irange<std::int64_t>(0, p))
		{
			std::int64_t v = 0;
			for (int k : boost::irange<int>(i, N + 1, p))
			{
				v += (max_value * p + poly[N - k]);
				v %= p;
			}
			max = std::max(max, v);
		}
		if (max == 0)
		{
			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;
	auto val = std::abs(vec[N]);
	if (val == 1)
	{
		return {};
	}
	if (val % 2 == 0)
	{
		prime_factor.emplace_back(2);
		while (val % 2 == 0)
		{
			val /= 2;
		}
	}
	for (int p = 3; p * p <= val; p += 2)
	{
		if (val % p == 0)
		{
			prime_factor.emplace_back(p);
			while (val % p == 0)
			{
				val /= p;
			}
		}
	}
	if (val != 1)
	{
		prime_factor.emplace_back(val);
	}
	out::debug(prime_factor);
	return answer(N, vec, prime_factor);
}

void Main()
{
	int N;
	std::cin >> N;
	std::vector<std::int64_t> vec(N + 1);
	lib::randomizer random;
	for (auto& v : vec)
	{
		//std::cin >> v;
		v = random(-max_value, max_value);
	}
	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 <iostream>
#include <vector>
#include <set>
using namespace std;

vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

long long GCD(long long a, long long b) {
    if (a < 0) a = -a;
    if (b < 0) b = -b;
    if (b == 0) return a;
    else return GCD(b, a % b);
}


vector<bool> isprime;
vector<int> Era(int n) {
    isprime.resize(n, true);
    vector<int> res;
    isprime[0] = false; isprime[1] = false;
    for (int i = 2; i < n; ++i) isprime[i] = true;
    for (int i = 2; i < n; ++i) {
        if (isprime[i]) {
            res.push_back(i);
            for (int j = i*2; j < n; j += i) isprime[j] = false;
        }
    }
    return res;
}

int main() {
    long long N; cin >> N;
    vector<long long> a(N+1);
    for (int i = 0; i < N+1; ++i) cin >> a[i];
    reverse(a.begin(), a.end());

    set<long long> res;
     
    // f(x) ≡ 0 の場合
    long long g = 0;
    for (int i = 0; i < N+1; ++i) g = GCD(g, a[i]);
    auto pf = prime_factorize(g);
    for (auto p : pf) res.insert(p.first);

    // N 以下の素数 p をすべて試す
    auto prs = Era(10101);
    for (auto p : prs) {
        vector<long long> c(p, 0);
        for (int d = 0; d < p; ++d) c[d] = a[d] % p;
        for (int d = p; d <= N; ++d) {
            int r = d % (p-1);
            if (r == 0) r = p-1;
            c[r] = (c[r] + a[d] % p) % p;
        }

        bool ok = true;
        for (int d = 0; d < p; ++d) if (c[d] != 0) ok = false;
        if (ok) res.insert(p);
    }
    for (auto p : res) cout << p << endl;
}














Compiler output:
a.cc: In function 'int main()':
a.cc:45:5: error: 'reverse' was not declared in this scope
   45 |     reverse(a.begin(), a.end());
      |     ^~~~~~~
Language: C++

#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tii tuple<int,int,int>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define edge(v,a,b) v[a].pb(b);v[b].pb(a);
#define MAX_V 400010
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define ALL(c) (c).begin(),(c).end()
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}

#define INF 1e9+7
#define LLINF 1e18+7
ll MOD=1e9+7;
#define N 110000

ll gcd(ll x,ll y){
    for(;y;swap(a,b))a%=b;
    return a;
}
ll a[11000];
main(){
    ll n=in();
    ll g=0;
    for(int i=n;i>=0;i--){
        a[i]=in();
        g=gcd(g,a[i]);
    }
    vector<ll> ans;
    for(ll i=2;i*i<=g;i++){
        if(g%i==0){
            ans.pb(i);
            while(g%i==0){
                g/=i;
            }
        }
    }
    if(g>1)ans.pb(g);
    int prime[33000]={};
    prime[0]=prime[1]=1;
    vector<ll> v;
    rep2(i,2,n){
        if(!prime[i]){
            v.pb(i);
            for(int j=i*2;j<=23000;j+=i){
                prime[j]=1;
            }
        }
    }
    for(auto p:v){
        ll s[11000]={};
        if(a[0]%p!=0)continue;
        rep(i,n+1){
            s[i%(p-1)]+=a[i]%p;
        }
        bool flag=true;
        rep(i,p-1){
            if(s[i]%p!=0)flag=false;
        }
        if(flag&&(a[0]%p==0))ans.pb(p);
    }
    sort(ALL(ans));
    ans.erase(unique(ALL(ans)),ans.end());
    for(auto e:ans)cout<<e<<endl;
}


Compiler output:
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:53:17: error: 'a' was not declared in this scope
   53 |     for(;y;swap(a,b))a%=b;
      |                 ^
a.cc:53:19: error: 'b' was not declared in this scope
   53 |     for(;y;swap(a,b))a%=b;
      |                   ^
a.cc:54:12: error: 'a' was not declared in this scope
   54 |     return a;
      |            ^
a.cc: At global scope:
a.cc:57:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   57 | main(){
      | ^~~~
Language: C++

#include <stdlib.h>
#include <assert.h>
#include <iostream>
#include <algorithm>
#include <functional>
#include <queue>
#include <deque>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <complex>
#include <iomanip>
#include <bitset>
#include <random>
#include <vector>
#include<string>

using namespace std;

int main() {
	long n, i, j, a[11111], ca, p[111], flag = 0, ans[111], t = 0, u = 0,c[111111];
	cin >> n;
	for (i = n; i >= 0; i--)
		cin >> a[i];
	for (i = 0; i < 111; i++)
		p[i] = 0;
	ca = a[0];
	for (i = 2; i*i <= a[0]; i++) {
		if (ca % i == 0) {
			while (ca % i == 0)
				ca = ca / i;
			p[t] = i;
			t++;
			flag = 1;
		}
	}
	if (flag == 0 && a[0] != 1) {
		p[0] = a[0];
		t++;
	}
	if (t > 0) {
		if (ca != p[t - 1]&&ca!=1) {
			p[t] = ca;
			t++;
		}
	}
	for (i = 0; i < t; i++) {
		if (p[i] == 2) {
			long sum = 0;
			for (j = 1; j <= n; j++)
				sum += a[j];
			if (sum % 2 == 0) {
				ans[u] = 2;
				u++;
			}
		}
		else {
			for (j = 0; j < 111111; j++)
				c[j] = 0;
			if (n == 0) {
				ans[u] = p[i];
				u++;
			}
			else if (p[i] < 100000) {
				int flag2 = 1;
				for (j = 1; j <= n; j++){
                  int q=a[j]%p[i];
                  if(q<0)
                    q+=p[i];
					c[q]++;
				for (j = 2; j < p[i]; j++) {
					if (c[j] != c[j - 1])
						flag2 = 0;
				}
				if (flag2 == 1) {
					ans[u] = p[i];
					u++;
				}
			}
		}
	}
	for (i = 0; i < u; i++)
		cout << ans[i] << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:88:2: error: expected '}' at end of input
   88 | }
      |  ^
a.cc:24:12: note: to match this '{'
   24 | int main() {
      |            ^
Language: C++

#include <stdio.h>  
#include <algorithm>  
#include <assert.h>
#include <bitset>
#include <cmath>  
#include <complex>  
#include <deque>  
#include <functional>  
#include <iostream>  
#include <limits.h>  
#include <map>  
#include <math.h>  
#include <queue>  
#include <set>  
#include <stdlib.h>  
#include <string.h>  
#include <string>  
#include <time.h>  
#include <unordered_map>  
#include <unordered_set>  
#include <vector>  
#include <chrono>
#include <random>
#include <time.h>
#define ll long long
#define rep2(i,a,b) for(ll i=a;i<=b;++i)
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep3(i,a,b) for(ll i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tii tuple<int,int,int>
#define pq priority_queue<int>
#define pqg priority_queue<int,vector<int>,greater<int>>
#define pb push_back
#define edge(v,a,b) v[a].pb(b);v[b].pb(a);
#define MAX_V 400010
#define vec vector<int>
#define vecll vector<ll>
#define vecpii vector<pii>
#define endl "\n"
#define ALL(c) (c).begin(),(c).end()
using namespace std;
int in() {int x;scanf("%d",&x);return x;}
ll lin() {ll x;scanf("%lld",&x);return x;}

#define INF 1e9+7
#define LLINF 1e18+7
ll MOD=1e9+7;
#define N 110000

ll gcd(ll x,ll y){
    if(y==0)return x;
    else return gcd(y,x%y);
}
main(){
    ll n=in();
    ll a[11000];
    ll g=0;
    rep(i,n+1){
        a[n-i]=in();
        g=gcd(a[n-i],g);
    }
    vector<ll> ans;
    for(ll i=2;i*i<=g;i++){
        if(g%i==0){
            v.pb(i);
            while(g%i==0){
                g/=i;
            }
        }
    }
    if(g>1)v.pb(g);
    int prime[33000]={};
    prime[0]=prime[1]=1;
    vector<ll> v;
    rep2(i,2,n){
        if(!prime[i]){
            v.pb(i);
            for(int j=i*2;j<=23000;j+=i){
                prime[j]=1;
            }
        }
    }
    for(auto p:v){
        ll s[11000]={};
        rep(i,n+1){
            s[i%(p-1)]+=a[i];
        }
        bool flag=true;
        rep(i,min(n+1,p-1)){
            if(s[i]%p!=0)flag=false;
        }
        if(flag&&(a[0]%p==0))ans.pb(p);
    }
    sort(ALL(ans));
    ans.erase(unique(ALL(ans)),ans.end());
    for(auto e:ans)cout<<e<<endl;
}


Compiler output:
a.cc:56:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   56 | main(){
      | ^~~~
a.cc: In function 'int main()':
a.cc:67:13: error: 'v' was not declared in this scope
   67 |             v.pb(i);
      |             ^
a.cc:73:12: error: 'v' was not declared in this scope
   73 |     if(g>1)v.pb(g);
      |            ^
Language: C++

#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <queue>
#include <iostream>
#include <bitset>
using namespace std;
#define N 10005
#define ll long long
int a[N],n,pri[N*20],tot,vis[N];ll sum=0;
void get_pri(int x)
{
	for(int i=2;i<=x/i;i++)
	{
		if(x%i==0)
		{
			pri[++tot]=i;
			while(x%i==0)x/=i;
		}
	}if(x!=1)pri[++tot]=x;
}
int q_pow(int x,int n,int mod){int ret=1;for(;n;n>>=1,x=(ll)x*x%mod)if(n&1)ret=(ll)ret*x%mod;return ret;}
int main()
{
	scanf("%d",&n);
	for(int i=2;i<=n;i++)if(!vis[j])for(int j=i+i;j<=n;j+=i)vis[j]=1;
	for(int i=2;i<=n;i++)if(!vis[j])pri[++tot]=j;
	for(int i=n;~i;i--)scanf("%d",&a[i]),get_pri(abs(a[i]));
	sort(pri+1,pri+tot+1);tot=unique(pri,pri+tot+1)-pri-1;
	for(int k=1;k<=tot;k++)if(a[0]%pri[k]==0)
	{
		bool flag=1;int mod=pri[k];
		for(int i=2;i<=20;i++)
		{
			int ret=0,now=i;
			for(int j=1;j<=n;j++)ret=(ret+(ll)now*a[j])%mod,now=(ll)now*i%mod;
			if(ret!=0){flag=0;break;}
		}
		if(flag)printf("%d\n",pri[k]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:38: error: 'j' was not declared in this scope
   28 |         for(int i=2;i<=n;i++)if(!vis[j])for(int j=i+i;j<=n;j+=i)vis[j]=1;
      |                                      ^
a.cc:29:38: error: 'j' was not declared in this scope
   29 |         for(int i=2;i<=n;i++)if(!vis[j])pri[++tot]=j;
      |                                      ^
Language: C++

#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <queue>
#include <iostream>
#include <bitset>
using namespace std;
#define N 10005
#define ll long long
int a[N],n,pri[N*9],tot;ll sum=0;
void get_pri(int x)
{
	for(int i=2;i<=x/i;i++)
	{
		if(x%i==0)
		{
			pri[++tot]=i;
			while(x%i==0)x/=i;
		}
	}if(x!=1)pri[++tot]=x;
}
int q_pow(int x,int n,int mod){int ret=1;for(;n;n>>=1,x=(ll)x*x%mod)if(n&1)ret=(ll)ret*x%mod;return ret;}
int main()
{
	scanf("%d",&n);
	for(int i=2;i<=n;i++)if(!vis[j])for(int j=i+i;j<=n;j+=i)vis[j]=1;
	for(int i=2;i<=n;i++)if(!vis[j])pri[++tot]=j;
	for(int i=n;~i;i--)scanf("%d",&a[i]),get_pri(abs(a[i]));
	sort(pri+1,pri+tot+1);tot=unique(pri,pri+tot+1)-pri-1;
	for(int k=1;k<=tot;k++)if(a[0]%pri[k]==0)
	{
		bool flag=1;int mod=pri[k];
		for(int i=2;i<=20;i++)
		{
			int ret=0,now=i;
			for(int j=1;j<=n;j++)ret=(ret+(ll)now*a[j])%mod,now=(ll)now*i%mod;
			if(ret!=0){flag=0;break;}
		}
		if(flag)printf("%d\n",pri[k]);
	}
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:34: error: 'vis' was not declared in this scope
   28 |         for(int i=2;i<=n;i++)if(!vis[j])for(int j=i+i;j<=n;j+=i)vis[j]=1;
      |                                  ^~~
a.cc:28:38: error: 'j' was not declared in this scope
   28 |         for(int i=2;i<=n;i++)if(!vis[j])for(int j=i+i;j<=n;j+=i)vis[j]=1;
      |                                      ^
a.cc:29:34: error: 'vis' was not declared in this scope
   29 |         for(int i=2;i<=n;i++)if(!vis[j])pri[++tot]=j;
      |                                  ^~~
a.cc:29:38: error: 'j' was not declared in this scope
   29 |         for(int i=2;i<=n;i++)if(!vis[j])pri[++tot]=j;
      |                                      ^
Language: C++

#include "bits/stdc++.h"

using namespace std;

#define int long long
#define ll long long
typedef pair<int, int> P;
#define mod 1000000007
#define INF (1LL<<60)

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl


// aとbの最大公約数
ll gcd(ll a, ll b) {
	if (a < b) gcd(b, a);
	ll r;
	while ((r = a%b)) {
		a = b;
		b = r;
	}
	return b;
}

// nの素因子
set<int> prime(int n){
	set<int> ret;
	for (int p = 2; p*p <= n; p++){
		if (n%p == 0){
			ret.insert(p);
			while (n % p == 0) n /= p;
		}
	}
	if (n>1) ret.insert(n);
	return ret;
}

// 素数判定
bool isprime(int  n){
	if (n < 2) return false;
	else if (n == 2) return true;
	else if (n % 2 == 0) return false;
	else
		for (int i = 3; i*i <= n; i++)
			if (n%i == 0) return false;

	return true;
}

// n以下のエラトステネスのふるい
vector<bool> prime_table(int n){
	vector<bool> v(n + 1);

	for (int i = 0; i <= n; i++){
		v[i] = true;
	}
	v[0] = v[1] = false;
	for (int i = 2; i*i <= n; i++){
		if (isprime(i)){
			int j = 2 * i;
			while (j <= n){
				v[j] = false;
				j = j + i;
			}
		}
	}
	return v;
}

signed main(){

	int N;
	cin >> N;
	vector<int> a(N + 1);
	rep(i, N + 1) cin >> a[N - i];

	set<int> ans;

	// a[i]のgcdは自明
	int g = abs(a[N]);
	for (int i = 0; i < N; i++){
		if (a[i] != 0)
			g = gcd(g, abs(a[i]));
	}

	ans = prime(g);

	// あらかじめgcdで割っておく
	rep(i, N + 1) a[i] /= g;

	//	vector<bool> era = prime_table(10001);

	// 候補についてチェック
	for (int p = 2; p <= 10001; p++){
		if (!isprime(p)) continue;
		//		if (era[p] == false) continue;
		vector<int> c;
		c = a;
		for (int i = p; i <= N; i++)
			c[i % (p - 1)] += c[i];

		// すべてがpで割り切れるか
		bool found = true;
		rep(i, p){
			if (abs(c[i]) % p == 0) continue;
			else {
				found = false;
				break;
			}
		}
		if (found){
			if ((c[p - 1] + c[0]) %=p)
			ans.insert(p);
		}

	}

//	ans.insert(2);
	for (int p : ans){
//		if (isprime(p))
		cout << p << endl;
	}

	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:116:39: error: lvalue required as left operand of assignment
  116 |                         if ((c[p - 1] + c[0]) %=p)
      |                             ~~~~~~~~~~^~~~~~~
Language: C++

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

int main() {
    long long N;
    std::cin >> N;

    std::vector<long long> a(N + 1);
    long long plus, minus, gcd;
    std::cin >> a[N];
    plus = minus = a[N];
    gcd = std::abs(a[N]);

    auto calc_gcd = [] (long long lhs, long long rhs) {
        if (lhs == 0 || rhs == 0) {
            return (long long)0;
        }
        while (lhs != rhs) {
            if (lhs > rhs) lhs = lhs - rhs;
            else rhs = rhs - lhs;
        }
        return lhs;
    };

    for (long long i = N - 1; i >= 0; i--) {
        std::cin >> a[i];
        gcd = calc_gcd(gcd, std::abs(a[i]));

        if (i % 2 == 0) {
            plus += a[i];
            minus += a[i];
        } else {
            plus += a[i];
            minus -= a[i];
        }
    }

    std::vector<int> primes;
    for (int j = 2; j < std::ceil(std::sqrt(gcd)); j++) {
        if (gcd % j == 0) {
            gcd /= j;
t            primes.push_back(j);
            if (gcd == 1) break;
        }
    }
    if (gcd != 1) primes.push_back(gcd);

    plus = std::abs(plus) / gcd;
    minus = std::abs(minus) / gcd;
    long long a0 = a[0] / gcd;

    long long mini = std::min(std::min(plus, minus), a0);

    for (int i = 2; i < mini + 1; i++) {
        if (plus % i == 0 && minus % i == 0 && a0  % i == 0) {
            primes.push_back(i);
            plus /= i;
            minus /= i;
            a0 /= i;
             if (plus == 1 || minus == 1 || a0 == 1) break;
        }
    }
    std::sort(primes.begin(), primes.end(), [](const auto &lhs , const auto &rhs) { return lhs < rhs; });
    for (auto i : primes) {
        std::cout << i << std::endl;
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:1: error: 't' was not declared in this scope
   44 | t            primes.push_back(j);
      | ^
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <sstream>
#include <math.h>
#include <queue>
#include <map>
#include <set>
#include <ios>     // std::left, std::right
#include <iomanip> // std::setw(int), std::setfill(char)
using namespace std;


int main(){
 int N;
 cin>>N;
 vector<long long> test_1;
 vector<long long> test_2;
 vector<long long> answers;
 long long a;
 for(int i=0;++i;i<N){
   cin>>a;
   test_1.push_back(a);
   test_2.push_back(a);
 }
 //test1、係数の最大公約数
 //大きさ順にソート 
 sort(test_1.begin(),test_1.end());
 long long cand=test_1[0];
 //初期値
 bool judge=true;
 long long a=2;
 while(cand>=a*a){
   judge=false;
   if(cand%a==0){
     judge=true;
     while(cand%a==0){
       cand/=a;
     }
     for(int i=0;i<N;++i){
       if(test_1[i]%a!=0){
         judge=false;
       }
     }
     if(judge){
       answers.push_back(a);
     }
   }
 }

 //test2、連続するnこの整数を取りうるかどうか、ai<10^9なので高々13
 //2 check
 vector<int> num_list;
 num_list.push_back(2);
 num_list.push_back(3);
 num_list.push_back(5);
 num_list.push_back(7);
 num_list.push_back(11);
 num_list.push_back(13);
 int target;
 long long tmp,tmp_result;

sort(answers.begin(),answers.end());
for(int i=0;i<answers.size();i++){
  cout<<answers[i]<<"\n";
}
return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:34:12: error: redeclaration of 'long long int a'
   34 |  long long a=2;
      |            ^
a.cc:22:12: note: 'long long int a' previously declared here
   22 |  long long a;
      |            ^
Language: C++

#include <iostream>
#include <iomanip>
#include <ios> 
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <map>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define sz(c) ((int)(c).size())

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
const int MAX=1e4+4;
//prime[i]はi番目の素数
//isp[j]はjが素数か判定
//エラトステネスの篩を用いる
int prime[31623];
bool isp[31623];

int main(){
	int n;
	cin>>n;
	int a[MAX];
	rep(i,n+1){
		cin>>a[n-i];
	}
	
	
	int N=31622;
	int p = 0;
	//初期化
	for(int i=0;i<=N;i++)isp[i]=true;
	isp[0]=isp[1]=false;
	//2以上で素数ならふるい落とす
	for(int i=2;i<=N;i++){
		if(isp[i]){
			p++;
			prime[p]=i;
			for(int j=2*i;j<=N;j+=i) isp[j]=false;
		}
	}
	vi pra;
	int x=abs(a[n]);
	rep(i,N){
		if(!isp[i])continue;
		if(x%i==0){
			pra.push_back(i);
			while(x%i==0){
              	x/=i;
            }
		}
	}
	if(x!=1)pra.push_back(x);
	int l=sz(pra);
	sort(pra.begin(),pra.end());
//  rep(i,l)cout<<pra[i]<<endl;
	
	set<int>ans;
  	rep1(i,10000){
    	if(!isp[i])continue;
    	int q=i;
		ll b[10000];
		ll Q=(ll)q;
		rep(k,q-1)b[k]=0;
		rep(j,n+1)b[j%(q-1)]=b[j%(q-1)]+(ll)a[j];
//      	if(q==2)cout<<b[0]<<endl;
		bool ok=true;
		rep(k,q-1)if(b[k]%Q!=0)ok=false;
		if(ok)ans.insert(q);
    }
	rep(i,l){
		int q=pra[i];
		if(q>n){
			bool ok=true;
			rep1(j,n)if(a[j]%q!=0)ok=false;
			if(ok) ans.insert(q);
		}
	}
    for(auto itr = st.begin(); itr != st.end(); ++itr) {
        std::cout << *itr << "\n";      // イテレータの指す先のデータを表示
    }
}


Compiler output:
a.cc: In function 'int main()':
a.cc:88:20: error: 'st' was not declared in this scope; did you mean 'std'?
   88 |     for(auto itr = st.begin(); itr != st.end(); ++itr) {
      |                    ^~
      |                    std
Language: C++

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

#ifdef LOCAL
#include "../../dump.hpp"
#else
#define dump(...)
#endif

#define int ll
#define rep(i,n) for(int i=0,i##_cond=(n);i<i##_cond;++i)
#define FOR(i,a,b) for(int i=(a),i##_cond=(b);i<i##_cond;++i)
#define ROF(i,a,b) for(int i=(a)-1,i##_cond=(b);i>=i##_cond;--i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで大きい順
#define sz(x) ((int)(x).size())
#define pb push_back
#define fst first
#define snd second
#define mp make_pair
using ll  = long long;
using vi  = vector<int>;
using vvi = vector<vi>;
using vs  = vector<string>;
using pii = pair<int,int>;
constexpr ll inf = 1ll<<61;
constexpr ll mod = 1e9+7;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>void add(T &a, const T &b){a += b; a %= mod;}

ll ext_gcd(ll a, ll b, ll &x, ll &y){ // ax+by=gcd(a,b)なるx,y,gcdを返す
  if(b == 0){
    x = 1; y = 0; return a;
  }
  ll q = a / b;
  ll g = ext_gcd(b, a-q*b, x, y);
  ll z = x - q * y;
  x = y; y = z;
  return g;
}

signed main(){
  int n; cin >> n;
  vi a(n+1); rep(i,n+1) cin >> a[n-i];
  int gcda = -1;
  if(a[0]) gcdv = abs(a[0]));;

  vvi b(n+1,vi(n+1));
  b[0][0] = 1;
  rep(i,n){
    rep(j,n+1){
      b[i+1][j] = b[i][j];
    }
    rep(j,n){
      b[i+1][j+1] += b[i][j];
    }
    b[i][i] = 0;
  }
  b[n][n] = 0;

  rep(_,n){
    rep(j,n){
      int tmpx = 0;
      FOR(i,j+1,n+1){
	tmpx += b[i][j] * a[i];
      }
      a[j] = tmpx;
    }
    ll x, y;
    if(a[0] and gcdv > 0) gcdv = ext_gcd(gcda, abs(a[0]),x,y);
    if(gcdv == 1) return;
  }

  FOR(i,2,sqrt(gcdv)+2){
    if(gcdv % i == 0) cout << i << endl;
    while(gcdv % i == 0) gcdv /= i;
  }
  if(gcdv != 1) cout << gcdv << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:46:12: error: 'gcdv' was not declared in this scope; did you mean 'gcda'?
   46 |   if(a[0]) gcdv = abs(a[0]));;
      |            ^~~~
      |            gcda
a.cc:70:17: error: 'gcdv' was not declared in this scope; did you mean 'gcda'?
   70 |     if(a[0] and gcdv > 0) gcdv = ext_gcd(gcda, abs(a[0]),x,y);
      |                 ^~~~
      |                 gcda
a.cc:71:8: error: 'gcdv' was not declared in this scope; did you mean 'gcda'?
   71 |     if(gcdv == 1) return;
      |        ^~~~
      |        gcda
a.cc:71:19: error: return-statement with no value, in function returning 'int' [-fpermissive]
   71 |     if(gcdv == 1) return;
      |                   ^~~~~~
a.cc:74:16: error: 'gcdv' was not declared in this scope; did you mean 'gcda'?
   74 |   FOR(i,2,sqrt(gcdv)+2){
      |                ^~~~
a.cc:12:44: note: in definition of macro 'FOR'
   12 | #define FOR(i,a,b) for(int i=(a),i##_cond=(b);i<i##_cond;++i)
      |                                            ^
a.cc:78:6: error: 'gcdv' was not declared in this scope; did you mean 'gcda'?
   78 |   if(gcdv != 1) cout << gcdv << endl;
      |      ^~~~
      |      gcda
Language: C++

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

bool isprime(long long int val) {
    if (val <= 1)return false;
    for (long long int i = 2; i*i <= val; i++) {
        if (val%i == 0LL)return false;
    }
    return true;
}

int main(){
    int n;
    cin>>n;
    long long a[n+1];
    long long sum=0;
    long long rsum=0;
    for(int i=0;i<=n;i++){
        cin>>a[i];
       sum+=a[i];

    }
    for(int i=0;i<=n;i++){
        if(i%2==0){
           rsum+=a[i];
        }
        else rsum-=a[i];
    }
    vector<long long> st;
    cerr<<rsum<<" "<<sum<<" "<<a[n]<<endl;
    
    for(long long i=2;i*i<=abs(a[n]);i++){
        if(a[n]%i==0){
            if(isprime(i))st.push_back(i);
            if(isprime(a[n]/i)) st.push_back(a[n]/i);
            //cerr<<i<<" "<<a[n]/i<<endl;
        }
    }
    if(isprime(a[n])) st.push_back(a[n]);

    sort(v.begin(),v.end());



    long long t=abs(rsum),u=abs(sum);
    bool ok=true;
    for(auto i:st){
        ok=true;
        if(t%i==0 && u%i==0){
            int kk=0;
            for(int j=0;j<n;j++){
                kk+=a[j]%i;
            }
            if(kk%i==0) cout<<i<<endl;
        }
    }

}
 

Compiler output:
a.cc: In function 'int main()':
a.cc:41:10: error: 'v' was not declared in this scope
   41 |     sort(v.begin(),v.end());
      |          ^
Language: C++

#ifdef __GNUC__ 
#include <bits/stdc++.h>
#endif
using namespace std;
uint64_t gcd(uint64_t l, uint64_t r) {
	if (r == 0)return l;
	return gcd(r, l%r);
}
template <uint64_t maxval>
struct Prime {
	uint64_t primevals[maxval / 8];
	uint64_t primecount;
	constexpr Prime() {
		primecount = 0;
		for (uint64_ti = 2; i < maxval; ++i) {
			for (uint64_t j = 0; j < primecount; ) {
				if (i%primevals[j] == 0) {
					++i; j = 0;
				}
				else {
					++j;
				}
			}
			primevals[primecount] = i;
			++primecount;
		}
	}
	void primeout(uint64_t a) {
		uint64_t tmp;
		for (uint64_t i = 0; i < primecount; ++i) {
			tmp = gcd(a, primevals[i]);
			if (tmp != 1) {
				cout << tmp << " ";
				a = a / tmp;
			}
			if (primevals[i] > a)return;
		}
	}
};
Prime<50000> prime;
int main() {
	uint64_t n; uint64_t tmp;
	cin >> n;
	vector<uint64_t> a(n);
	for (uint64_t i = 0; i < n; ++i) { cin >> a[i]; }
	tmp = a[0];
	for (auto i : a) { tmp = gcd(tmp, i); }
	prime.primeout(tmp);
}


Compiler output:
a.cc: In constructor 'constexpr Prime<maxval>::Prime()':
a.cc:15:22: error: 'uint64_ti' was not declared in this scope; did you mean 'uint64_t'?
   15 |                 for (uint64_ti = 2; i < maxval; ++i) {
      |                      ^~~~~~~~~
      |                      uint64_t
a.cc:15:37: error: 'i' was not declared in this scope
   15 |                 for (uint64_ti = 2; i < maxval; ++i) {
      |                                     ^
Language: C++

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

int n,a[10011],x,ans[200001],ansn,A[10011];
bool bo[100001];

int getval(int x,int nw)
{
	int ans=0;
	for (int i=n; i>=0; i--)
		ans=(1ll*ans*x+a[i])%nw;
	return ans;
}

int ran() {return rand()%1000*1000000+rand()%1000*1000+rand()%1000;}

void check(int nw)
{
	if (nw<=120)
	{
		for (int j=1; j<nw; j++)
			if (getval(j,nw)) return;
		ans[++ansn]=nw;
		return;
	}
	for (int j=1; j<=120; j++)
		if (getval(ran()%nw,nw)) return;
	ans[++ansn]=nw;
}

int main()
{
	memset(bo,1,sizeof(bo));
	for (int j=2; j<=100000; j++) if (bo[j])
		for (int i=(j<<1); i<=100000; i+=j) bo[i]=0;
	srand(10219687);
	scanf("%d",&n);
	for (int i=n; i>=0; i--) scanf("%d",&a[i]);
	for (int i=2; i<=40000; i++) if (bo[i]) check(i);
	int An=0;
	for (int i=0; i<=n; i++) if (a[i]) A[++An]=abs(a[i]);
	for (int T=1; T<=An&&T<=3; T++)
	{
		x=A[T];
		for (int i=2; i<=40000; i++) while (x%i==0) x/=i;
		if (x!=1) {for (int j=0; j<100&&x+j<=1000000000; j++) check(x+j);}
	}
	sort(ans+1,ans+1+ansn);
	for (int i=1; i<=ansn; i++)
		if (ans[i]!=ans[i-1]) printf("%d\n",ans[i]);
	return 0;
}

Compiler output:
a.cc:1:2: error: stray '#' in program
    1 | v#include<bits/stdc++.h>
      |  ^
a.cc:1:1: error: 'v' does not name a type
    1 | v#include<bits/stdc++.h>
      | ^
a.cc: In function 'int ran()':
a.cc:15:19: error: 'rand' was not declared in this scope; did you mean 'ran'?
   15 | int ran() {return rand()%1000*1000000+rand()%1000*1000+rand()%1000;}
      |                   ^~~~
      |                   ran
a.cc: In function 'int main()':
a.cc:33:9: error: 'memset' was not declared in this scope
   33 |         memset(bo,1,sizeof(bo));
      |         ^~~~~~
a.cc:1:1: note: 'memset' is defined in header '<cstring>'; this is probably fixable by adding '#include <cstring>'
  +++ |+#include <cstring>
    1 | v#include<bits/stdc++.h>
a.cc:36:9: error: 'srand' was not declared in this scope; did you mean 'ran'?
   36 |         srand(10219687);
      |         ^~~~~
      |         ran
a.cc:37:9: error: 'scanf' was not declared in this scope
   37 |         scanf("%d",&n);
      |         ^~~~~
a.cc:41:52: error: 'abs' was not declared in this scope; did you mean 'ans'?
   41 |         for (int i=0; i<=n; i++) if (a[i]) A[++An]=abs(a[i]);
      |                                                    ^~~
      |                                                    ans
a.cc:48:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   48 |         sort(ans+1,ans+1+ansn);
      |         ^~~~
      |         short
a.cc:50:39: error: 'printf' was not declared in this scope
   50 |                 if (ans[i]!=ans[i-1]) printf("%d\n",ans[i]);
      |                                       ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | v#include<bits/stdc++.h>
Language: C++

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	//auto triable = [](ll r,ll g, ll b) {
	//	ll m = max(r,max(g,b));
	//	return r + g + b - m > m;

	//};
	ll iii = -4;
	iii %= 3;
	ll n;
	cin >> n;
	vll a(n+1);
	ll div;
	rrep(i, 0, n+1) {
		cin >> a[i];
	}
	mt19937_64 rng(5);
	auto divs = prime_factorize(a[0]);
	//vll check = seq(0, 100000);
	//shuffle(all(check), mt19937(3));
	vll out;
	rep(i, 0, divs.size()) {
		ll div = divs[i].first;
		//check
		ll ok = true;

		auto f = [&](ll x) {
			ll res=0;
			if (x < 0)
			{
				x %= div;
				x = (x + div) % div;
			}
			rep(i, 0, n+1) {
				ll tmp = a[i];
				tmp%=div;
				tmp *= bin_power(x, i, div);
				tmp %= div;
				res = (res + div) % div;
			}
			return res;
		};
		rep(i, 0, 2000) {
			ll test = rand();
			if (f(test) != 0) {
				ok = false;
				break;
			}
		}
		if (ok) {
			out.push_back(div);
		}
	}
	sort(all(out));
	rep(i, 0, out.size()) {
		cout << out[i] << endl;
	}

	return 0;
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:2:9: error: 'cin' was not declared in this scope
    2 |         cin.tie(0);
      |         ^~~
a.cc:3:9: error: 'ios' has not been declared
    3 |         ios::sync_with_stdio(false);
      |         ^~~
a.cc:10:9: error: 'll' was not declared in this scope
   10 |         ll iii = -4;
      |         ^~
a.cc:11:9: error: 'iii' was not declared in this scope
   11 |         iii %= 3;
      |         ^~~
a.cc:12:11: error: expected ';' before 'n'
   12 |         ll n;
      |           ^~
      |           ;
a.cc:13:16: error: 'n' was not declared in this scope
   13 |         cin >> n;
      |                ^
a.cc:14:9: error: 'vll' was not declared in this scope
   14 |         vll a(n+1);
      |         ^~~
a.cc:15:11: error: expected ';' before 'div'
   15 |         ll div;
      |           ^~~~
      |           ;
a.cc:16:14: error: 'i' was not declared in this scope
   16 |         rrep(i, 0, n+1) {
      |              ^
a.cc:16:9: error: 'rrep' was not declared in this scope
   16 |         rrep(i, 0, n+1) {
      |         ^~~~
a.cc:19:9: error: 'mt19937_64' was not declared in this scope
   19 |         mt19937_64 rng(5);
      |         ^~~~~~~~~~
a.cc:20:37: error: 'a' was not declared in this scope
   20 |         auto divs = prime_factorize(a[0]);
      |                                     ^
a.cc:20:21: error: 'prime_factorize' was not declared in this scope
   20 |         auto divs = prime_factorize(a[0]);
      |                     ^~~~~~~~~~~~~~~
a.cc:23:12: error: expected ';' before 'out'
   23 |         vll out;
      |            ^~~~
      |            ;
a.cc:24:9: error: 'rep' was not declared in this scope
   24 |         rep(i, 0, divs.size()) {
      |         ^~~
a.cc:56:18: error: 'out' was not declared in this scope
   56 |         sort(all(out));
      |                  ^~~
a.cc:56:14: error: 'all' was not declared in this scope
   56 |         sort(all(out));
      |              ^~~
a.cc:56:9: error: 'sort' was not declared in this scope; did you mean 'short'?
   56 |         sort(all(out));
      |         ^~~~
      |         short
Language: C++

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

int main(){
    int N;
    int A[10001];
    cin >> N;
    for(int i=N; i>=0; i--) cin >> A[i];

    int64_t sum1 = 0, sum2 = 0;
    for(int i=0; i<=N; i++){
        sum1 += A[i];
        sum2 += A[i] * (i%2 ? -1 : 1);

    int a0 = A[0];
    vector<int> cand;
    for(int p=2; p*p<=a0; p++){
        if(a0 % p == 0){
            if(sum1 % p == 0 && sum2 % p == 0) cand.push_back(p);
            while(a0 % p == 0) a0 /= p;
        }
    }
    if(a0 > 1 && sum1 % a0 == 0 && sum2 % a0 == 0) cand.push_back(a0);

    for(int p : cand) cout << p << endl;
    
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:28:2: error: expected '}' at end of input
   28 | }
      |  ^
a.cc:4:11: note: to match this '{'
    4 | int main(){
      |           ^
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<ll,ll> P;

ll n,a[11111];
ll calc(ll x) {
  ll sum=0,t=1;
  rep(i,n+1) {
    sum+=a[i]*t;
    t*=x;
  }
  return sum;
}

ll calc2(ll x,ll m) {
  ll sum=0,t=1;
  rep(i,n+1) {
    sum+=(a[i]*t+m*MAX)%m;
    sum%=m;
    t*=x;
    if(x>=0) t%=m;
    else {
      t=abs(t);
      t%=m;
      t=(m-t)%m;
    }
  }
  return sum;
}

void Main() {
  srand((unsigned)time(NULL));
  R n;
  rrep(i,n+1) R a[i];
  ll d=calc(0);
  d=__gcd(d,calc(-1));
  d=__gcd(d,calc(1));
  vector<ll> v;
  for(ll i=2; i*i<=d; i++) {
    ll c=0;
    while(d%i==0) {
      c++;
      d/=i;
    }
    if(c) v.pb(i);
  }
  if(d>1) v.pb(d);
  sort(all(v));
  rep(i,v.size()) {
    bool f=1;
    rep(j,100) {
      if(calc2(rand()%(MAX*2)-MAX,v[i])) f=0;
    }
    REP(j,-100,100) if(cal2(j,v[i])) f=0;
    if(f) pr(v[i]);
  }
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Compiler output:
a.cc: In function 'void Main()':
a.cc:77:24: error: 'cal2' was not declared in this scope; did you mean 'calc2'?
   77 |     REP(j,-100,100) if(cal2(j,v[i])) f=0;
      |                        ^~~~
      |                        calc2
Language: C++

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <string>
#include <set>
#include <map>
#include <functional>
#include <cmath>
#include <cassert>
#define SIZE 10005

using namespace std;
//typedef __int128 lll;
typedef long long int ll;
typedef pair <int,int> P;

ll A[SIZE];
bool ans[SIZE];
bool pr[SIZE];

ll gcd(ll x,ll y)
{
	if(x==0) return y;
	return gcd(y%x,x);
}
void make()
{
	for(int i=2;i<SIZE;i++)
	{
		if(!pr[i])
		{
			for(int j=2*i;j<SIZE;j+=i) pr[j]=true;
		}
	}
}
int main()
{
	make();
	int n;
	scanf("%d",&n);
	for(int i=0;i<=n;i++) scanf("%lld",&A[n-i]);
	ll g=A[0];
	vector <ll> ans;
	for(int i=1;i<=n;i++)
	{
		if(g==0)
		{
			bool up=true;
			ll now=0;
			for(int j=0;j<=n;j++)
			{
				if(now%i!=0)
				{
					up=false;
					break;
				}
				now/=i;
				now+=A[j];
			}
			g=llabs(now);
			if(g!=0)
			{
				for(int j=1;j<=i;j++) if(!pr[j]) ans.push_back(j);
			}
		}
		else
		{
			ll now=0,t=1;
			for(int j=0;j<=n;j++)
			{
				
				lll B=(lll) A[j]*(lll) t;
				B%=g;
				if(B<0) B+=g;
				now+=B;
				if(now>=g) now-=g;
				lll T=(lll) t*(lll) i;
				T%=g;
				t=T;
				/*
				ll B=(ll) A[j]*(ll) t;
				B%=g;
				if(B<0) B+=g;
				now+=B;
				if(now>=g) now-=g;
				ll T=(ll) t*(ll) i;
				T%=g;
				t=T;*/
			}
			g=gcd(g,now);
		}
	}
	for(ll i=2;i*i<=g;i++)
	{
		if(g%i==0)
		{
			ans.push_back(i);
			while(g%i==0) g/=i;
		}
	}
	if(g!=1) ans.push_back(g);
	sort(ans.begin(),ans.end());
	ans.erase(unique(ans.begin(),ans.end()),ans.end());
	for(int i=0;i<ans.size();i++) printf("%lld\n",ans[i]);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:75:33: error: 'lll' was not declared in this scope; did you mean 'll'?
   75 |                                 lll B=(lll) A[j]*(lll) t;
      |                                 ^~~
      |                                 ll
a.cc:76:33: error: 'B' was not declared in this scope
   76 |                                 B%=g;
      |                                 ^
a.cc:80:36: error: expected ';' before 'T'
   80 |                                 lll T=(lll) t*(lll) i;
      |                                    ^~
      |                                    ;
a.cc:81:33: error: 'T' was not declared in this scope
   81 |                                 T%=g;
      |                                 ^
Language: C++

//#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <queue>
#include <algorithm>
#include <functional>
#include <string>
#include <bitset>

#define ll long long
#define fri(n) for(i=0;i<(n);i++)
#define frj(n) for(j=0;j<(n);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define INF 1000000000000000000//10^18
#define INFINT 2000000001//2*10^9+1
#define MOD 1000000007
#define MODANOTHER 998244353
#define PI acos(-1)

using namespace std;

ll gcd(ll x,ll y){
	while(x!=0&&y!=0){
		if(x>y){
			x=x%y;
		}else{
			y=y%x;
		}
	}
	return x+y;
}

ll int ruijou(ll a,ll x,ll M){
	ll int temp=a;
	ll int ret=1;
	//a^xを求める

	while(x!=0){
		if(x%2==1){
			ret=(ret*temp)%M;
		}
		temp=(temp*temp)%M;
		x=x/2;
	}
	return ret;
}

int main(void)
{
	//変数の宣言
	int n;
	int M;
	static ll a[10010];
	static int sosu[1000];
	double sq;

	//よく使う変数
	int i,j,k,l;
	int flag=0;
	ll int ans=0;
	int count=0;
	ll int temp=0;
	ll int temp1=0;
	ll int temp2=0;
	int max=0;
	int min=INFINT;
	int len=0;
	int sum=0;
	int ok=0;
	int ng=0;
	int dummy;



	//データの読み込み

	scanf("%d",&n);
//	scanf_s("%d",&n);


//	scanf("%s",&s);
//	scanf_s("%s",&s,200010);


	for(i=n;i>=0;i--){
		scanf(%lld",&a[i]);
//		scanf_s("%lld",&a[i]);
	}

	//	printf("nは%dです\n", n);
	//	printf("データの読み込み終了\n");
	//実際の処理
	
/*	for(i=0;i<n;i++){
		temp1=temp1+a[i];
		temp2=temp2+a[i]*(i%2==0?1:-1);
	}
	temp2=llabs(temp2);
	temp=gcd(temp1,temp2);
	if(temp!=0){
		temp=gcd(temp,a[0]);
	}else{
		temp=a[0];
	}*/

	temp=a[0];
	sq=sqrt(a[0]);

	count=0;
	for(i=2;i<=sq+0.0001;i++){
		flag=0;
		while(temp%i==0){
			if(flag==0){
				sosu[count]=i;
				count++;
				flag=1;
			}
			temp=temp/i;
		}
	}
	sosu[count]=temp;
	count++;


	srand(1);

	for(i=0;i<count;i++){
		flag=1;
		if(sosu[i]<1000){
			for(j=1;j<sosu[i];j++){
				temp=0;
				for(k=0;k<=n;k++){
					temp=temp+a[k]*ruijou(j,k,sosu[i]);
					temp=temp%sosu[i];
				}
				if(temp!=0) flag=0;
			}
		}else{
			for(j=1;j<1000;j++){
				temp=0;
				for(k=0;k<=n;k++){
					temp1=rand()%sosu[i];
					temp=temp+a[k]*ruijou(temp1,k,sosu[i]);
					temp=temp%sosu[i];
				}
				if(temp!=0) flag=0;
			}
		}
		if(flag==1){
			printf("%d\n",sosu[i]);
		}
	}

	//	printf("計算部分終了\n");

	//出力

	//	printf("結果の出力終了\n");

	return 0;
}



Compiler output:
a.cc:95:27: warning: missing terminating " character
   95 |                 scanf(%lld",&a[i]);
      |                           ^
a.cc:95:27: error: missing terminating " character
   95 |                 scanf(%lld",&a[i]);
      |                           ^~~~~~~~~
a.cc: In function 'int main()':
a.cc:95:23: error: expected primary-expression before '%' token
   95 |                 scanf(%lld",&a[i]);
      |                       ^
a.cc:95:24: error: 'lld' was not declared in this scope; did you mean 'll'?
   95 |                 scanf(%lld",&a[i]);
      |                        ^~~
      |                        ll