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

#include <iostream>
#include <vector>
#include <set>
#include <cmath>
using namespace std;
const int maxn = 1e6 + 5;
int N, A[maxn], f[maxn];
vector<int> primes;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
void seive() {
    vector<bool> vis(maxn, false);
    for(int i = 2; i < maxn; ++i) {
        if(vis[i] == true) {
            f[i] = i;
            continue;
        }
        for(int j = i; i * j < maxn; ++j)
            vis[i * j] = true, f[i * j] = i;
    }
    for(int i = 2; i < maxn; ++i)
        if(vis[i] == false) primes.push_back(i);
}
int main() {
    cin >> N;
    for(int i = 0; i < N; ++i) {
        cin >> A[i];
    }

    // Check pairwise coprime.
    seive();
    bool pairPirme = true;
    unordered_set<int> visFac;
    for(int i = 0; i < N; ++i) {
        int t = A[i];
        while(f[t] != t) {
            int p = f[t];
            while(t % p == 0) t /= p;
            if(visFac.count(p)) pairPirme = false;
            visFac.insert(p);
        }
        if(f[t] == t) {
            if(visFac.count(t)) pairPirme = false;
            visFac.insert(t);
        }
    }

    // Check setwise coprime.
    int t = A[0];
    for(int i = 1; i < N; ++i) {
        t = gcd(t, A[i]);
    }
    bool setPrime = (t == 1);

    if(pairPirme) cout << "pairwise coprime" << endl;
    else if(setPrime) cout << "setwise coprime" << endl;
    else cout << "not coprime" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:5: error: 'unordered_set' was not declared in this scope
   32 |     unordered_set<int> visFac;
      |     ^~~~~~~~~~~~~
a.cc:5:1: note: 'std::unordered_set' is defined in header '<unordered_set>'; this is probably fixable by adding '#include <unordered_set>'
    4 | #include <cmath>
  +++ |+#include <unordered_set>
    5 | using namespace std;
a.cc:32:19: error: expected primary-expression before 'int'
   32 |     unordered_set<int> visFac;
      |                   ^~~
a.cc:38:16: error: 'visFac' was not declared in this scope
   38 |             if(visFac.count(p)) pairPirme = false;
      |                ^~~~~~
a.cc:39:13: error: 'visFac' was not declared in this scope
   39 |             visFac.insert(p);
      |             ^~~~~~
a.cc:42:16: error: 'visFac' was not declared in this scope
   42 |             if(visFac.count(t)) pairPirme = false;
      |                ^~~~~~
a.cc:43:13: error: 'visFac' was not declared in this scope
   43 |             visFac.insert(t);
      |             ^~~~~~
Language: C++

#include <iostream>
#include <vector>
#include <set>
#include <cmath>
using namespace std;
const int maxn = 1e6 + 5;
int N, A[maxn], f[maxn];
vector<int> primes;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
void seive() {
    vector<bool> vis(maxn, false);
    for(int i = 2; i < maxn; ++i) {
        if(vis[i] == true) continue;
        for(int j = i; i * j < maxn; ++j)
            vis[i * j] = true, f[i * j] = i;
    }
    for(int i = 2; i < maxn; ++i)
        if(vis[i] == false) primes.push_back(i);
}
int main() {
    cin >> N;
    for(int i = 0; i < N; ++i) {
        cin >> A[i];
    }

    // Check pairwise coprime.
    seive();
    bool pairPirme = true;
    set<int> visFac;
    for(int i = 0; i < N; ++i) {
        int t = A[i];
        while(f[t] != 0) {
            int p = f[t];
            while(t % p == 0) t /= p;
            if(visFac.count(p)) pairPirme = false;
            visFac.insert(p);
        }
        if(t > 1) {
            if(visFac.count(p)) pairPirme = false;
            visFac.insert(p);
        }
    }

    // Check setwise coprime.
    int t = A[0];
    for(int i = 1; i < N; ++i) {
        t = gcd(t, A[i]);
    }
    bool setPrime = (t == 1);

    if(pairPirme) cout << "pairwise coprime" << endl;
    else if(setPrime) cout << "setwise coprime" << endl;
    else cout << "not coprime" << endl;
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:29: error: 'p' was not declared in this scope
   39 |             if(visFac.count(p)) pairPirme = false;
      |                             ^
a.cc:40:27: error: 'p' was not declared in this scope
   40 |             visFac.insert(p);
      |                           ^
Language: C

#include<stdio.h>
#include<stdlib.h>
long int gcd(long int x, long int y){
  while (x!=0){
    if (x>=y) x=x%y;
    else {
      y=y%x;
      long int temp=x;
      x=y;
      y=temp;
    }
  }
  return y;
}
int main(){
  long int n;
  scanf("%li",&n);
  long int * b=(long int *)malloc(n*sizeof(long int));
  int i,j;
  for (i=0;i<n;i++) scanf ("%li",&b[i]));
  long int pairs=gcd(b[0],b[1]), set=pairs;
  for(i=0;i<n-1;i++)
    for(j=i+1;j<n;j++)
      if (pairs==1) pairs=gcd(b[i],b[j]);
  else if (j==(i+1)) set=gcd(set,b[j]);
  if (pairs==1) printf("pairwise compare\n");
  else if (set==1) printf("setwise compare\n");
       else printf("not coprime\n");
  return 0;
}

Compiler output:
main.c: In function 'main':
main.c:20:40: error: expected ';' before ')' token
   20 |   for (i=0;i<n;i++) scanf ("%li",&b[i]));
      |                                        ^
      |                                        ;
