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

#include<bits/stdc++.h>
using namespace std;
#define fl(n)             for(long long int i=0;i<n;i++)
#define sz(a)             int((a).size())
#define tr(c,i)           for(auto i = (c).begin(); i != (c).end(); i++)
#define trr(c,i)          for(auto i = (c).rbegin(); i != (c).rend(); i++)
#define present(c,x)      ((c).find(x) != (c).end())
#define cpresent(c,x)     (find(all(c),x) != (c).end())
#define vi                vector <int>
#define vvi               vector < vi >
#define pb                push_back
#define all(x)            (x).begin(),(x).end()
#define ll                long long
#define fr                first
#define sc                second
#define vc                vector
#define pii               pair<int,int>
#define msi               map<string,int> 
#define mii               map<int,int>
#define psi               pair<string,int>
#define pis               pair<int,string>
#define M                 1000000007LL

bool setwise=0;

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





int solve()
{
	int n;
	cin>>n;
	ll a[n],tot=1;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		B[a[i]]++;
		tot*=a[i];
	}

	
	ll lcm=a[0],g=a[0];
	for(int i=1;i<n;i++)
	{
		g=gcd(g,a[i]);
		lcm=(a[i]*lcm)/gcd(lcm,a[i]);
	}
	bool flag1 = true;
    bool flag2 = true;
    for (int i = 2; i <= MAX; i++) {
        int cnt = 0;
        for (int j = 1; j < MAX; j++) {
            if (i * j > MAX) break;
            cnt += B[i * j];
        }
        if (cnt > 1) {
            flag1 = false;
        }
        if (cnt == n) {
            flag2 = false;
        }
    }
    if (flag1) {
        cout << "pairwise coprime\n";
    } 
	else if(g==1)
		cout<<"setwise coprime";
	else
	cout<<"not coprime\n";



  return 0;
}


int main() {
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
  
  int t=1;
  //cin>>t;
  while(t--)
  {
    solve();
  }
  return 0;
}

 


Compiler output:
a.cc: In function 'int solve()':
a.cc:45:17: error: 'B' was not declared in this scope
   45 |                 B[a[i]]++;
      |                 ^
a.cc:58:26: error: 'MAX' was not declared in this scope
   58 |     for (int i = 2; i <= MAX; i++) {
      |                          ^~~
a.cc:62:20: error: 'B' was not declared in this scope
   62 |             cnt += B[i * j];
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define fl(n)             for(long long int i=0;i<n;i++)
#define sz(a)             int((a).size())
#define tr(c,i)           for(auto i = (c).begin(); i != (c).end(); i++)
#define trr(c,i)          for(auto i = (c).rbegin(); i != (c).rend(); i++)
#define present(c,x)      ((c).find(x) != (c).end())
#define cpresent(c,x)     (find(all(c),x) != (c).end())
#define vi                vector <int>
#define vvi               vector < vi >
#define pb                push_back
#define all(x)            (x).begin(),(x).end()
#define ll                long long
#define fr                first
#define sc                second
#define vc                vector
#define pii               pair<int,int>
#define msi               map<string,int> 
#define mii               map<int,int>
#define psi               pair<string,int>
#define pis               pair<int,string>
#define M                 1000000007LL

bool setwise=0;

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


const int MAX = 1000000;
int B[MAX + 1]{};
 

    bool flag1 = true;
    bool flag2 = true;
    for (int i = 2; i <= MAX; i++) {
        int cnt = 0;
        for (int j = 1; j < MAX; j++) {
            if (i * j > MAX) break;
            cnt += B[i * j];
        }
        if (cnt > 1) {
            flag1 = false;
        }
        if (cnt == N) {
            flag2 = false;
        }
    }
    if (flag1) {
        cout << "pairwise coprime\n";
    } 



int solve()
{
	int n;
	cin>>n;
	ll a[n],tot=1;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		B[a[i]]++;
		tot*=a[i];
	}

	
	ll lcm=a[0],g=a[0];
	for(int i=1;i<n;i++)
	{
		g=gcd(g,a[i]);
		lcm=(a[i]*lcm)/gcd(lcm,a[i]);
	}
	bool flag1 = true;
    bool flag2 = true;
    for (int i = 2; i <= MAX; i++) {
        int cnt = 0;
        for (int j = 1; j < MAX; j++) {
            if (i * j > MAX) break;
            cnt += B[i * j];
        }
        if (cnt > 1) {
            flag1 = false;
        }
        if (cnt == N) {
            flag2 = false;
        }
    }
    if (flag1) {
        cout << "pairwise coprime\n";
    } 
	else if(g==1)
		cout<<"setwise coprime";
	else
	cout<<"not coprime\n";



  return 0;
}


int main() {
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
  
  int t=1;
  //cin>>t;
  while(t--)
  {
    solve();
  }
  return 0;
}

 


