Language: C++

#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <vector>
using namespace std;
#define ll long long
ll n, arr[10005];
ll tot = 0;
vector<ll> v;
vector<ll> answer;

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

ll power(ll a, ll b, ll mod){
	a %= mod;
	if (b == 0) return 1;
	if (b == 1) return a;
	ll half = power(a, b/2, mod);
	half *= half;
	half %= mod;
	if (b % 2 == 1){
		half *= a;
		half %= mod;
	}
	return half;
}

bool isprime(ll x){
	if (x == 1) return false;
	if (x == 2) return true;
	if (x % 2 == 0) return false;
	for (ll i = 3; i*i <= x; i+=2){
		if (x % i == 0) return false;
	}
	return true;
}


int main(){
	scanf("%lld", &n);
	for (int i = 0; i <= n; i++){
		scanf("%lld", &arr[i]);
		tot += arr[i];
	}
	ll gcdd = gcd(tot, arr[n]);
	if (gcdd%2 == 0){
		v.push_back(2);
		if (isprime(gcdd/2)){
			v.push_back(gcdd/2);
		}
	}
	for (ll i = 3; i*i <= gcdd; i+=2){
		if (gcdd % i == 0){
			v.push_back(i);
			if (isprime(gcdd/i) && (i*i != gcdd)){
				v.push_back(gcdd/i);
			}
		}
	}
	if (v.empty() && gcdd != 1 && gcdd != 0){
		v.push_back(gcdd);
	}
	sort(v.begin(), v.end());
	for (vector<ll>::iterator it = v.begin(); it != v.end(); it++){
		bool pro = true;
		for (int i = 0; i <= n; i++){
			if (arr[i]%(*it) != 0){
				pro = false;
				break;
			}
		}
		if (pro){
			answer.push_back((*it));
			continue;
		}
		bool can = true;
		for (int i = 2; i < min((*it), 100); i++){
			ll ttt = 0;
			for (int j = 0; j <= n; j++){
				ttt += (arr[j]%(*it))*power(i, n - j, (*it));
				ttt %= (*it);
			}
			if (ttt % (*it) != 0){
				can = false;
				break;
			}
		}
		if (can == true){
			answer.push_back(*it);
		}
	}
	for (vector<ll>::iterator it = answer.begin(); it != answer.end(); it++){
		printf("%lld\n", *it);
	}
	
	
}

Compiler output:
a.cc: In function 'int main()':
a.cc:80:40: error: no matching function for call to 'min(long long int&, int)'
   80 |                 for (int i = 2; i < min((*it), 100); i++){
      |                                     ~~~^~~~~~~~~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:80:40: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   80 |                 for (int i = 2; i < min((*it), 100); i++){
      |                                     ~~~^~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_algo.h:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:80:40: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   80 |                 for (int i = 2; i < min((*it), 100); i++){
      |                                     ~~~^~~~~~~~~~~~