main.c:20:40: error: expected statement before ')' token
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
int gcd(int a,int b)
{
  if(a==0) return b;
  return gcd(b%a,a);
}
int32_t main()
{
  int t,n,i,j,k,m,l=0,max1=0;
  cin>>n;
  int a[n+1];
  for(i=1;i<=n;i++) cin>>a[i];
  sort(a+1,a+n+1);
  bool dp[a[n]+1];k=a[n];
  memset(dp,1,sizeof(dp));
  map<int,int> m;
  for(i=1;i<=n;i++) m[a[i]]++;
  bool hi=true;
  for(i=2;i<=k;i++)
  { 
     for(j=2*i;j<=k;j+=i)
     {
       if(m.count(j))
         l+=m[j];
      }
      if(l>1)
      {
        hi=false;
        break;
        }
  }
  
  if(hi) cout<<"pairwise coprime";
  else
  {
    l=a[i];
    for(i=2;i<=n;i++)
    {
      l=gcd(l,a[i]);
    }
    if(l==1) cout<<"setwise coprime";
    else cout<<"not coprime";
  }
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:18:16: error: conflicting declaration 'std::map<long long int, long long int> m'
   18 |   map<int,int> m;
      |                ^
a.cc:11:17: note: previous declaration as 'long long int m'
   11 |   int t,n,i,j,k,m,l=0,max1=0;
      |                 ^
a.cc:19:22: error: invalid types 'long long int[long long int]' for array subscript
   19 |   for(i=1;i<=n;i++) m[a[i]]++;
      |                      ^
a.cc:25:13: error: request for member 'count' in 'm', which is of non-class type 'long long int'
   25 |        if(m.count(j))
      |             ^~~~~
a.cc:26:14: error: invalid types 'long long int[long long int]' for array subscript
   26 |          l+=m[j];
      |              ^
Language: C++

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

const int N = 1e6 + 10;
long long int n,a[N];

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

int main(void)
{
	ios :: sync_with_stdio(false);
	cin.tie(0);
	
	cin >> n;
	int flag = 0;
	int p = 1;
	
	for(int i = 0;i < n;i++) cin >> a[i];
	
	p = a[0];
	
	for(int i = 1;i < n;i++)
	{
		p = gcd(p,a[i]);
		
		if(p != 1) flag = 1;
	}
	
	if(p != 1) cout << "not coprime"<<endl;
	else if(flag == 1) cout << "setwise coprime"<<endl;
	else cout <<"pairwise coprime"<<endl;
	
	return 0;
}

Compiler output:
a.cc:8:14: error: expected initializer before 'gcd'
    8 | long longint gcd(long int a,long int b)
      |              ^~~
a.cc: In function 'int main()':
a.cc:29:21: error: 'gcd' was not declared in this scope
   29 |                 p = gcd(p,a[i]);
      |                     ^~~
Language: C++

/*in the name of Allah the most beneficent the most merciful.*/
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define MAX 1e18
#define MIN -1e18
#define MOD 1000000007
//#define mod2 20071027
//#define MOD 998244353
// #define base 100001
//#define mod 1000074259
#define base2 31
#define memz(a) memset(a, 0, sizeof(a))
#define memn(a) memset(a, -1, sizeof(a))
#define in1(a) scanf("%lld", &a)
#define in2(a, b) scanf("%lld%lld", &a, &b)
#define TC(c) printf("Case %lld:\n", ++c)
#define out(x) cout << #x << " -> " << x << endl;
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
#define FILE   freopen("input.txt", "r", stdin);  freopen("out.txt", "w", stdout);
using namespace std;
const int N = 1000010;
ll n, a[N], pc = 1, gcd;
bool mp[N];
int solve() {
	in1(n);
	for (int i = 0; i < n; i++) {
		in1(a[i]);
		if (mp[a[i]]) {
			pc = 0;
		}
		mp[a[i]] = 1;
		gcd = __gcd(gcd, a[i]);
	}
	if (gcd > 1) {
		printf("not coprime\n");
	}
	else {
		if (pc == 0) printf("setwise coprime\n");
		else {
			for (int i = 2; i <= 1000000; i++) {
				ll cnt = 0;
				for (ll j = i; j <= 1000000; j += i) {
					if (mp[j]) {
						cnt++;
					}
				}
				if (cnt > 1) {
					printf("setwise coprime\n");
					return 0;

				}
			}
			printf("pairwise coprime\n");
		}
	}

	return 0;
}
int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	return solve();
}

Compiler output:
a.cc: In function 'int solve()':
a.cc:33:17: error: reference to 'gcd' is ambiguous
   33 |                 gcd = __gcd(gcd, a[i]);
      |                 ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:2:
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:23:21: note:                 'long long int gcd'
   23 | ll n, a[N], pc = 1, gcd;
      |                     ^~~
a.cc:33:29: error: reference to 'gcd' is ambiguous
   33 |                 gcd = __gcd(gcd, a[i]);
      |                             ^~~
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:23:21: note:                 'long long int gcd'
   23 | ll n, a[N], pc = 1, gcd;
      |                     ^~~