Compiler output:
a.cc:40:5: error: expected unqualified-id before 'for'
   40 |     for (int i = 2; i <= MAX; i++) {
      |     ^~~
a.cc:40:21: error: 'i' does not name a type; did you mean 'vi'?
   40 |     for (int i = 2; i <= MAX; i++) {
      |                     ^
      |                     vi
a.cc:40:31: error: 'i' does not name a type; did you mean 'vi'?
   40 |     for (int i = 2; i <= MAX; i++) {
      |                               ^
      |                               vi
a.cc:53:5: error: expected unqualified-id before 'if'
   53 |     if (flag1) {
      |     ^~
a.cc: In function 'int solve()':
a.cc:89:20: error: 'N' was not declared in this scope
   89 |         if (cnt == N) {
      |                    ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define dup(x,y) (((x)+(y)-1)/(y))
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const double EPS = 1e-10;
const int INF = 1e9;
const ll LINF = 1e15;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main() {
	int n;
	cin >> n;
	vector<int> v(n);
	rep(i,n) cin >> v[i];

	vector<int> cnt(1e6 + 1, 0);
	for (int i = 0; i < n; i++) {
		int cur = v[i];
		for (int j = 2; j * j <= cur; j++) {
			if (!isp[j]) continue;
			if (cur % j == 0) {
				cnt[j]++;
				while (cur % j == 0) cur /= j;
			}
		}
		if (cur != 1) cnt[cur]++;
	}
	bool b = true;
	for (int i = 0; i < 1e6 + 1; i++) {
		if (cnt[i] >= 2) b = false;
	}
	if (b) {
		cout << "pairwise coprime" << endl;
	} else {
		int g = v[0];
		rep(i,n) g = gcd(g, v[i]);
		if (g == 1) cout << "setwise coprime" << endl;
		else cout << "not coprime" << endl;
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:29:30: error: 'isp' was not declared in this scope
   29 |                         if (!isp[j]) continue;
      |                              ^~~
Language: C++

#include <bits/stdc++.h>
    #include <math.h>
 
    using namespace std;
    typedef long long ll;
    typedef unsigned long long ull;
    # define M_PI  3.14159265358979323846
 
 
    const int M=1e9+7;
    long long mod(long long x){
        return ((x%M + M)%M);
    }
    long long add(long long a, long long b){
        return mod(mod(a)+mod(b));
    }
    long long mul(long long a, long long b){
        return mod(mod(a)*mod(b));
    }
 
    int fact[1000005];
    bool ok=false;
 
    void f(int x){
        if(ok==true)
            return;
        for(int i=1;i*i<=x;i++){
            if(x%i==0){
                int a=i;
                int b=x/i;
                if(a==b){
                    a=i;
                    b=1;
                }
                if(a!=1){
                    if(fact[a]){
                        ok=true;
                        return;
                    }
                    fact[a]++;
                }
                if(b!=1){
                    if(fact[b]){
                        ok=true;
                        return;
                    }
                    fact[b]++;
                }
            }
        }
    }
 
    void solve(){  
        int n;
        cin>>n;
        vector<int>a(n);
        for(int i=0;i<n;i++)
            cin>>a[i];
        int gcd=a[0];
        // cout<<"in "<<ok<<"\n";
        f(a[0]);
        // cout<<"in "<<ok<<"\n";
        for(int i=1;i<n;i++){
            f(a[i]);
            gcd=__gcd(gcd,a[i]);
            // cout<<"in "<<ok<<"\n";
        }
        if(!ok){
            cout<<"pairwise coprime";
        }
        else if(gcd==1){
            cout<<"setwise coprime";
        }
        else{
            cout<<"not coprime";
        }
    }
    int main(){
        ios::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        cout<<fixed;
        cout<<set
//        freopen("timber_input.txt", "r", stdin);
//        freopen("timber_output.txt", "w", stdout);
        int t=1;
        // cin>>t;
        for(int i=1;i<=t;i++){
//            cout<<"Case #"<<i<<": ";
            solve();
        }
        return 0;
    }

Compiler output:
a.cc: In function 'int main()':
a.cc:86:9: error: missing template arguments before 'int'
   86 |         int t=1;
      |         ^~~
a.cc:88:24: error: 't' was not declared in this scope
   88 |         for(int i=1;i<=t;i++){
      |                        ^
Language: C

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>
typedef long long ll;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
ll gcd(ll a,ll b){if(b==0)return llabs(a); return gcd(b,a%b);}

int a[1010101];
int main() {
    int n;
    scanf("%d", &n);
    rep(i,n) scanf("%d", &a[i]);

    int ggg = a[0];
    rep(i,n-1) ggg = gcd(ggg, a[i+1]);
    if(ggg != 1){
        puts("not coprime");
        return 0;
    }

    //エラトステネスの篩
    const int P_MAX = 1000005;
    int pmn[P_MAX];     //smallest prime number that can divide i(pmn[i] == i -> i is prime number)
    for(int i = 1; i < P_MAX; i++)
        if(i%2 == 0) pmn[i] = 2;
        else pmn[i] = i;
    for(int i = 3; i*i < P_MAX; i += 2){
        if(pmn[i] == i){
            for(int j = i*i; j < P_MAX; j += 2*i)
                if(pmn[j] == j) pmn[j] = i; 
        }
    }

    int cnt[P_MAX]={0};
    rep(i,n){
        while(a[i] != 1){
            int apmn = pmn[a[i]];
            if(cnt[apmn]){
                puts("setwise coprime");
                return 0;
            }
            cnt[apmn]++;
            while(a[i]%apmn == 0) a[i] /= apmn;
        }
    }
    puts("pairwise coprime");
}


Compiler output:
main.c: In function 'main':
main.c:36:20: error: variable-sized object may not be initialized except with an empty initializer
   36 |     int cnt[P_MAX]={0};
      |                    ^
Language: C++

include <cstdio>
int const N = 1000001;
 
int spf[N], u[N], s[17], d, i, j, k;
char const* r = "pairwise";
 
int main() {
    while (++i < N)spf[i] = i;
    for (i = 2; i * i < N; i++) {
        for (j = i * i; j < N; j += i) {
            if (spf[j] == j)
                spf[j] = i;
        }
    }
    for (scanf("%*d"); ~scanf("%d", &j); k = 0) {
        d = __gcd(j, d);
        for (; j > 1; j /= i) {
            s[k++] = i = spf[j];
            if (u[i]) r = "setwise";
        }
        while(k--)u[s[k]] = 1;
    }
    printf("%s coprime\n", d > 1 ? "not" : r);
    return 0;
}


Compiler output:
a.cc:1:1: error: 'include' does not name a type
    1 | include <cstdio>
      | ^~~~~~~
a.cc:4:9: error: 'N' was not declared in this scope
    4 | int spf[N], u[N], s[17], d, i, j, k;
      |         ^
a.cc:4:15: error: 'N' was not declared in this scope
    4 | int spf[N], u[N], s[17], d, i, j, k;
      |               ^
a.cc: In function 'int main()':
a.cc:8:18: error: 'N' was not declared in this scope
    8 |     while (++i < N)spf[i] = i;
      |                  ^
a.cc:8:20: error: 'spf' was not declared in this scope
    8 |     while (++i < N)spf[i] = i;
      |                    ^~~
a.cc:9:25: error: 'N' was not declared in this scope
    9 |     for (i = 2; i * i < N; i++) {
      |                         ^
a.cc:11:17: error: 'spf' was not declared in this scope
   11 |             if (spf[j] == j)
      |                 ^~~
a.cc:15:10: error: 'scanf' was not declared in this scope
   15 |     for (scanf("%*d"); ~scanf("%d", &j); k = 0) {
      |          ^~~~~
a.cc:16:13: error: '__gcd' was not declared in this scope
   16 |         d = __gcd(j, d);
      |             ^~~~~
a.cc:18:26: error: 'spf' was not declared in this scope
   18 |             s[k++] = i = spf[j];
      |                          ^~~
a.cc:19:17: error: 'u' was not declared in this scope
   19 |             if (u[i]) r = "setwise";
      |                 ^
a.cc:21:19: error: 'u' was not declared in this scope
   21 |         while(k--)u[s[k]] = 1;
      |                   ^
a.cc:23:5: error: 'printf' was not declared in this scope
   23 |     printf("%s coprime\n", d > 1 ? "not" : r);
      |     ^~~~~~
a.cc:1:1: note: 'printf' is defined in header '<cstdio>'; this is probably fixable by adding '#include <cstdio>'
  +++ |+#include <cstdio>
    1 | include <cstdio>
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>
#include <functional>
#include <queue>
#include <unordered_set>
#include <climits>
#include <set>
#include <list>
#include <cmath>
#include <map>

using namespace std;
typedef long long ll;

// https://ei1333.github.io/luzhiled/snippets/math/divisor.html
vector< int > divisor(int n) {
	vector< int > ret;
	for(int i = 1; i * i <= n; i++) {
		if(n % i == 0) {
			ret.push_back(i);
			if(i * i != n) ret.push_back(n / i);
		}
	}
	sort(begin(ret), end(ret));
	return (ret);
}

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

int myGCD(int a, int b){
	if ( b == 0){
		return a;
	}
	
	return myGCD(b, a % b);
}

int main()
{
	int N;
	int A[1001001];
	cin >> N;
	for(int i = 0; i < N; i++){
		cin >> A[i];
	}
	
	bool s1[1001001];
	for(int i = 0; i < 1001001; i++){
		s1[i] = false;
	}
	
	int gcd = A[0];
	
	bool isPairwiseCoprime = true;
	for(int i = 0; i < N; i++){
		map<int, int> div = divisor(A[i]);
		for(auto it = div.begin(); it != div.end(); it++){
			int num = (*it).first;
			if(num == 1){
				continue;
			}
			if(s1[num]){
				isPairwiseCoprime = false;
			}else{
				s1[num] = true;
			}
		}
		
		if(gcd > 1){
			gcd = myGCD(gcd, A[i]);
		}
	}
	
	if(isPairwiseCoprime){
		cout << "pairwise coprime" << endl;
	}else if(gcd == 1){
		cout << "setwise coprime" << endl;
	}else{
		cout << "not coprime" << endl;
	}
	
	return 0;
}


Compiler output:
a.cc:34:6: error: two or more data types in declaration of 'type name'
   34 | map< int int > prime_factor(int n) {
      |      ^~~
a.cc:34:14: error: wrong number of template arguments (1, should be at least 2)
   34 | map< int int > prime_factor(int n) {
      |              ^
In file included from /usr/include/c++/14/map:63,
                 from a.cc:16:
/usr/include/c++/14/bits/stl_map.h:102:11: note: provided for 'template<class _Key, class _Tp, class _Compare, class _Alloc> class std::map'
  102 |     class map
      |           ^~~
a.cc: In function 'int prime_factor(int)':
a.cc:43:16: error: cannot convert 'std::map<int, int>' to 'int' in return
   43 |         return ret;
      |                ^~~
      |                |
      |                std::map<int, int>
a.cc: In function 'int main()':
a.cc:72:44: error: conversion from 'std::vector<int>' to non-scalar type 'std::map<int, int>' requested
   72 |                 map<int, int> div = divisor(A[i]);
      |                                     ~~~~~~~^~~~~~
Language: C++

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>
#include <functional>
#include <queue>
#include <unordered_set>
#include <climits>
#include <set>
#include <list>
#include <cmath>
#include <map>

using namespace std;
typedef long long ll;

// https://ei1333.github.io/luzhiled/snippets/math/divisor.html
vector< int > divisor(int n) {
	vector< int > ret;
	for(int i = 1; i * i <= n; i++) {
		if(n % i == 0) {
			ret.push_back(i);
			if(i * i != n) ret.push_back(n / i);
		}
	}
	sort(begin(ret), end(ret));
	return (ret);
}

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

int myGCD(int a, int b){
	if ( b == 0){
		return a;
	}
	
	return myGCD(b, a % b);
}

int main()
{
	int N;
	int A[1001001];
	cin >> N;
	for(int i = 0; i < N; i++){
		cin >> A[i];
	}
	
	bool s1[1001001];
	for(int i = 0; i < 1001001; i++){
		s1[i] = false;
	}
	
	int gcd = A[0];
	
	bool isPairwiseCoprime = true;
	for(int i = 0; i < N; i++){
		map<int, int> div = divisor(A[i]);
		for(auto it = div.begin(); it != div.end(); it++){
			int num = (*it).first;
			if(num == 1){
				continue;
			}
			if(s1[num]){
				isPairwiseCoprime = false;
			}else{
				s1[num] = true;
			}
		}
		
		if(gcd > 1){
			gcd = myGCD(gcd, A[i]);
		}
	}
	
	if(isPairwiseCoprime){
		cout << "pairwise coprime" << endl;
	}else if(gcd == 1){
		cout << "setwise coprime" << endl;
	}else{
		cout << "not coprime" << endl;
	}
	
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:72:44: error: conversion from 'std::vector<int>' to non-scalar type 'std::map<int, int>' requested
   72 |                 map<int, int> div = divisor(A[i]);
      |                                     ~~~~~~~^~~~~~
Language: C

#include <stdio.h>
#define N 1000001

int spf[N], u[N], s[17], d, i, k;
char* r = "pairwise";

main(j) {
	while (++i < N)spf[i] = i;
	for (i = 2; i * i < N; i++) {
		for (j = i * i; j < N; j += i) {
			if (spf[j] == j)
				spf[j] = i;
		}
	}
	for (scanf("%*d"); ~scanf("%d", &j); k = 0) {
		d = __gcd(d, j);
		for (; j > 1; j /= spf[j]) {
			i = spf[j];
			if (u[i]) r = "setwise";
			s[k++] = i;
		}
		while(k--)u[s[k]] = 1;
	}
	printf("%s coprime\n", d > 1 ? "not" : r);
	return 0;
}


Compiler output:
main.c:7:1: error: return type defaults to 'int' [-Wimplicit-int]
    7 | main(j) {
      | ^~~~
main.c: In function 'main':
main.c:7:1: error: type of 'j' defaults to 'int' [-Wimplicit-int]
main.c:16:21: error: implicit declaration of function '__gcd' [-Wimplicit-function-declaration]
   16 |                 d = __gcd(d, j);
      |                     ^~~~~
Language: C++

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

using namespace std;

bool cnt[1000005];

int main() {
	int n; cin >> n;
	vector<int> a(n);
	for (int& e : a) cin >> e;
	int t = a[0];
	for (int i = 1; i < n; ++i) t = gcd(t, a[i]);
	if (t != 1) {
		cout << "not coprime" << endl;
		return 0;
	}
	
	for (int i = 0; i < n; ++i) {
		int t = a[i];
		for (long long j = 2; j * j <= t; ++j) {
			if (t % j) continue;
			while (t % j == 0) t /= j;
			if (cnt[j]) {
				cout << "setwise coprime" << endl;
				return 0;
			}
			cnt[j] = true;
		}
		if (t != 1) {
			if (cnt[t]) {
				cout << "setwise coprime" << endl;
				return 0;
			}
			cnt[t] = true;
		}
	}
	cout << "pairwise coprime" << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:41: error: 'gcd' was not declared in this scope
   14 |         for (int i = 1; i < n; ++i) t = gcd(t, a[i]);
      |                                         ^~~
Language: C++

#include <iostream>
#include <vector>

using namespace std;

bool cnt[1000005];

int main() {
	int n; cin >> n;
	vector<int> a(n);
	for (int& e : a) cin >> e;
	int t = a[0];
	for (int i = 1; i < n; ++i) t = gcd(t, a[i]);
	if (t != 1) {
		cout << "not coprime" << endl;
		return 0;
	}
	
	for (int i = 0; i < n; ++i) {
		int t = a[i];
		for (long long j = 2; j * j <= t; ++j) {
			if (t % j) continue;
			while (t % j == 0) t /= j;
			if (cnt[j]) {
				cout << "setwise coprime" << endl;
				return 0;
			}
			cnt[j] = true;
		}
		if (t != 1) {
			if (cnt[t]) {
				cout << "setwise coprime" << endl;
				return 0;
			}
			cnt[t] = true;
		}
	}
	cout << "pairwise coprime" << endl;

	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:13:41: error: 'gcd' was not declared in this scope
   13 |         for (int i = 1; i < n; ++i) t = gcd(t, a[i]);
      |                                         ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(int)(n); i++)

using namespace std;
using LL = long long;
using P = pair<int,int>;
const int Max_A = 1e6+5;
const int INF = 1e8;

int div[Max_A];

int main(){
	int N;
	cin >> N;
	vector<int> A(N);
	rep(i,N) cin >> A[i];
	rep(i,Max_A) div[i]=i;
	for(int i=2; i*i<Max_A; i++){
		if(div[i]==i){
			for(int j=2; j*i<Max_A; j++) div[j*i]=i;
		}
	}
	map<int,int> mp;
	rep(i,N){
		int a=A[i];
		vector<int> p;
		while(a!=div[a]){
			a/=div[a];
			int s=p.size()
			if(div[a]!=p[s-1]) p.emplace_back(div[a]);
		}
		rep(j,p.size()) mp[p[j]]++;
		if(a!=1) mp[a]++;
	}
	bool pairwise=true, setwise=true;
	for(auto itr:mp){
		int num=itr.second;
		if(num>=2) pairwise=false;
		if(num==N) setwise=false;
	}
	rep(i,N) if(A[i]==1) setwise=true;
	if(pairwise) cout << "pairwise coprime" << endl;
	else if(setwise) cout << "setwise coprime" << endl;
	else cout << "not coprime" << endl;

	return 0;
}

Compiler output:
a.cc:10:14: error: 'int div [1000005]' redeclared as different kind of entity
   10 | int div[Max_A];
      |              ^
In file included from /usr/include/c++/14/cstdlib:79,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:42,
                 from a.cc:1:
/usr/include/stdlib.h:992:14: note: previous declaration 'div_t div(int, int)'
  992 | extern div_t div (int __numer, int __denom)
      |              ^~~
a.cc: In function 'int main()':
a.cc:17:25: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   17 |         rep(i,Max_A) div[i]=i;
      |                         ^
a.cc:19:23: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   19 |                 if(div[i]==i){
      |                       ^
a.cc:20:57: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   20 |                         for(int j=2; j*i<Max_A; j++) div[j*i]=i;
      |                                                         ^
a.cc:27:29: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   27 |                 while(a!=div[a]){
      |                             ^
a.cc:28:31: error: invalid types '<unresolved overloaded function type>[int]' for array subscript
   28 |                         a/=div[a];
      |                               ^
a.cc:30:25: error: expected ',' or ';' before 'if'
   30 |                         if(div[a]!=p[s-1]) p.emplace_back(div[a]);
      |                         ^~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod=1e9+7;

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

void solve()
{
 int n,i,j;
    cin>>n;
    vector<int>prime;
    for(i=2;i<1000;i++)
     if(is_prime(i))prime.push_back(i);   
    vector<int>a(n);
    for(int &x:a)cin>>x;
    
    bool flag=true;
    for(i=0;i<(int)prime.size();i++)
    {
        int cnt=0;
     for(j=0;j<n;j++)
     {
       if(a[j]%prime[i]==0)cnt++;  
     }
        if(cnt>=2){flag=false;break}
    }
    
    if(flag)
    {
     cout<<"pairwise coprime"<<endl;
        return ;
    }
    
    int g=a[0];
    for(i=1;i<n;i++)
    g=__gcd(g,a[i]);
    
    if(g==1)cout<<"setwise coprime"<<endl;
    else cout<<"not coprime";
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int t=1;
  //  cin>>t;
    while(t--)
        solve();
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:32:36: error: expected ';' before '}' token
   32 |         if(cnt>=2){flag=false;break}
      |                                    ^
      |                                    ;
Language: C++

#pragma GCC optimize(2)
#pragma GCC optimize(“Ofast”)
#pragma GCC target(“avx,avx2,fma”)
#include<bits/stdc++.h> 
using namespace std;
#define ll long long
#define endl "\n"
const int MAX=1e6+7;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;
vector<ll>a,ans[MAX];
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);
	int n;cin>>n;
	set<int>p;
	vector<int>a(n,0),ans(n+1,0);
	for(int i=0;i<n;i++)cin>>a[i];
	for(int i=0;i<n;i++){
		int t=a[i];
		for(int j=2;j<=t;j++){
			if(a[i]%j==0){
				p.insert(j);
				ans[j]++;	a[i]/=j;
				while(a[i]%j==0) a[i]/=j;
			}
			if(a[i]==1)break;
		}
	}
	int f=0;
	for(auto i:p)
		if(ans[i]==n){
			cout<<"not coprime";return 0;
		}
	for(auto i:p)
		if(ans[i]!=1){
			cout<<"setwise coprime";return 0;
		}
	cout<<"pairwise coprime";
   return 0;
}  

Compiler output:
a.cc:2:22: error: extended character “ is not valid in an identifier
    2 | #pragma GCC optimize(“Ofast”)
      |                      ^
a.cc:2:22: error: extended character ” is not valid in an identifier
a.cc:3:20: error: extended character “ is not valid in an identifier
    3 | #pragma GCC target(“avx,avx2,fma”)
      |                    ^
a.cc:3:30: error: extended character ” is not valid in an identifier
    3 | #pragma GCC target(“avx,avx2,fma”)
      |                              ^
a.cc:3:20: warning: '#pragma GCC option' is not a string [-Wpragmas]
    3 | #pragma GCC target(“avx,avx2,fma”)
      |                    ^~~~
a.cc:2:22: warning: '#pragma GCC optimize' is not a string or number [-Wpragmas]
    2 | #pragma GCC optimize(“Ofast”)
      |                      ^~~~~~~
a.cc:3:20: warning: '#pragma GCC option' is not a string [-Wpragmas]
    3 | #pragma GCC target(“avx,avx2,fma”)
      |                    ^~~~
Language: C++

#include <iostream>

inline int gcd(int a, int b){
  if(b<a) std::swap(a, b);
  int r = a % b;
  if(r==0) return b;
  while(r!=0) r = a % b, a = b, b = r;
  return a;
}

inline int read(){
	int x=0,f=1;char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){x=x*10+c-'0';c=getchar();}
	return x*f;
}

int cnt[1000001];
int main(){
  int n = read();
  int num = read();
  int o = 0, g = num;
  if(num==1) o=1;
  int ex = (n-1)/4;
  cnt[num] = 1;

  for(int i=0;i<ex;i++){
    int num = read();
    if(num==1) o++;
    g = std::gcd(g, num);
    cnt[num]++;

    num = read();
    if(num==1) o++;
    g = std::gcd(g, num);
    cnt[num]++;

    num = read();
    if(num==1) o++;
    g = std::gcd(g, num);
    cnt[num]++;

    num = read();
    if(num==1) o++;
    g = std::gcd(g, num);
    cnt[num]++;
  }

  for(int i=0;i<(n-1)%4;i++){
    int num = read();
    if(num==1) o++;
    g = std::gcd(g, num);
    cnt[num]++;
  }

  if(n - o > 80000){
    if(g==1) printf("setwise coprime\n");
    else printf("not coprime\n");
    return 0;
  }

  int max_S = 0;
  for(int i=2;i<=1000000;i++){
    int S = 0;
    for(int j=i;j<=1000000;j+=i) S += cnt[j];
    if(max_S<S) max_S = S;
  }
  if(max_S<2) printf("pairwise coprime\n");
  else if(max_S != n) printf("setwise coprime\n");
  else printf("not coprime\n");
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:14: error: 'gcd' is not a member of 'std'; did you mean 'gcd'?
   30 |     g = std::gcd(g, num);
      |              ^~~
a.cc:3:12: note: 'gcd' declared here
    3 | inline int gcd(int a, int b){
      |            ^~~
a.cc:35:14: error: 'gcd' is not a member of 'std'; did you mean 'gcd'?
   35 |     g = std::gcd(g, num);
      |              ^~~
a.cc:3:12: note: 'gcd' declared here
    3 | inline int gcd(int a, int b){
      |            ^~~
a.cc:40:14: error: 'gcd' is not a member of 'std'; did you mean 'gcd'?
   40 |     g = std::gcd(g, num);
      |              ^~~
a.cc:3:12: note: 'gcd' declared here
    3 | inline int gcd(int a, int b){
      |            ^~~
a.cc:45:14: error: 'gcd' is not a member of 'std'; did you mean 'gcd'?
   45 |     g = std::gcd(g, num);
      |              ^~~
a.cc:3:12: note: 'gcd' declared here
    3 | inline int gcd(int a, int b){
      |            ^~~
a.cc:52:14: error: 'gcd' is not a member of 'std'; did you mean 'gcd'?
   52 |     g = std::gcd(g, num);
      |              ^~~
a.cc:3:12: note: 'gcd' declared here
    3 | inline int gcd(int a, int b){
      |            ^~~
Language: C++

#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
const int A = 1000005;
 
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> c(A);
  rep(i,n) {
    cin >> a[i];
    c[a[i]]++;
  }
 
  bool pairwise = true;
  for (int i = 2; i < A; i++) {
    int cnt = 0;
    for (int j = i; j < A; j += i) {
      cnt += c[j];
    }
    if (cnt > 1) pairwise = false;
  }
 
  if (pairwise) {
    cout << "pairwise coprime" << endl;
    return 0;
  }
 
  int g = 0;
  rep(i,n) g = gcd(g,a[i]);
  if (g == 1) {
    cout << "setwise coprime" << endl;
    return 0;
  }
 
  cout << "not coprime" << endl;
  return 0;
}
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;

const int A = 1000005;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> c(A);
  rep(i,n) {
    cin >> a[i];
    c[a[i]]++;
  }

  bool pairwise = true;
  for (int i = 2; i < A; i++) {
    int cnt = 0;
    for (int j = i; j < A; j += i) {
      cnt += c[j];
    }
    if (cnt > 1) pairwise = false;
  }

  if (pairwise) {
    cout << "pairwise coprime" << endl;
    return 0;
  }

  int g = 0;
  rep(i,n) g = __gcd(g,a[i]);
  if (g == 1) {
    cout << "setwise coprime" << endl;
    return 0;
  }

  cout << "not coprime" << endl;
  return 0;
}

Compiler output:
a.cc:49:11: error: redefinition of 'const int A'
   49 | const int A = 1000005;
      |           ^
a.cc:7:11: note: 'const int A' previously defined here
    7 | const int A = 1000005;
      |           ^
a.cc:51:5: error: redefinition of 'int main()'
   51 | int main() {
      |     ^~~~
a.cc:9:5: note: 'int main()' previously defined here
    9 | int main() {
      |     ^~~~
Language: Java

import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    Integer[] data=new Integer[N];
	boolean pair=true;
    HashSet<Integer> setwise=new HashSet<>();
    for(int i=0;i<N;i++){
      for(int j=i;j<N;j++){
        int res=gcd(data[i],data[j]);
        if(res!=1){
          pair=false;
        }
		setwise.add(res);
      }
    }
    Main kari=new Main();
    if(pair=true){
      System.out.println("pairwise coprime");
    }else{
      int result=kari.setGcd(setwise);
      if(result==-1){
        System.out.println("setwise coprime");
      }else{
        System.out.println("not coprime");
      }
    }
  
  }
  
  int setGcd(HashSet<Integer> s){
    HashSet<Integer> setwise2=new HashSet<>();
    Iterator<Integer> it = setwise2.iterator();
	List<Integer> setList=new ArrayList<>();
    while (it.hasNext()) {
      setList.add(it.next());
    }
	for(int i=0;i<setList.size();i++){
     for(int j=i;j<setList.size();j++){
       setwise2.add(gcd(setList.get(i),setList.get(j)));
     }
    }
    if(setwise2.size()==1){
      if(setwise2.contain(1)){
        return -1;
      }else{
        return -2;
      }
    }else{
      return setGcd(setwise2);
    }
  }
  
  static int gcd(int a,int b){
    if(a%b==0) return b;
	else return gcd(b,a%b);    
  }
  
}


Compiler output:
Main.java:46: error: cannot find symbol
      if(setwise2.contain(1)){
                 ^
  symbol:   method contain(int)
  location: variable setwise2 of type HashSet<Integer>
1 error
Language: Java

import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    Integer[] data=new Integer[N];
	boolean pair=true;
    HashSet<Integer> setwise=new HashSet<>();
    for(int i=0;i<N;i++){
      for(int j=i;j<N;j++){
        int res=gcd(data[i],data[j]);
        if(res!=1){
          pair=false;
        }
		setwise.add(res);
      }
    }
    Main kari=new Main();
    if(pair=true){
      System.out.println("pairwise coprime");
    }else{
      int result=kari.setGcd(setwise);
      if(result==-1){
        System.out.println("setwise coprime");
      }else{
        System.out.println("not coprime");
      }
    }
  
  }
  
  int setGcd(HashSet<Integer> s){
    HashSet<Integer> setwise2=new HashSet<>();
    Iterator<Integer> it = setwise2.iterator<>();
	List<Integer> setList=new ArrayList<>();
    while (it.hasNext()) {
      setList.add(it.next());
    }
	for(int i=0;i<setList.size();i++){
     for(int j=i;j<setList.size();j++){
       setwise2.add(gcd(setList.get(i),setList.get(j)));
     }
    }
    if(setwise2.size()==1){
      if(setwise2.contain(1)){
        return -1;
      }else{
        return -2;
      }
    }else{
      return setGcd(setwise2);
    }
  }
  
  static int gcd(int a,int b){
    if(a%b==0) return b;
	else return gcd(b,a%b);    
  }
  
}


Compiler output:
Main.java:35: error: illegal start of expression
    Iterator<Integer> it = setwise2.iterator<>();
                                             ^
Main.java:35: error: -> expected
    Iterator<Integer> it = setwise2.iterator<>();
                                                ^
2 errors
Language: Java

import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    Integer[] data=new Integer[N];
	boolean pair=true;
    HashSet<Integer> setwise=new HashSet<>();
    for(int i=0;i<N;i++){
      for(int j=i;j<N;j++){
        int res=gcd(data[i],data[j]);
        if(res!=1){
          pair=false;
        }
		setwise.add(res);
      }
    }
    Main kari=new Main();
    if(pair=true){
      System.out.println("pairwise coprime");
    }else{
      int result=kari.setGcd(setwise);
      if(result==-1){
        System.out.println("setwise coprime");
      }else{
        System.out.println("not coprime");
      }
    }
  
  }
  
  int setGcd(HashSet<Integer> s){
    HashSet<Integer> setwise2=new HashSet<>();
    Iterator it = setwise2.iterator();
	List<Integer> setList=new ArrayList<>();
    while (it.hasNext()) {
      setList.add(it.next());
    }
	for(int i=0;i<setList.size();i++){
     for(int j=i;j<setList.size();j++){
       setwise2.add(gcd(setList.get(i),setList.get(j)));
     }
    }
    if(setwise2.size()==1){
      if(setwise2.contain(1)){
        return -1;
      }else{
        return -2;
      }
    }else{
      return setGcd(setwise2);
    }
  }
  
  static int gcd(int a,int b){
    if(a%b==0) return b;
	else return gcd(b,a%b);    
  }
  
}


Compiler output:
Main.java:38: error: incompatible types: Object cannot be converted to Integer
      setList.add(it.next());
                         ^
Main.java:46: error: cannot find symbol
      if(setwise2.contain(1)){
                 ^
  symbol:   method contain(int)
  location: variable setwise2 of type HashSet<Integer>
Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output
2 errors
Language: Java

import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    Integer[] data=new Integer[N];
	boolean pair=true;
    HashSet<Integer> setwise=new HashSet<>();
    for(int i=0;i<N;i++){
      for(int j=i;j<N;j++){
        int res=gcd(data[i],data[j]);
        if(res!=1){
          pair=false;
        }
		setwise.add(res);
      }
    }
    Main kari=new Main();
    if(pair=true){
      System.out.println("pairwise coprime");
    }else{
      int result=kari.setGcd(setwise);
      if(result==-1){
        System.out.println("setwise coprime");
      }else{
        System.out.println("not coprime");
      }
    }
  
  }
  
  int setGcd(HashSet<Integer> s){
    HashSet<Integer> setwise2=new HashSet<>();
	for(int i=0;i<s.size();i++){
     for(int j=i;j<s.size();j++){
       setwise2.add(gcd(s.get(i),s.get(j)));
     }
    }
    if(setwise2.size()==1){
      if(setwise2.contain(1)){
        return -1;
      }else{
        return -2;
      }
    }else{
      return setGcd(setwise2);
    }
  }
  
  static int gcd(int a,int b){
    if(a%b==0) return b;
	else return gcd(b,a%b);    
  }
  
}


Compiler output:
Main.java:37: error: cannot find symbol
       setwise2.add(gcd(s.get(i),s.get(j)));
                         ^
  symbol:   method get(int)
  location: variable s of type HashSet<Integer>
Main.java:37: error: cannot find symbol
       setwise2.add(gcd(s.get(i),s.get(j)));
                                  ^
  symbol:   method get(int)
  location: variable s of type HashSet<Integer>
Main.java:41: error: cannot find symbol
      if(setwise2.contain(1)){
                 ^
  symbol:   method contain(int)
  location: variable setwise2 of type HashSet<Integer>
3 errors
Language: Java

import java.util.*;

public class Main{
  public static void main(String args[]){
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    Integer[] data=new Integer[N];
	boolean pair=true;
    HashSet<Integer> setwise=new HashSet<>();
    for(int i=0;i<N;i++){
      for(int j=i;j<N;j++){
        int res=gcd(data[i],data[j]);
        if(res!=1){
          pair=false;
        }
		setwise.add(res);
      }
    }
    Main kari=new Main();
    if(pair=true){
      System.out.println("pairwise coprime");
    }else{
      int result=kari.setGcd(setwise);
      if(result==-1){
        System.out.println("setwise coprime");
      }else{
        System.out.println("not coprime");
      }
    }
  
  }
  
  int setGcd(HashSet<Integer> s){
    HashSet<Integer> setwise2=new HashSet<>();
	for(int i=0;i<s.size();i++){
     for(int j=i;j<s.size();j++){
       setwize2.add(gcd(s.get(i),s.get(j)));
     }
    }
    if(setwise2.size()==1){
      if(setwize2.contain(1)){
        return -1;
      }else{
        return -2;
      }
    }else{
      return setGcd(setwise);
    }
  }
  
  static int gcd(int a,int b){
    if(a%b==0) return b;
	else return gcd(b,a%b);    
  }
  
}


Compiler output:
Main.java:37: error: cannot find symbol
       setwize2.add(gcd(s.get(i),s.get(j)));
       ^
  symbol:   variable setwize2
  location: class Main
Main.java:37: error: cannot find symbol
       setwize2.add(gcd(s.get(i),s.get(j)));
                         ^
  symbol:   method get(int)
  location: variable s of type HashSet<Integer>
Main.java:37: error: cannot find symbol
       setwize2.add(gcd(s.get(i),s.get(j)));
                                  ^
  symbol:   method get(int)
  location: variable s of type HashSet<Integer>
Main.java:41: error: cannot find symbol
      if(setwize2.contain(1)){
         ^
  symbol:   variable setwize2
  location: class Main
Main.java:47: error: cannot find symbol
      return setGcd(setwise);
                    ^
  symbol:   variable setwise
  location: class Main
5 errors
Language: C++

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

const int INF = 1e9;
struct Eratos{
    vector<bool> is_prime;
    vector<int> P;
    vector<int> min_prime;

    Eratos(int N) : is_prime(N + 1, true), min_prime(N + 1, INF){
        for(int i = 2; i <= N; i++){
            if(is_prime[i]){
                for(int j = 2 * i; j <= N; j += i)
                    is_prime[j] = false;
                P.pb(i);
            }
        }
    };
};

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n)
        cin >> a[i];
    Eratos er(1000002);

    vector<int> s(1000002, 0);
    int judge1 = 1;
    int judge2 = 1;
    rep (i,n){
        for (int j;er.P[j] < 1000; j++){
            if (a[i] % er.P[j] == 0 )//&& er.P[j] * er.P[j] <= a[i]){
            //    int x = a[i] / er.P[j];
                if (s[er.P[j]] )//|| s[x])
                    judge1 = 0;
                s[er.P[j]]++;
            //    if (er.is_prime[x]){
              //      if (er.P[j] < x)
                //        s[x]++;
               // }
                if (s[er.P[j]] == n)// || s[x] == n)
                    judge2 = 0;
            }
        }
    }
    if (judge1)
        cout << "pairwise coprime" << endl;
    else if (judge2)
        cout << "setwise coprime" << endl;
    else cout << "not coprime" << endl;
}


Compiler output:
a.cc:51:5: error: expected unqualified-id before 'if'
   51 |     if (judge1)
      |     ^~
a.cc:53:5: error: expected unqualified-id before 'else'
   53 |     else if (judge2)
      |     ^~~~
a.cc:55:5: error: expected unqualified-id before 'else'
   55 |     else cout << "not coprime" << endl;
      |     ^~~~
a.cc:56:1: error: expected declaration before '}' token
   56 | }
      | ^
Language: C++

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

const int INF = 1e9;
struct Eratos{
    vector<bool> is_prime;
    vector<int> P;
    vector<int> min_prime;

    Eratos(int N) : is_prime(N + 1, true), min_prime(N + 1, INF){
        for(int i = 2; i <= N; i++){
            if(is_prime[i]){
                for(int j = 2 * i; j <= N; j += i)
                    is_prime[j] = false;
                P.pb(i);
            }
        }
    };
};

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n)
        cin >> a[i];
    Eratos er(1000002);

    vector<int> s(1000002, 0);
    int judge1 = 1;
    int judge2 = 1;
    rep (i,n){
        for (int j;er.P[j] < 1000; j++){
            if (er.P[j] * er.P[j] <= a[i] && a[i] % er.P[j] == 0){
            //    int x = a[i] / er.P[j];
                if (s[er.P[j]] )//|| s[x])
                    judge1 = 0;
                s[er.P[j]]++;
            //    if (er.is_prime[x]){
              //      if (er.P[j] < x)
                //        s[x]++;
               // }
                if (s[er.P[j]] == n || s[x] == n)
                    judge2 = 0;
            }
        }
    }
    if (judge1)
        cout << "pairwise coprime" << endl;
    else if (judge2)
        cout << "setwise coprime" << endl;
    else cout << "not coprime" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:46:42: error: 'x' was not declared in this scope
   46 |                 if (s[er.P[j]] == n || s[x] == n)
      |                                          ^
Language: C++

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

const int INF = 1e9;
struct Eratos{
    vector<bool> is_prime;
    vector<int> P;
    vector<int> min_prime;

    Eratos(int N) : is_prime(N + 1, true), min_prime(N + 1, INF){
        for(int i = 2; i <= N; i++){
            if(is_prime[i]){
                for(int j = 2 * i; j <= N; j += i)
                    is_prime[j] = false;
                P.pb(i);
            }
        }
    };
};

int main(){
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n)
        cin >> a[i];
    Eratos er(1000002);

    vector<int> s(1000002, 0);
    int judge1 = 1;
    int judge2 = 1;
    rep (i,n){
        for (int j;er.P[j] < 1000; j++){
            if (er.P[j] * er.P[j] <= a[i] && a[i] % er.P[j] == 0){
            //    int x = a[i] / er.P[j];
                if (s[er.P[j]] || s[x])
                    judge1 = 0;
                s[er.P[j]]++;
            //    if (er.is_prime[x]){
              //      if (er.P[j] < x)
                //        s[x]++;
               // }
                if (s[er.P[j]] == n || s[x] == n)
                    judge2 = 0;
            }
        }
    }
    if (judge1)
        cout << "pairwise coprime" << endl;
    else if (judge2)
        cout << "setwise coprime" << endl;
    else cout << "not coprime" << endl;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:37: error: 'x' was not declared in this scope
   39 |                 if (s[er.P[j]] || s[x])
      |                                     ^
a.cc:46:42: error: 'x' was not declared in this scope
   46 |                 if (s[er.P[j]] == n || s[x] == n)
      |                                          ^
Language: C++

#include <bits/stdc++.h>
#include<cmath>
using namespace std;
#define int unsigned long long 
#define mod 1000000007
const int sz = 1000000;
bool pr[sz];
void sieve()
{
    memset(pr,true,sizeof(pr));
    
    for(int p = 2;p*p<sz;p++)
    {
        if(pr[p])
        {
            for(int i = p*p;i<sz;i+=p)
            pr[i] = false;
        }
    }
    pr[0] = pr[1] = false;
    
}
signed main() {
    
    sieve();
    
    int n;
    cin>>n;
    int arr[n];
    vector<int> temp;
    for(int i = 0;i<n;i++){
    cin>>arr[i];
    if(arr[i]!=1)
    temp.push_back(arr[i]);
    }
    
    if(temp.size() == 0)
    {
        cout<<"pairwise coprime"<<"\n";
    }
    else{
    int gcd1 = arr[0];
    
    for(int i = 1;i<n;i++)
    gcd1 = __gcd(gcd1 , arr[i]);
    
    std::vector<int> prime;
    // store all the prime numbers form the given array.
   
    
   // int val = 0;
    vector<int> fact;
    for(int i = 0;i<temp.size();i++)
    {
        if(pr[temp[i]]){
        prime.push_back(temp[i]);
        
        }
        else
        fact.push_back(temp[i]);
    }
    
    if(prime.size() == temp.size()) 
    cout<<"pairwise coprime"<<"\n";
    else if(prime.size() == temp.size() - 1)
    {
        // we have res ..
        bool flag = false;
        for(int j = 0;j<fact.size();j++){
            int val = fact[j];
        for(int i = 0;i<arr.size();i++)
        {
            if(val%arr[i] == 0)
            {
                flag = true;
                break;
            }
        }
        if(flag==true)
        break;
        }
        if(!flag)
        cout<<"pairwise coprime"<<"\n";
        else if(gcd1 == 1)
        cout<<"setwise coprime"<<"\n";
        else
        cout<<"not coprime"<<"\n";
    }
    else if(gcd1 == 1)
    cout<<"setwise coprime"<<"\n";
    else
    cout<<"not coprime"<<"\n";
    
    }
    
    
 
}

Compiler output:
a.cc: In function 'int main()':
a.cc:71:29: error: request for member 'size' in 'arr', which is of non-class type 'long long unsigned int [n]'
   71 |         for(int i = 0;i<arr.size();i++)
      |                             ^~~~
Language: C++

#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <iterator>
#include <numeric>
#include <cstdint>
#include <cmath>
#include <bitset>
#include <string>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <random>
#include <chrono>

#define N_TIMES(i, n)     for ( uint64_t i = 0;     i <  n; ++i )
#define N_TIMES_REV(i, n) for (  int64_t i = n - 1; i >= 0; --i )

template<typename T> using maximum_heap = std::priority_queue<T, std::vector<T>, std::less<T>>;
template<typename T> using minimum_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<typename T>
std::istream& operator>>(std::istream &is, std::vector<T> &v)
{
  for (typename std::vector<T>::size_type i = 0; i < v.size(); ++i) {
    is >> v[i];
  }
  return is;
}

using namespace std;

const uint64_t M = 1e+6;

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

  vector<uint64_t> A(N);
  cin >> A;

  uint64_t set_gcd = A[0];
  N_TIMES(n, N) { set_gcd = gcd(set_gcd, A[n]); }

  if (set_gcd > 1) {
    cout << "not coprime" << endl;
    return 0;
  }

  vector<uint64_t> sieve(M + 1);
  N_TIMES(m, M) { sieve[m] = m; }
  for (uint64_t m = 2; m <= M; ++m) {
    if (sieve[m] != m) { continue; }
    
    uint64_t i = m << 1;
    while (i <= M) {
      sieve[i] = m;
      i += m;
    }
  }

  vector<uint64_t> factor(M + 1, 0);
  N_TIMES(n, N) {
    uint64_t x = A[n];
    while (x > 1) {
      debug(x);
      ++factor[x];
      x /= sieve[x];
    }
  }
  
  bool pairwise_flag = true;
  N_TIMES(m, M + 1) {
    if (factor[m] > 1) {
      pairwise_flag = false;
      break;
    }
  }
  
  if (pairwise_flag) {
    cout << "pairwise coprime" << endl;
  } else {
    cout << "setwise coprime" << endl;
  }

  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:7: error: 'debug' was not declared in this scope
   72 |       debug(x);
      |       ^~~~~