a.cc:35:13: error: reference to 'gcd' is ambiguous
   35 |         if (gcd > 1) {
      |             ^~~
/usr/include/c++/14/numeric:173:5: note: candidates are: 'template<class _Mn, class _Nn> constexpr std::common_type_t<_Mn, _Nn> std::gcd(_Mn, _Nn)'
  173 |     gcd(_Mn __m, _Nn __n) noexcept
      |     ^~~
a.cc:23:21: note:                 'long long int gcd'
   23 | ll n, a[N], pc = 1, gcd;
      |                     ^~~
Language: Java

Copy
Copy
import java.util.*;
 
public class Main {
	public static void main (String[] args) {
	  Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      long[] arr = new long[n];
      
      long setGCD = 0;
      for(int i= 0; i<n; i++){
        arr[i] = sc.nextLong();
        
        setGCD = gcd(setGCD, arr[i]);
      }
      long prod = 1;
      long[] prodArr = new long[n];
      for(int i=n-1; i>=0; i--){
        prod *= arr[i];
        prodArr[i] = prod;
      }
      boolean pairWise = true;
      boolean setWise = true;
      for(int i=0; i<n-1; i++){
        long cur = arr[i];
        //long next = arr[i+1];
        long nextProd = prodArr[i+1];
        if(gcd(cur, nextProd) != 1) pairWise = false;
      }
      setGCD = gcd(setGCD, arr[n-1]);
      if(pairWise) System.out.println("pairwise coprime");
      else if(setGCD == 1) System.out.println("setwise coprime");
      else System.out.println("not coprime");
	}
  public static long gcd(long a, long b){
    if(b==0) return a;
    return gcd(b, a%b);
  }
}

Compiler output:
Main.java:1: error: class, interface, enum, or record expected
Copy
^
1 error
Language: C++

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

#define ll long long int
#define All(a) (a).begin(),(a).end()

vector<int> X(1000001)={};
void solve(){
  int n,m;
  vector<int> X;
  scanf("%d",&n);
  vector<int> A(n);
  for(int i=0;i<n;i++){
    scanf("%d",&A[i]);
    X[A[i]]++;
  }
  sort(All(A));

  int tmp=A[0];
  for (int i = 1; i < n; i++)
  {
    tmp=gcd(tmp,A[i]);
  }
  if(tmp>1){ 
    printf("not coprime\n");
    return;
  }

  for (int i = 2; i <1000001; i++){
    int cnt=0;
    for (int j = i; j <n; j+=i)
    {
      cnt+=X[i];
      if(cnt>1){
        printf("setwise coprime\n")
        return;
      }
      //auto a=find(All(X),f[j]);
      //if(a!=X.end())goto setwise;
      //else{
      //X.push_back(f[j]);
      //}
    }
    
  }
  printf("pairwise coprime\n");
  return;
int main(){
  
  // int q=3;
  // while(q--){
  //   solve();
  // }
 solve();
  return 0;
}

Compiler output:
a.cc:7:23: error: expected ',' or ';' before '=' token
    7 | vector<int> X(1000001)={};
      |                       ^
a.cc: In function 'void solve()':
a.cc:35:36: error: expected ';' before 'return'
   35 |         printf("setwise coprime\n")
      |                                    ^
      |                                    ;
   36 |         return;
      |         ~~~~~~                      
a.cc:48:9: warning: empty parentheses were disambiguated as a function declaration [-Wvexing-parse]
   48 | int main(){
      |         ^~
a.cc:48:9: note: remove parentheses to default-initialize a variable
   48 | int main(){
      |         ^~
      |         --
a.cc:48:9: note: or replace parentheses with braces to value-initialize a variable
a.cc:48:11: error: a function-definition is not allowed here before '{' token
   48 | int main(){
      |           ^
a.cc:56:2: error: expected '}' at end of input
   56 | }
      |  ^
a.cc:8:13: note: to match this '{'
    8 | void solve(){
      |             ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

const int N = 1e6 + 5;

int n, a[N], cnt[N];
long long dp[N];

int gcd (int x, int y) {
    int r = 0;
    while (y != 0) {
        r = x % y;
        x = y;
        y = r;
    }

    return x;
}

int main(){
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i], cnt[a[i]]++;

    int g = accumulate(a + 1, a + n + 1, 0, gcd);
    for (int i = 1; i < N; i++) {
        for (int j = i + i; j < N; j += i) {
            cnt[i] += cnt[j];
        }
    }

    for (int i = N - 1; i >= 1; i--) {
        dp[i] = 1LL * cnt[i] * (cnt[i] - 1) / 2;
        for (int j = i + i; j < N; j += i) {
            dp[i] -= dp[j];
        }
    }

    if (dp[1] == 1LL * n * (n - 1) / 2) cout << "pairwise coprime" << endl;
    else if (g == 1) cout << "setwise coprime" << endl;
    else cout << "not coprime" << endl;
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:26:23: error: no matching function for call to 'accumulate(int*, int*, int, <unresolved overloaded function type>)'
   26 |     int g = accumulate(a + 1, a + n + 1, 0, gcd);
      |             ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/numeric:62,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_numeric.h:134:5: note: candidate: 'template<class _InputIterator, class _Tp> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp)'
  134 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init)
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:134:5: note:   candidate expects 3 arguments, 4 provided
/usr/include/c++/14/bits/stl_numeric.h:161:5: note: candidate: 'template<class _InputIterator, class _Tp, class _BinaryOperation> _Tp std::accumulate(_InputIterator, _InputIterator, _Tp, _BinaryOperation)'
  161 |     accumulate(_InputIterator __first, _InputIterator __last, _Tp __init,
      |     ^~~~~~~~~~
/usr/include/c++/14/bits/stl_numeric.h:161:5: note:   template argument deduction/substitution failed:
a.cc:26:23: note:   couldn't deduce template parameter '_BinaryOperation'
   26 |     int g = accumulate(a + 1, a + n + 1, 0, gcd);
      |             ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
Language: C++

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

#define ll long long int
#define All(a) (a).begin(),(a).end()
//a<bでないといけない
ll gcd(ll a,ll b){
  b%=a;
  if(b==0)return a;
  else gcd(b,a);
}
bool analyze(vector<int>& v,int x){
  if(x==1)return true;
  for (int i = 2;i*i<=x;i++){
    if(x%i==0){
      auto result=find(All(v),i);
      if(result!=v.end()) return false;
      else v.push_back(i);
    }
  }
  auto
}

void solve(){
  int n,m;
  
  scanf("%d",&n);
  vector<int> A(n);
  for(int i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  sort(All(A));

  int tmp=A[0];
  for (int i = 1; i < n; i++)
  {
    tmp=gcd(tmp,A[i]);
  }
  if(tmp>1){ 
    printf("not coprime\n");
    return;
  }
  vector<int> X={};
  for (int i = 0; i < n; i++){
    if(analyze(X,A[i]))continue;
    else goto setwise;
  }
  //printf("%d",(int)X.size());
  printf("pairwise coprime\n");
  return;

setwise:
  printf("setwise coprime\n");
  return;

}
int main(){
  
  // int q=3;
  // while(q--){
  //   solve();
  // }
  // solve();
  printf("setwise coprime\n");

  return 0;
}

Compiler output:
a.cc: In function 'bool analyze(std::vector<int>&, int)':
a.cc:22:1: error: expected unqualified-id before '}' token
   22 | }
      | ^
a.cc: In function 'long long int gcd(long long int, long long int)':
a.cc:10:11: warning: control reaches end of non-void function [-Wreturn-type]
   10 |   else gcd(b,a);
      |        ~~~^~~~~
a.cc: In function 'bool analyze(std::vector<int>&, int)':
a.cc:22:1: warning: control reaches end of non-void function [-Wreturn-type]
   22 | }
      | ^
Language: C++

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

#define ff first
#define ss second
#define it(a, x) for (auto &a : x)
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vi vector<int>
#define vpii vector<pii>
#define vs vector<string>
#define gi greater<int>
#define vc vector<char>
#define vvi vector<vi>
#define vvc vector<vc>
#define mii map<int, int>
#define pqb priority_queue<int>
#define pqs priority_queue<int, vi, greater<int> >
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define mod 1000000007
#define inf 1e18
#define ps(x, y) fixed << setprecision(y) << x
#define mk(arr, n, type) type *arr = new type[n];
#define w(x)  \
    int x;    \
    cin >> x; \
    while (x--)
#define deb(x) cout << #x << "=" << x << endl;
#define in(i, n) for (auto i = 0; i < n; i++)
#define all(x) begin(x), end(x)
//mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());//random shuffler

ll fxp(ll a, ll b) {
    if (b == 0) return 1;
    if (b % 2 == 0) {
        ll c = fxp(a, b / 2);
        return (c * c) % mod;
    }
    return (a * fxp(a, b - 1)) % mod;
}

void c_p_c() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
}

const int MXN = 1e6 + 5;
vector<int> primes(MXN, 1);

void pre() {
    primes[0] = 0;
    primes[1] = 0;
    for (int i = 2; i * i < MXN; i++) {
        for (int j = i * i; j < MXN; j += i) {
            primes[j] = i;
        }
    }
}

void solve() {
    pre();
    int n;
    cin >> n;
    vector<int> a(n);
    in(i, n)cin >> a[i];
    unordered_map<int, int> freq;
    bool first = true;
    for (int i = 0; i < n; i++) {
        int x = a[i];
        while (primes[x] != 1 and prime[x] != 0) {
            freq[primes[x]]++;
            x /= primes[x];
        }
    }
    for (auto x : freq) {
        if (x.second > 1) {
            first = false;
            break;
        }
    }
    if (first) {
        cout << "pairwise coprime";
        return;
    }

    int gcd = a[0];
    for (int i = 1; i < n; i++)
        gcd = __gcd(gcd, a[i]);

    if (gcd == 1) {
        cout << "setwise coprime";
        return;
    }

    cout << "not coprime";
}

int main(int argc, char const *argv[]) {
    c_p_c();
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:80:35: error: 'prime' was not declared in this scope; did you mean 'primes'?
   80 |         while (primes[x] != 1 and prime[x] != 0) {
      |                                   ^~~~~
      |                                   primes
Language: C++

#include<bits/stdc++.h>
#define maxn 1000010
using namespace std;
int a[maxn],prime[maxn],not_prime[maxn],tot,vis[maxn];
void linear_shaker(int x){
	int i,j;
	for(i=2;i<=x;i++){
		if(!not_prime[i])prime[++tot]=i;
		for(j=1;prime[j]*i<=x;j++){
			not_prime[i*prime[j]]=prime[j];
			if(i%prime[j]==0)break;
		}
	}
}
int main(){
	int n,i,m=0,b,c,cnt=0;
	cin>>n;
	for(i=1;i<=n;i++)cin>>a[i],m=max(m,a[i]);
	linear_shaker(m);
	for(i=1;i<=n;i++){
		b=a[i];
		while(not_prime[b]){
			c=not_prime[b];
			vis[c]++,cnt=max(cnt,vis[c]);
			while(b%c==0)b/=c;
		}
		if(b!=1)vis[b]++,cnt=max(cnt,vis[b]);
	}
	if(cnt<=1)printf("pairwise coprime\n");，
	else if(cnt<n)printf("setwise coprime\n");
	else printf("not coprime\n");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:29:48: error: '\U0000ff0c' was not declared in this scope
   29 |         if(cnt<=1)printf("pairwise coprime\n");，
      |                                                ^~
a.cc:31:9: error: 'else' without a previous 'if'
   31 |         else printf("not coprime\n");
      |         ^~~~
Language: C++

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

int main()
{
	int64_t n;
	cin >> n;
	vector<int64_t> as(n);
	for (auto &&a : as)
	{
		cin >> a;
	}

	bool s = [&] {
		int64_t g = 0;
		for (auto &&a : as)
		{
			g = gcd(g, a);
		}
		return (g == 1);
	}();

	bool p = [&] {
		vector<int64_t> d(1000001, -1);
		for (int64_t i = 2; i * i <= 1000000; i++)
		{
			if (d[i] == -1)
			{
				d[i] = i;
				for (int64_t j = 2 * i; j <= 1000000; j += i)
				{
					d[j] = i;
				}
			}
		}

		vector<set<int64_t>> v(n);
		for (int64_t i = 0; i < n; i++)
		{
			if (as[i] == 1)
			{
				v[i].insert(1);
				continue;
			}

			while (as[i] != 1)
			{
				v[i].insert(d[as[i]]);
				as[i] /= d[as[i]];
			}
		}

		for (int64_t i = 0; i < n; i++)
		{
			for (int64_t j = i + 1; j < n; j++)
			{
				for (int64_t x : v[i])
				{
					if (v[j].find(x) != v[j].end())
					{
						return false;
					}
				}
			}
		}
		return true;
	}();

	if (p)
	{
		cout << "pairwise coprime" << endl;
	}
	else if (s)
	{
		cout << "setwise coprime" << endl;
	}
	else
	{
		cout << "not coprime" << endl;
	}

	return 0;
}

Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

/*
	ID: Loxilante
	Time: 2020/09/
	Prog: 
	Lang: cpp
*/
#ifdef ONLINE_JUDGE
#pragma GCC optimize("O3")
#endif
#include <bits/extc++.h>
#define rep(i, l, r) for(int i = l; i < r; i++)
#define hrp(i, l, r) for(int i = l; i <= r; i++)
#define rev(i, r, l) for(int i = r; i >= l; i--)
#define ms(n, t) memset(n, t, sizeof(n))
#define pb push_back
#define int ll
#ifndef JOEON
#define D(...) 97
#endif
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
template<typename tn = int> inline tn next(void) { tn k; cin>>k; return k; }
inline void quickSort(int left, int right)
{
	if (left >= right) return;

	int i = left, j = right, par = w[left+right >> 1];
	while(w[i++] <= par);
	while(w[j--] <= par);
}
signed main(void)
{
	clock_t Begin = clock();

	#ifdef JOEON
//		freopen("C:\\Users\\Joeon\\Desktop\\IN.txt", "r", stdin);
//		freopen("C:\\Users\\Joeon\\Desktop\\OUT.txt", "w", stdout);
	#endif
	
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int n = next();
	rep(i, 0, n) next
	
	clock_t InputFinished = clock();
	
	
	
	clock_t End = clock();
	
	D((double)(End-Begin)/CLOCKS_PER_SEC);
	D((double)(End-InputFinished)/CLOCKS_PER_SEC);
	
	return 0;
}
/*

 */

Compiler output:
a.cc: In function 'void quickSort(ll, ll)':
a.cc:28:40: error: 'w' was not declared in this scope
   28 |         int i = left, j = right, par = w[left+right >> 1];
      |                                        ^
a.cc: In function 'int main()':
a.cc:45:26: error: expected ';' before 'clock_t'
   45 |         rep(i, 0, n) next
      |                          ^
      |                          ;
   46 | 
   47 |         clock_t InputFinished = clock();
      |         ~~~~~~~           
a.cc:47:40: error: statement cannot resolve address of overloaded function
   47 |         clock_t InputFinished = clock();
      |                                        ^
Language: C++

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

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

signed main(void)
{
	int n, mx;
	bool is_pair, is_setwise;
	cin >> n;
	vector<int> a(n);
	mx = 0;
	rep(i, n) 
	{
		cin >> a[i];
		mx = max(mx, a[i]);
	}
	vector<bool> f(mx + 1, 0); 
	is_pair = true;
	rep(i, n)
	{
		x = a[i];
		for(ll j = 2; j * j <= x; j++)
		{
			cnt = 0;
			while (x % j == 0)
			{
				x /= j;
				cnt++;
			}
			if (cnt > 0)
			{
				if (f[j] == true)
					is_pair = false;
				f[j] = true;
			}
		}
	}
	if (is_pair)
	{
		cout << "pairwise coprime" << endl;
		return 0;
	}
	int g = 0;
	rep(i, n)
	{
		g = gcd(a[i], g);
		if (g != 1)
			is_setwise = false;
	}
	if (is_setwise)	
	{
		cout << "setwise coprime" << endl;
		return 0;
	}
	cout << "not coprime" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:30:17: error: 'x' was not declared in this scope
   30 |                 x = a[i];
      |                 ^
a.cc:33:25: error: 'cnt' was not declared in this scope; did you mean 'int'?
   33 |                         cnt = 0;
      |                         ^~~
      |                         int
Language: C++

#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int a;
  for(int i=0;i<n;i++)	cin>>a[i];
  cout<<"not coprime";
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:31: error: invalid types 'int[int]' for array subscript
    8 |   for(int i=0;i<n;i++)  cin>>a[i];
      |                               ^
Language: C++

#include <bits/stdc++.h>


using namespace std;

int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
#define rep(i,n) for(int i = 0;i<n;i++)


int main(){

    int A,N,t;cin>> N;
    vector<int> ar(N);rep(i,N)cin >> ar[i];
    A = sort(ar.begin(),ar.begin())[N-1];
    vector<int> D(A+1,0);
    
    for (int i = 2;i<=A;i++){
        if (D[i] == 0){
            t = i;
            while (t <= A){
                if (D[t] == 0)D[t]=i;
                t+=i;
            }
        }
    }
    vector<int> E(A+1,0);
    bool b = true;

    rep(i,N){
        vector<int> F(A+1,0);
        t = ar[i];
        while (t > 1){
            if (E[D[t]]==1){
                b = false;
                break;
            }
            F[D[t]]=1;
            t/=D[t];
        }
        if (b == false)break;
        rep(i,A+1){
            E[i]+=F[i];
        }

    }
    if (b){
        cout << "pairwise coprime" << endl;
    }
    else{
        t = ar[0];
        rep(i,N-1)t = gcd(t,ar[i+1]);
        if (t==1){
            cout << "setwise coprime" << endl;
        }
        else cout << "not coprime" << endl;
    }

    

}



Compiler output:
a.cc: In function 'int main()':
a.cc:14:36: error: invalid types 'void[int]' for array subscript
   14 |     A = sort(ar.begin(),ar.begin())[N-1];
      |                                    ^
Language: C++

#include <map>
#include <algorithm>
#include <cassert>
#include <climits>
#include <complex>
#include <cstdio>
#include <string>
#include <iostream>
#include <queue>
#include <string>
#include <tuple>
#include <vector>
#include <numeric>
using namespace std;
using ll = long long;
using ld = long double;

template<class T> bool chmin(T &a, T b) { return a>b?(a=b,true):false; }
template<class T> bool chmax(T &a,T  b) { return a<b?(a=b,true):false; }
#define forn(i,x,y) for(int i=(x);i<(int)(y);i++)
#define rep(i,y) for(int i=0;i<(int)(y);i++)
#define repb(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define all(a) (a).begin(), (a).end()
#define uni(a) (a).erase(unique(all(a)), (a).end())
#define bit(n, i) (((n) >> (i)) & 1)
#define bitcount(n) __builtin_popcountll(n)

int N;
int a[1000100];
bool inv[1000100];
bool note[1000100];
int main() {
    cin >> N;
    rep(i,N) {
        cin >> a[i];
        inv[a[i]] = true;
    }
    int p = gcd(a[0],a[1]);
    rep(i,N) {
        p=gcd(p,a[i]);
    }
    bool setwise = false;
    if (p==1) setwise = true;
    bool non_pairwise = false;
    for(int i=2;i<1000100;i++) {
        if (note[i]) continue;
        ll mul=1;
        int cnt=0;
        while((i*mul<1000100) {
            note[i*mul] = true;
            if (inv[i*mul]) cnt++;
            mul++;
        }
        if (cnt > 1) {
            non_pairwise = true;
            break;
        }
    }
    if (!non_pairwise) {
        cout << "pairwise coprime" << endl;
        return 0;
    } else if (setwise) {
        cout << "setwise coprime" << endl;
        return 0;
    } else {
        cout << "not coprime" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:30: error: expected ')' before '{' token
   49 |         while((i*mul<1000100) {
      |              ~               ^~
      |                              )
Language: C++

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

bool gozyohou1(vector<int> a){
  sort(a.begin(),a.end());
  int pi;
  int d;
  for(int i=0;i<(int)a.size()-1;i++){
    pi=1;
    d=a.at(i);
    if(2*d>a.at(a.size()-1){
      break;
    }
    for(int j=i+1;j<(int)a.size();j++){
      pi=pi*a.at(j)%d;
    }
    while(pi>1){
      d%=pi;
      swap(d,pi);
      if(pi==0){
        return false;
      }
    }
  }
  return true;
}
bool gozyohou2(vector<int> a){
  sort(a.begin(),a.end());
  while(a.at(0)>1){
    for(int i=1;i<(int)a.size();i++){
      a.at(i)%=a.at(0);
    }
    a.erase(remove_if(a.begin(),a.end(),[](int x){return x==0;}),a.end());
    if((int)a.size()==1){
      return false;
    }
    sort(a.begin(),a.end());
  }
  return true;
}

int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin>>a.at(i);
  }
  if(gozyohou1(a)){
    cout<<"pairwise coprime"<<endl;
    return 0;
  }
  if(gozyohou2(a)){
    cout<<"setwise coprime"<<endl;
    return 0;
  }
  cout<<"not coprime"<<endl;
}
  
  

Compiler output:
a.cc: In function 'bool gozyohou1(std::vector<int>)':
a.cc:11:28: error: expected ')' before '{' token
   11 |     if(2*d>a.at(a.size()-1){
      |       ~                    ^
      |                            )
a.cc:14:19: error: 'j' was not declared in this scope
   14 |     for(int j=i+1;j<(int)a.size();j++){
      |                   ^
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>

using namespace std;

const int dx[4] = { 1,0,-1,0 };
const int dy[4] = { 0,-1,0,1 };
const int LIT = 1e9 + 7;
int n, m;

vector<int> arr[1000001];
vector<int> cnt(1000001, 0);

void solve() {
    cin >> n;
    for (int i = 1; i <= n; i++) {
        int x;
        cin >> x;
        for (int j = 1; j <= (int)sqrt(x); j++) {
            if (x % j == 0) {
                arr[i].push_back(j);
                arr[i].push_back(x / j);
                cnt[j]++;
                if(j != (x/j))
                    cnt[x / j]++;
            }
        }
    }

    bool check = false, Check = true;

    int big = 0, idx =0 ;

    for (int i = 2; i <= n; i++) {
        if (cnt[i] < big) {
            big = cnt[i];
            idx = i;
        }
        if (cnt[i] == n) check = true;
        else if (cnt[i] > 1) Check = false;
    }

    if (check) cout << "not coprime";
    else if (Check) cout << "pairwise coprime";
    else cout << "setwise coprime";

}

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


Compiler output:
a.cc: In function 'void solve()':
a.cc:23:35: error: 'sqrt' was not declared in this scope
   23 |         for (int j = 1; j <= (int)sqrt(x); j++) {
      |                                   ^~~~
Language: C++

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

bool gozyohou(int a,int b){
  while(a>1){
    b=b%a;
    if(b==0) return false;
    swap(a,b);
  }
  return true;
}
bool gozyohou(vector<int> x){
  if(x.size()<=1){
    return true;
  }
  sort(x.begin(),x.end());
  while(x[0]>1){
    for(int i=1;i<x.size();i++){
      x.at(i)%=x.at(0);
    }
    sort(x.begin(),x.end());
    x.erase_if(x,[](int x){return x>0;});
    if(x.size()==1){
      return false;
    }
  }
  return true;
}
  

int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  bool pair=true;
  for (int i=0;i<n;i++){
    cin>>a.at(i);
    if(i>0){
      if(!gozyohou(a.at(i-1),a.at(i))){
        pair=false;
      }
    }
  }
  if(pair){
    cout<<"pairwise coprime"<<endl;
    return 0;
  }
  if(gozyohou(a)){
    cout<<"setwise coprime"<<endl;
    return 0;
  }
  cout<<"not coprime"<<endl;
}
  
  

Compiler output:
a.cc: In function 'bool gozyohou(std::vector<int>)':
a.cc:22:7: error: 'class std::vector<int>' has no member named 'erase_if'; did you mean 'erase'?
   22 |     x.erase_if(x,[](int x){return x>0;});
      |       ^~~~~~~~
      |       erase
Language: C++

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

bool gozyohou(int a,int b){
  while(a>1){
    b=b%a;
    if(b==0) return false;
    swap(a,b);
  }
  return true;
}
bool gozyohou(vector<int> x){
  if(x.size()<=1){
    return true;
  }
  sort(x.begin(),x.end());
  while(x[0]>1){
    for(int i=1;i<x.size();i++){
      x.at(i)%=x.at(0);
    }
    sort(x.begin(),x.end());
    erase_if(x,[](int x){return x>0;});
    if(x.size()==1){
      return false;
    }
  }
  return true;
}
  

int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  bool pair=true;
  for (int i=0;i<n;i++){
    cin>>a.at(i);
    if(i>0){
      if(!gozyohou(a.at(i-1),a.at(i))){
        pair=false;
      }
    }
  }
  if(pair){
    cout<<"pairwise coprime"<<endl;
    return 0;
  }
  if(gozyohou(a)){
    cout<<"setwise coprime"<<endl;
    return 0;
  }
  cout<<"not coprime"<<endl;
}
  
  

Compiler output:
a.cc: In function 'bool gozyohou(std::vector<int>)':
a.cc:22:5: error: 'erase_if' was not declared in this scope
   22 |     erase_if(x,[](int x){return x>0;});
      |     ^~~~~~~~
Language: C++

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

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  for(int i=0;i<n;i++)
    cin >> a.at(i);
  

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

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

bool check_pairwize(long long N, std::vector<long long> &A, set<int> &s)
{
    // pairwize coprimeの確認
    for (ll i = 2; i <= A[N - 1]; i++)
    {
        if (i == 2 or i % 2 == 1)
        {
            set<int> cnt;
            for (ll j = 1; i * j <= A[N - 1]; j++)
            {
                if (s.count(i * j) > 0)
                {
                    cnt.insert(i * j);
                }
            }
            if (cnt.size() > 1)
            {
                return false;
            }
        }
    }
    return true;
}

bool check_setwize(long long N, std::vector<long long> &A, multiset<int> &s)
{
    // setwize coprimeの確認
    ll res = A[0];
    for (ll i = 1; i < N; i++)
    {
        res = gcd(res, A[i]);
    }
    if (res != 1)
    {
        return false;
    }
    return true;
}

void solve(long long N, std::vector<long long> A)
{

    multiset<int> s;
    sort(A.begin(), A.end());
    for (auto &&e : A)
    {
        s.insert(e);
    }

    string ans;
    if (check_pairwize(N, A, s))
    {
        ans = "pairwise coprime";
    }
    else if (check_setwize(N, A, s))
    {
        ans = "setwise coprime";
    }
    else
    {
        ans = "not coprime";
    }
    cout << ans << endl;
}

signed main()
{
    long long N;
    scanf("%lld", &N);
    std::vector<long long> A(N);
    for (int i = 0; i < N; i++)
    {
        scanf("%lld", &A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


Compiler output:
a.cc: In function 'void solve(long long int, std::vector<long long int>)':
a.cc:55:30: error: invalid initialization of reference of type 'std::set<int>&' from expression of type 'std::multiset<int>'
   55 |     if (check_pairwize(N, A, s))
      |                              ^
a.cc:5:71: note: in passing argument 3 of 'bool check_pairwize(long long int, std::vector<long long int>&, std::set<int>&)'
    5 | bool check_pairwize(long long N, std::vector<long long> &A, set<int> &s)
      |                                                             ~~~~~~~~~~^
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define mp make_pair
#define ll long long
#define pb push_back

void solve()
{

  int n;
  cin>>n;

  vector<int>v(n);

  set<int>s;

  int i,j;
  bool b = 0;
  int maxi = INT_MIN;
  for(i=0;i<n;i++)
  {
      cin>>v[i];
      maxi = max(maxi, v[i]);
      if(v[i]==1)b = 1;
  }

  vector<int>sieve(maxi+1, -1);
  
  sieve[1] = 1;

  for(i=2;i*i<=maxi;i++)
  {
      if(sieve[i]!=-1)continue;

      for(j=i;j<=maxi;j = j+i)
      {
          if(sieve[j]==-1)
            sieve[j] = i;
      }
  }



  bool f = 1;

  map<int,int>m;

  for(auto it=v.begin();it!=v.end();it++)
  {
      int val = *it;
      
      if(val==1){count_1++;continue;}
  
      while(val>1)
      {
          int x = sieve[val];

          if(x==-1)
            break;
           m[x]++;

          while(val%x==0)
            val = val/x;
      }
  }
  bool se = 1;
  for(auto it=m.begin();it!=m.end();it++)
  {
      if(it->second > 1)f=0;
      if(it->second == v.size())se = 0;
  }
  if(count_1 > 1)f=0;
  if(f==1)
  {
      cout<<"pairwise coprime"<<endl;
      return;
  }
  if(se==1 || b==1)
  {
      cout<<"setwise coprime"<<endl;
      return;
  }

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

int main()
{

  int t = 1;
  //cin>>t;

  while(t--)
    solve();

  return 0;
}


Compiler output:
a.cc: In function 'void solve()':
a.cc:53:18: error: 'count_1' was not declared in this scope
   53 |       if(val==1){count_1++;continue;}
      |                  ^~~~~~~
a.cc:73:6: error: 'count_1' was not declared in this scope
   73 |   if(count_1 > 1)f=0;
      |      ^~~~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;

int main() {
	vector<int> prime;
	bool judge;
	prime.push_back(2);
	for (int i = 3; i < 1000; i++) {
		judge = true;
		for (int j = 0; j < prime.size(); j++) {
			if (prime[j] > sqrt(i)) {
				break;
			}
			if (i % prime[j] == 0) {
				judge = false;
				break;
			}
		}
		if (judge) {
			prime.push_back(i);
		}
	}
	int N;
	cin >> N;
	int A;
	vector<int> pair(1000001);
	set<int> set, next_set;
	int n;
	bool judge_pair = true;
	for (int x : prime) set.insert(x);
	for (int i = 0; i < N; i++) {
		cin >> A;
		n = A;
		for (int j = 0; prime[j] <= sqrt(n); j++) {
			if (n % prime[j] == 0) {
				if (judge_pair) {
					if (pair[prime[j]] == 0) pair[prime[j]] = 1;
					else judge_pair = false;
					if (A / prime[j] != prime[j]) {
						if (pair[A / prime[j]] == 0) pair[A / prime[j]] = 1;
						else judge_pair = false;
					}
				}
				if (set.count(prime[j])) {
					next_set.insert(prime[j]);
				}
				if (set.count(A / prime[j])) {
					next_set.insert(A / prime[j]);
				}
				while (n % prime[j] == 0) {
					n /= prime[j];
				}
			}
		}
		set = next_set;
	}
	if (judge_pair) cout << "pairwise coprime" << endl;
	else if (set.size() == 1 || set.empty()) cout << "setwise coprime" << endl;
	else cout << "not coprime" << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:14:40: error: 'sqrt' was not declared in this scope
   14 |                         if (prime[j] > sqrt(i)) {
      |                                        ^~~~
a.cc:37:45: error: 'sqrt' was not declared in this scope
   37 |                 for (int j = 0; prime[j] <= sqrt(n); j++) {
      |                                             ^~~~
Language: C++

#include <iostream>
#include <string>
#include <cmath>
using namespace std;

int is_prime(int n){
    
    int i;
    i = 2;
    
    if (n == 1){
        return 0;
        
    } else if (n == 2){
        return 1;
        
    } else {
        while(1){
            if (n % i == 0){
                return 0;
                
            } else if (n < i * i){
                return 1;
                
            } else {
                i++;
            }
        }
    }
    
    return 0;
}

int gcd(int m, int n){
    
    if (m % n == 0){
        return n;
    } else {
        return gcd(n, m % n);
    }
}

int is_set(int b[100000], int n){
    
    int i;
    i = 2;
    
    if (n == 1) return 0;
    
    if (is_prime(n) == 1){
        if (b[n] == 1) {
            return 1;
        } else {
            b[n] = 1;
        }
        
    } else {
        while(n % i > 0){
            i++;
        }
                
        if (b[i] == 1) {
            return 1;
            
        } else {
            b[i] = 1;
            
            while (n % i == 0){
                n /= i;
            }

            return is_set(b, n);
        }
        
    }
    
    return 0;
}

int main(){
    
    int i, N, D, set;
    cin >> N;
    
    int a[N];
    int b[100000];
    
    for (i = 0; i < N; i++){
        cin >> a[i];
    }
    
    for (i = 0; i < 100; i++){
        b[i] = 0;
    }
    
    for (i = 0; i < N; i++){
        if (i == 0){
            D = a[i];
            
        } else {
            D = gcd(GCD, a[i]);
        }
                
        if (D == 1) break;
    }
    
    if (D > 1){
        cout << "not coprime\n";
        return 0;
    }
    
    for (i = 0; i < N; i++){
        set = is_set(b, a[i]);
        if (set == 1){
            cout << "setwise coprime\n";
            return 0;
        }
    }
    
    cout << "pairwise coprime\n";
    
    return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:101:21: error: 'GCD' was not declared in this scope
  101 |             D = gcd(GCD, a[i]);
      |                     ^~~
Language: C++

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

const int MAXN=1000000;
int A[MAXN+5];
int G[MAXN+5];

int gcd(int a,int b)
{
	return b == 0 ? a : gcd(b,a%b) ;
}

int main()
{
	int n,x;
	int cur=0;
	scanf("%d",&n);
	for(int i=1;i<=n;++i)
	{
		scanf("%d",&x);
		++A[x];
		cur=gcd(cur,x);
	}	
	for(int i=2;i<=MAXN;++i)
	{
		for(int j=i;j<=MAXN;j+=i)
		{
			if(A[j]!=0) ++G[i];
		}
	}
	int flag=0;
	for(int i=2;i<=MAXN;++i)
	{
		if(G[i]>1) 
		{
			flag=1;
			break;
		}	
	}
	if(flag==0) printf("pairwise coprime")
	if(flag==1 &&cur==1) printf("setwise coprime"); 
	else printf("not coprime");
	return 0;
} 

Compiler output:
a.cc: In function 'int main()':
a.cc:40:47: error: expected ';' before 'if'
   40 |         if(flag==0) printf("pairwise coprime")
      |                                               ^
      |                                               ;
   41 |         if(flag==1 &&cur==1) printf("setwise coprime");
      |         ~~
Language: C++

#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };  // i<4:4way i<8:8way
int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);

ll cnt[1000006];

int main(void){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  int n;
  cin >> n;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  int allgcd = a[0];
  rep(i,n)allgcd = __gcd(allgcd,a[i]);
  if(allgcd > 1){
    cout << "not coprime" << endl;
  }else{
    // 与えられた数をそれぞれ素因数分解していく
    rep(i,n){
      ll now = a[i];
      for(ll i=2;i*i<=a[i];i++){
        if(now%i==0){
          while(now%i==0)now/=i;
          cnt[i]++;
        }
      }
      if(now>1)cnt[now]++;
    }
    rep(i,1e6+1){
      if(cnt[i]>1){
        cout << "setwise coprime" << endl;
        return 0;
      }
    }
    cout << "pairwise coprime" << endl;
  }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:25: error: no matching function for call to '__gcd(int&, __gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type&)'
   28 |   rep(i,n)allgcd = __gcd(allgcd,a[i]);
      |                    ~~~~~^~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algo.h:1137:5: note: candidate: 'template<class _EuclideanRingElement> _EuclideanRingElement std::__gcd(_EuclideanRingElement, _EuclideanRingElement)'
 1137 |     __gcd(_EuclideanRingElement __m, _EuclideanRingElement __n)
      |     ^~~~~
/usr/include/c++/14/bits/stl_algo.h:1137:5: note:   template argument deduction/substitution failed:
a.cc:28:25: note:   deduced conflicting types for parameter '_EuclideanRingElement' ('int' and 'long long int')
   28 |   rep(i,n)allgcd = __gcd(allgcd,a[i]);
      |                    ~~~~~^~~~~~~~~~~~~
Language: C++

#include <bits/stdc++.h>
//#define int long long

using namespace std;

const ind N = 1e6 + 9;
vector <int> prime;
bool used[N];


void calc() {
    for (int i = 0; i < N; ++i) used[i] = 0;
    for (int i = 2; i * i < N; (i & 1 ? i += 2 : i += 1)) {
        if (used[i]) continue;
        prime.push_back(i);
        for (int j = i * i; j < N; j += i) used[j] = 1;
    }
}

signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    calc();
    int n;
    cin >> n;
    int data[n];
    for (int i = 0; i < n; ++i) cin >> data[i];
    vector <int> cnt(N, 0);
    int fl = 1;
    for (int i = 0; i < n && fl; ++i) {
        int tmp = data[i];
        for (auto a : prime) {
            if (a * a > tmp) break;
            if (tmp % a == 0) {
                ++cnt[a];
                if (cnt[a] > 1) fl = 0;
                while (tmp % a == 0) tmp /= a;
            }
        }
        if (tmp != 0) ++cnt[tmp];
        if (cnt[tmp] > 1) fl = 0;
    }
    if (fl) {
        cout << "pairwise coprime";
        return 0;
    }
    int b = data[0];
    for (int i = 1; i < n; ++i) b = __gcd(b, data[i]);
    if (b == 1) {
        cout << "setwise coprime";
        return 0;
    }
    cout << "not coprime";
    return 0;
}


Compiler output:
a.cc:6:7: error: 'ind' does not name a type; did you mean 'int'?
    6 | const ind N = 1e6 + 9;
      |       ^~~
      |       int
a.cc:8:11: error: 'N' was not declared in this scope
    8 | bool used[N];
      |           ^
a.cc: In function 'void calc()':
a.cc:12:25: error: 'N' was not declared in this scope
   12 |     for (int i = 0; i < N; ++i) used[i] = 0;
      |                         ^
a.cc:12:33: error: 'used' was not declared in this scope
   12 |     for (int i = 0; i < N; ++i) used[i] = 0;
      |                                 ^~~~
a.cc:13:29: error: 'N' was not declared in this scope
   13 |     for (int i = 2; i * i < N; (i & 1 ? i += 2 : i += 1)) {
      |                             ^
a.cc:14:13: error: 'used' was not declared in this scope
   14 |         if (used[i]) continue;
      |             ^~~~
a.cc:16:44: error: 'used' was not declared in this scope
   16 |         for (int j = i * i; j < N; j += i) used[j] = 1;
      |                                            ^~~~
a.cc: In function 'int main()':
a.cc:29:22: error: 'N' was not declared in this scope
   29 |     vector <int> cnt(N, 0);
      |                      ^