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

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

using namespace std;


signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    vector <int> prime;
    prime.push_back(2);
    vector <bool> check(500005, 0);
    check[2] = 1;
    for (int i = 3; i <= 500000; ++i) {
        if (check[i] == 1) continue;
        else {
            prime.push_back(i);
            if (i * i <= 500000) {
            for (int j = i * i; j <= 500000; j += i) check[j] = 1;}
        }
    }
    int n;
    cin >> n;
    int data[n];
    for (int i = 0; i < n; ++i) cin >> data[i];
    int fl = 1;
    int fl2 = 1;
    vector <int> used(1000001, 0);
    for (int i = 0; i < n && fl; ++i) {
        for (int j = 0; j < long long(prime.size()); ++j) {
            if (fl == 0) break;
            if (data[i] % prime[j] == 0) {
                if (used[prime[j]] != 0) {
                    fl = 0;
                }
                used[prime[j]] += 1;
                if (used[prime[j]] >= n) {
                    fl2 = 0;
                }
            }
        }
    }
    if (fl2 == 1) {
        int a;
        a = data[0];
        for (int i = 1; i < n; ++i) a = __gcd(a, data[i]);
        if (a != 1) fl2 = 0;
    }
    if (fl) cout << "pairwise coprime";
    else if (fl2) cout << "setwise coprime";
    else cout << "not coprime";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:31:29: error: expected primary-expression before 'long'
   31 |         for (int j = 0; j < long long(prime.size()); ++j) {
      |                             ^~~~
a.cc:31:28: error: expected ';' before 'long'
   31 |         for (int j = 0; j < long long(prime.size()); ++j) {
      |                            ^~~~~
      |                            ;
a.cc:31:29: error: expected primary-expression before 'long'
   31 |         for (int j = 0; j < long long(prime.size()); ++j) {
      |                             ^~~~
a.cc:31:28: error: expected ')' before 'long'
   31 |         for (int j = 0; j < long long(prime.size()); ++j) {
      |             ~              ^~~~~
      |                            )
a.cc:31:29: error: expected primary-expression before 'long'
   31 |         for (int j = 0; j < long long(prime.size()); ++j) {
      |                             ^~~~
a.cc:31:56: error: 'j' was not declared in this scope
   31 |         for (int j = 0; j < long long(prime.size()); ++j) {
      |                                                        ^
Language: C++

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

using namespace std;


signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    vector <int> prime;
    prime.push_back(2);
    vector <bool> check(500005, 0);
    check[2] = 1;
    for (int i = 3; i <= 500000; ++i) {
        if (check[i] == 1) continue;
        else {
            prime.push_back(i);
            if (i * i <= 500000) {
            for (int j = i * i; j <= 500000; j += i) check[j] = 1;}
        }
    }
    int n;
    cin >> n;
    int data[n];
    for (int i = 0; i < n; ++i) cin >> data[i];
    int fl = 1;
    int fl2 = 1;
    vector <int> used(1000001, 0);
    for (int i = 0; i < n && fl; ++i) {
        for (int j = 0; j < int(prime.size()); ++j) {
            if (fl == 0) break;
            if (data[i] % prime[j] == 0) {
                if (used[prime[j]] != 0) {
                    fl = 0;
                }
                used[prime[j]] += 1;
                if (used[prime[j]] >= n) {
                    fl2 = 0;
                }
            }
        }
    }
    if (fl2 == 1) {
        int a;
        a = data[0];
        for (int i = 1; i < n; ++i) a = __gcd(a, data[i]);
        if (a != 1) fl2 = 0;
    }
    if (fl) cout << "pairwise coprime";
    else if (fl2) cout << "setwise coprime";
    else cout << "not coprime";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:2:13: error: expected primary-expression before 'long'
    2 | #define int long long
      |             ^~~~
a.cc:31:29: note: in expansion of macro 'int'
   31 |         for (int j = 0; j < int(prime.size()); ++j) {
      |                             ^~~
a.cc:31:28: error: expected ';' before 'long'
   31 |         for (int j = 0; j < int(prime.size()); ++j) {
      |                            ^
      |                            ;
a.cc:2:13: error: expected primary-expression before 'long'
    2 | #define int long long
      |             ^~~~
a.cc:31:29: note: in expansion of macro 'int'
   31 |         for (int j = 0; j < int(prime.size()); ++j) {
      |                             ^~~
a.cc:31:28: error: expected ')' before 'long'
   31 |         for (int j = 0; j < int(prime.size()); ++j) {
      |             ~              ^
      |                            )
a.cc:2:13: error: expected primary-expression before 'long'
    2 | #define int long long
      |             ^~~~
a.cc:31:29: note: in expansion of macro 'int'
   31 |         for (int j = 0; j < int(prime.size()); ++j) {
      |                             ^~~
a.cc:31:50: error: 'j' was not declared in this scope
   31 |         for (int j = 0; j < int(prime.size()); ++j) {
      |                                                  ^
Language: C++

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

using namespace std;


signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    vector <int> prime;
    prime.push_back(2);
    vector <bool> check(500005, 0);
    check[2] = 1;
    for (int i = 3; i <= 500000; ++i) {
        if (check[i] == 1) continue;
        else {
            prime.push_back(i);
            for (int j = i + i; j <= 500000; j += i) check[j] = 1;
        }
    }
    int n;
    cin >> n;
    int data[n];
    for (int i = 0; i < n; ++i) cin >> data[i];
    int fl = 1;
    int fl2 = 1;
    vector <int> used(1000001, 0);
    for (int i = 0; i < n && fl; ++i) {
        for (int j = 0; j < int(prime.size()); ++j) {
            if (fl == 0) break;
            if (data[i] % prime[j] == 0) {
                if (used[prime[j]] != 0) {
                    fl = 0;
                }
                used[prime[j]] += 1;
                if (used[prime[j]] >= n) {
                    fl2 = 0;
                }
            }
        }
    }
    if (fl2 == 1) {
        a = data[0];
        for (int i = 1; i < n; ++i) a = __gcd(a, data[i]);
        if (a != 1) fl2 = 0;
    }
    if (fl) cout << "pairwise coprime";
    else if (fl2) cout << "setwise coprime";
    else cout << "not coprime";
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:44:9: error: 'a' was not declared in this scope
   44 |         a = data[0];
      |         ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int maxN = 1e6 + 7;
int prime[maxN], p_index;
bool mark[maxN];
void sieve(){
	int limit = sqrt(maxN * 1.0) + 2;
	prime[p_index++] = 2;
	for(int i = 4; i < maxN; i += 2){
		mark[i] = true;
	}
	for(int i = 3; i < maxN; i += 2){
		if(!mark[i]){
			prime[p_index++] = i;
			for(int j = i * i; j < maxN && i <= limit; j += 2 * i){
				mark[j] = true;
			}
		}
	}
}
int main(){
	sieve();
	int n, num = 0;
	cin >> n;
	int v[n];
	for(int i = 0; i < n; i++){
		scanf("%d", &v[i]);
		num = max(num, v[i])
	}
	bool ok = true;
	for(int i = 0; i < p_index && prime[i] <= num; i++){
		int cnt = 0;
		for(int j = 0; j < n; j++){
			cnt += v[j] % prime[i] == 0;
		}		
		if(cnt >= 2)
			ok = false;
	}
	if(ok){
		puts("pairwise coprime");
		return 0;
	}
	int p_check = v[0];
	for(int i = 1; i < n; i++){
		p_check = __gcd(p_check, v[i]);
	}
	puts(p_check == 1 ? "setwise coprime" : "not coprime");
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:37: error: expected ';' before '}' token
   28 |                 num = max(num, v[i])
      |                                     ^
      |                                     ;
   29 |         }
      |         ~
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 1e6 + 10;
int n, a[N], mk[N], f, gcd;
void work(int x)
{
	for(int i = 2; i * i <= x; i++)
	{
		if(x % i == 0)
		{
			if(mk[i])
			{
				f = 1;
				return;
			}
			mk[i] = 1;
			while(x % i == 0) x /= i;
		}
	}
	if(x != 1)
	{
		if(mk[x])
		{
			f = 1;
			return;
		}
		mk[x] = 1;
	}
}
int main()
{
    std::ios::sync_with_stdio(false);
    cin >> n;
    for(int i = 1; i <= n; i++)
    {
    	cin >> a[i];
    	work(a[i]);
	}
	gcd = __gcd(a[1], a[2]);
	for(int i = 3; i <= n; i++) gcd = __gcd(gcd, a[i]);
	if(gcd != 1) cout << "not coprime" << endl;
	else if(f) cout << "setwise coprime" << endl;
	else cout << "pairwise coprime" << endl;
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:9: error: reference to 'gcd' is ambiguous
   40 |         gcd = __gcd(a[1], a[2]);
      |         ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc: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:5:24: note:                 'int gcd'
    5 | int n, a[N], mk[N], f, gcd;
      |                        ^~~
a.cc:41:37: error: reference to 'gcd' is ambiguous
   41 |         for(int i = 3; i <= n; i++) 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:5:24: note:                 'int gcd'
    5 | int n, a[N], mk[N], f, gcd;
      |                        ^~~
a.cc:41:49: error: reference to 'gcd' is ambiguous
   41 |         for(int i = 3; i <= n; i++) 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:5:24: note:                 'int gcd'
    5 | int n, a[N], mk[N], f, gcd;
      |                        ^~~
a.cc:42:12: error: reference to 'gcd' is ambiguous
   42 |         if(gcd != 1) cout << "not coprime" << endl;
      |            ^~~
/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:5:24: note:                 'int gcd'
    5 | int n, a[N], mk[N], f, gcd;
      |                        ^~~
Language: C++

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

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

bool isPrime[1000];
bool isExist[1000000];
int a[1000000];

int main() {
  rep(i, 1000) { isPrime[i] = true; isExist = false; }
  int n;
  cin >> n;

  int ans = 0;

  rep(i, n) {
    cin >> a[i];
    if (!isExist[a[i]]) isExist[a[i]] = true;
    else if (a[i] != 1) ans = 1;
  }

  for (int i = 2; i < 1000; i++) {
    if (isPrime[i]) {
      for (int j = 2 * i; j < 1000; j += i) {
        isPrime[j] = false;
      }
    }
  }

  int primeCount = 0;
  for (int i = 2; i < 1000000; i++) {
    if (isPrime[i]) {
      primeCount++;
      int dividable = 0;
      rep(j, n) {
        if (a[j] % i == 0) dividable++;
      }
      if (dividable >= 2) ans = 1;
    }
  }
  cout << "the number of prime is " << primeCount << endl;
  if (ans == 0) {
    cout << "pairwise coprime" << endl;
    return 0;
  }

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

  cout << "not coprime" << endl;

  return 0;
}
/*
*/


Compiler output:
a.cc: In function 'int main()':
a.cc:18:45: error: incompatible types in assignment of 'bool' to 'bool [1000000]'
   18 |   rep(i, 1000) { isPrime[i] = true; isExist = false; }
      |                                     ~~~~~~~~^~~~~~~
Language: C++

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

using namespace std;

int main() {
  int64_t N;
  cin >> N;
  
  int mx = 0;
  vector<int> nums(N);
  for (int n = 0; n < N; ++n) {
    cin >> nums[n];
    mx = max(mx, nums[n]);
  }
  vector<int> mods(mx+1);
  mods[1] = 1;
  for (int i = 2; i <= mx; ++i) {
    if (mods[i] != 0) {
      continue;
    }
    mods[i] = i;
    int tmp = i;
    while (tmp + i <= mx) {
      tmp += i;
      if (mods[tmp] != 0) continue;
      mods[tmp] = i;
    }
  }
  bitset<1000001> already;
  vector<int> cnts(mx+1);
  bool pairwise = true;
  for (int n : nums) {
    while (n > 1) {
      int tmp = mods[n];
      while (n % tmp == 0) {
        n /= tmp;
      }
      if (already.test(tmp)) {
        pairwise = false;
      }
      if (++cnts[tmp] == N) {
        cout << "not coprime" << endl;
        return 0;
      }
      already.set(tmp);
    }
  }
  if (pairwise) {
    cout << "pairwise coprime" << endl;
  } else {
    cout << "setwise coprime" << endl;
  }

  return 0;
}
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <vector>
#include <set>
using namespace std;

int main() {
  int64_t N;
  cin >> N;
  
  int mx = 0;
  vector<int> nums(N);
  for (int n = 0; n < N; ++n) {
    cin >> nums[n];
    mx = max(mx, nums[n]);
  }
  vector<int> mods(mx+1);
  mods[1] = 1;
  for (int i = 2; i <= mx; ++i) {
    if (mods[i] != 0) {
      continue;
    }
    mods[i] = i;
    int tmp = i;
    while (tmp + i <= mx) {
      tmp += i;
      if (mods[tmp] != 0) continue;
      mods[tmp] = i;
    }
  }
  bitset<1000001> already;
  vector<int> cnts(mx+1);
  bool pairwise = true;
  for (int n : nums) {
    while (n > 1) {
      int tmp = mods[n];
      while (n % tmp == 0) {
        n /= tmp;
      }
      if (already.test(tmp)) {
        pairwise = false;
      }
      if (++cnts[tmp] == N) {
        cout << "not coprime" << endl;
        return 0;
      }
      already.set(tmp);
    }
  }
  if (pairwise) {
    cout << "pairwise coprime" << endl;
  } else {
    cout << "setwise coprime" << endl;
  }

  return 0;
}


Compiler output:
a.cc:70:5: error: redefinition of 'int main()'
   70 | int main() {
      |     ^~~~
a.cc:10:5: note: 'int main()' previously defined here
   10 | int main() {
      |     ^~~~
Language: C++

#include<bits/stdc++.h>
#define MAXN 1000001
using namespace std;
void seive(int arr[]){
 	for(int i=2;i*i<MAXN;++i){
        if(arr[i]==-1){
          arr[i]=i;
           for(int j=i*i;j<MAXN;j+=i){
            	if(arr[j]==-1)
                  arr[j]=i;
           }
        }
    }
}
int main(){
  int arr[MAXN];
  memset(arr,-1,sizeof(arr));
  seive(arr);
  int n;
  cin>>n;
  int v[n];
  for(int i=0;i<n;++i){
    cin>>v[i];
  }
  sort(v,v+n);
  int g=__gcd(v[0],v[1]);
  for(int i=2;i<n;++i){
    g=__gcd(g,v[i]);
  }
  if(g!=1){
    cout<<"not coprime\n";
  }
  else{
    unordered_set<int> s;
    bool f=true;
    for(int i=0;;i<n;++i){
      if(s.find(arr[v[i]])!=s.end()){
        f=false;
        break;
      }
      s.insert(arr[v[i]]);
    }
    if(f)
      cout<<"pairwise coprime\n";
    else
      cout<<"setwise coprime\n";
  }
  
  
}

Compiler output:
a.cc: In function 'int main()':
a.cc:36:21: error: expected ')' before ';' token
   36 |     for(int i=0;;i<n;++i){
      |        ~            ^
      |                     )
a.cc:36:24: error: 'i' was not declared in this scope
   36 |     for(int i=0;;i<n;++i){
      |                        ^
Language: C++

#include <iomanip>
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define vec vector<long long int>
#define fi first
#define se second
#define pb push_back
void sieve(vector<bool> &x, int k)
{

    int i = 2;
    while (i < k)
    {
        if (x[i] == true)
        {

            int j = 2;
            while ((i * j) <= k)
            {
                x[i * j] = false;
                j++;
            }
        }
        i++;
    }
}

int main()
{

    int n;
    cin >> n;
    vector<int> y;
    int m = 0;
    for (int i = 0; i < n; i++)
    {
        int t;
        cin >> t;
        y.pb(t);
        m = max(m, t);
    }
    vector<bool> x(m + 1, true);
    sieve(x, m);
    vector<int> pr;
    int ss = x.size();

    for (int i = 2; i < xx; i++)
    {
        if (x[i] == true)
        {
            pr.pb(i);
            // cout << i << " ";
        }
    }
    int e = pr.size();
    int flag = 0;
    set<int> s;
    map<int, int> w;
    for (int i = 0; i < n; i++)
    {

        int q = y[i];

        int j = 0;
        while (j < e && pr[j] <= q)
        {
            int p = pr[j];
            if (q % p == 0)
            {
                w[p]++;
            }

            j++;
        }
    }
    int count = 0;
    int d = w.size();
    for (auto t : w)
    {
        if (t.second == 1)
        {

            count++;
        }
        else if (t.second >= d)
        {
            flag = 1;
        }
    }

    if (count == d)
    {
        cout << "pairwise coprime" << endl;
    }
    else if (flag == 0)
    {
        cout << "setwise coprime" << endl;
    }
    else
    {
        cout << "not coprime" << endl;
    }
}

Compiler output:
a.cc: In function 'int main()':
a.cc:49:25: error: 'xx' was not declared in this scope; did you mean 'x'?
   49 |     for (int i = 2; i < xx; i++)
      |                         ^~
      |                         x
Language: C++

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
using iii = pair<ii, int>;
#define vt vector
#define pq priority_queue
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define __lcm(a, b) a * b / __gcd(a, b)
const int MOD = 1e9 + 7;
const int INF = 2e9;
const int N = 1e6 + 5;

int n, gcd, cnt;
int a[N], freq[N];
bool valid;

void sieve() {
    valid = true;
    for(int i = 2; i <= N - 5; i++) {
        cnt = 0;
        for(int j = i; j <= N - 5; j += i) {
            cnt += freq[j];
        }
        if(cnt > 1) valid = false;
    }
}

void solve() {
    cin >> n;
    for(int i = 1; i <= n; i++) {
        cin >> a[i];
        freq[a[i]]++;
    }
    gcd = a[1];
    for(int i = 2; i <= n; i++) {
        gcd = __gcd(gcd, a[i]);
    }
    if(gcd > 1) {
        cout << "not coprime\n";
        return;
    }
    sieve();
    cout << (!valid ? "setwise coprime\n" : "pairwise coprime\n");
}

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

Compiler output:
a.cc: In function 'void solve()':
a.cc:39:5: error: reference to 'gcd' is ambiguous
   39 |     gcd = a[1];
      |     ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc: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:18:8: note:                 'int gcd'
   18 | int n, gcd, cnt;
      |        ^~~
a.cc:41:9: error: reference to 'gcd' is ambiguous
   41 |         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:18:8: note:                 'int gcd'
   18 | int n, gcd, cnt;
      |        ^~~
a.cc:41:21: error: reference to 'gcd' is ambiguous
   41 |         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:18:8: note:                 'int gcd'
   18 | int n, gcd, cnt;
      |        ^~~
a.cc:43:8: error: reference to 'gcd' is ambiguous
   43 |     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:18:8: note:                 'int gcd'
   18 | int n, gcd, cnt;
      |        ^~~
Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,a,b) for(ll i=(a);i<=(b);++i)
#define req(i,a,b) for(ll i=(a);i>=(b);--i)
#define name "a"
#define pb push_back
#define sz size()
#define ff first
#define ss second
#define xd '\n'
#define dc " "
#define Truong_Thanh_Minh ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef pair < ll , ll > ii;
const ll maxn = 1e6+7, oo = 1e18, base = 311, mod = 1e9+7;
const double PI = 3.141592654;
ll t, n, a[maxn], gcd, cnt[maxn];
int main()
{
    Truong_Thanh_Minh
    //freopen(name".inp","r",stdin);
    //freopen(name".out","w",stdout);
    cin >> n;
    rep (i, 1, n)
    {
        cin >> a[i];
        gcd = __gcd(gcd, a[i]);
    }
    if (gcd >= 2)
    {
        cout << "not coprime";
        return 0;
    }
    rep (i, 1, n)
    {
        ++ cnt[a[i]];
        for (int j = 2; j*j <= a[i]; ++j)
        {
            if (a[i]%j != 0)
                continue;
            ++cnt[j];
            if (cnt[j] >= 2)
            {
                cout << "setwise coprime";
                return 0;
            }
            if (j*j != a[i])
            {
                ++cnt[a[i]/j];
                if (cnt[a[i]/j] >= 2)
                {
                    cout << "setwise coprime";
                    return 0;
                }
            }
        }
    }
    cout << "pairwise coprime";
}


Compiler output:
a.cc: In function 'int main()':
a.cc:27:9: error: reference to 'gcd' is ambiguous
   27 |         gcd = __gcd(gcd, a[i]);
      |         ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:58,
                 from a.cc: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:17:19: note:                 'long long int gcd'
   17 | ll t, n, a[maxn], gcd, cnt[maxn];
      |                   ^~~
a.cc:27:21: error: reference to 'gcd' is ambiguous
   27 |         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:17:19: note:                 'long long int gcd'
   17 | ll t, n, a[maxn], gcd, cnt[maxn];
      |                   ^~~
a.cc:29:9: error: reference to 'gcd' is ambiguous
   29 |     if (gcd >= 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:17:19: note:                 'long long int gcd'
   17 | ll t, n, a[maxn], gcd, cnt[maxn];
      |                   ^~~
Language: C++

#include <iostream>
#include <fstream>
#include <vector>
#include <cstring>
#include <queue>
#include <algorithm> // sort
#include <math.h>
#include <map>
#include <set>

#define DEBUG 0

#define REP(i, n) for (long long i = 0; i < (n); i++) 
typedef long long ll;
static const ll MOD = 1000000007;
static const ll INF = 1000000000000000000LL;
                    //999999997000000003
                    //1000000000000000000

using namespace std;

ll euclidean_gcd(ll a, ll b) {
  if(a < b) return euclidean_gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b; //あまりが0ならそれが、最大公約数
}

int solve(){

    string pc = "pairwise coprime";
    string sc = "setwise coprime";
    string nc = "not coprime";
    ll N;
    cin >> N;
    vector <ll> a;
    cnt = 
    REP(i,N)
    {
        ll tmp;
        cin >> tmp;
        if(tmp == 1)
        {
            ++cnt;
            continue;
        }
        a.push_back(tmp);
    }

    N -= cnt;
    if(N <= 1)
    {
        cout << pc << endl;
        return 0;
    }

    //すべての1 <= i < j <= Nにおいて GCD(Ai,Aj) = 1;
    //どのペアも素数同士

    //2以上を分割していく?

    //全部試してみる
    bool pcFlg = true;

    //28, 40 → 2
    // 5, 7 , 9, 


    for(int i = 0; i < N-1; ++i)
    {
        for(int j = i+1; j < N; ++j)
        {
            ll g;
            g = euclidean_gcd(a[i],a[j]);
            if(g != 1)
            {
                pcFlg = false;
                break;
            }
        }
    }

    if(pcFlg)
    {
        cout << pc << endl;
        return 0;
    }

    ll gc = euclidean_gcd(a[0],a[1]);

    for(int i = 2; i < N; ++i)
    {
        gc = euclidean_gcd(gc,a[i]);
    }

    if(gc == 1)
    {
        cout << sc << endl;
        return 0;
    }

    cout << nc << endl;
    return 0;
}

int main()
{
    solve();
    return 0;
}


Compiler output:
a.cc: In function 'int solve()':
a.cc:40:5: error: 'cnt' was not declared in this scope; did you mean 'int'?
   40 |     cnt =
      |     ^~~
      |     int
a.cc:13:19: error: expected primary-expression before 'for'
   13 | #define REP(i, n) for (long long i = 0; i < (n); i++)
      |                   ^~~
a.cc:41:5: note: in expansion of macro 'REP'
   41 |     REP(i,N)
      |     ^~~
a.cc:41:9: error: 'i' was not declared in this scope
   41 |     REP(i,N)
      |         ^
a.cc:13:41: note: in definition of macro 'REP'
   13 | #define REP(i, n) for (long long i = 0; i < (n); i++)
      |                                         ^
Language: C++

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

typedef pair<int, int> P;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define mp make_pair
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

int N;

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

  cin >> N;
  vector<int> A(N);
  int a = 0;
  rep(i, N) {
    cin >> A[i];
    a = max(a, A[i]);
  }
  vector<int> prime;
  vector<bool> is_prime(a+1);
  vector<int> D(a+1);
  D[1] = 1;
  int b1 = 0;
  int b2 = 0;
  b1 = A[N-1];
  rep(i, N-1) {
    b1 = gcd(b1, A[i]);
  }
  if (b1 != 1)
    cout << "not coprime" << endl;

  int p = 0;
  for (int i = 0; i <= a; i++)
    is_prime[i] = true;
  is_prime[0] = is_prime[1] = false;
  for (int i = 0; i <= a; i++) {
    if (is_prime[i]) {
      prime.push_back(i);
      D[i] = i;
      p++;
      for (int j = 2 * i; j <= a; j+=i) {
        if (is_prime[j])
          D[j] = i;
        is_prime[j] = false;
      }
    }
  }
  // rep(i, a+1) {
  //   cout << D[i] << endl;
  // }
  vector<set<int>> s(a+1);
  rep (i, N) {
    int a2 = A[i];
    while(1) {
      if (a2 == D[a2]) {
        S[D[a2]].insert(A[i]);
        break;
      }
      else {
        s[D[a2]].insert(A[i]);
        a2 /= D[a2];
      }
    }
  }
  rep(i, a+1) {
    // cout << s[i].size() << endl;
    if (s[i].size() >= 2) {
      b2 = 1;
    }
  }
  if (b1 == 1 && b2 == 1)
    cout << "setwise coprime" << endl;
  if (b2 != 1)
    cout << "pairwise coprime" << endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:70:9: error: 'S' was not declared in this scope
   70 |         S[D[a2]].insert(A[i]);
      |         ^
Language: C++

#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <ctype.h>
#include <stdbool.h>
#include <assert.h>
#include <unordered_set>
 
struct Vector {
    int size, lastptr, *array;
};
void init(struct Vector* vector, int n) {
    vector->array = (int *) calloc (n, sizeof(int));
    vector->size = n;
    vector->lastptr = 0;
    assert(vector->array && "init broken");
}
void resize(struct Vector* vector) {
    vector->array = (int *) realloc(vector->array, 2*vector->size);
    vector->size *= 2;
}
void push_back(struct Vector* vector, int a) {
    if (vector->lastptr == vector->size) {
        resize(vector);
        push_back(vector, a);
    } else {
        vector->array[vector->lastptr++] = a;
    }
}
//void delete(struct Vector* vector) {free(vector->array);}
int gcd(int a, int b) {if (b == 0) {return a;}return gcd(b, a%b);}
 
bool pairwise=true, setwise=false;
int pot[1000001], N, arr[1000000];
bool vis[1000001];
bool chk[1000001];
void sieve() {
    int i, j;
    pot[0]=1;
    pot[1]=1;
    for (i=2; i <= 1000000; i+=2) {
        pot[i] = 2;
    }
    for (i=3; i <= 1000000; i+=2) {
        if (!pot[i]) {
            for (j=1; i*j <= 1000000; j++) {
                if (!pot[i*j]) {
                    pot[i*j] = i;
                }
            }
        }
    }
}
int main(void) {
    sieve();
    scanf("%d", &N);
    int i;
    for (i=0; i < N; ++i) {
        scanf("%d", arr+i);
    }
    int pairgcd = gcd(arr[0], arr[1]);
    for (i=2; i < N; i++) {
        pairgcd = gcd(pairgcd, arr[i]);
    }
    if (pairgcd == 1) setwise=true;
    //struct Vector vec[N];
    std::unordered_set<int> st[N];
    for (i=0; i < N; i++) {
        int x = *(arr+i);
        memset(chk, false, sizeof(chk));
        //init(&vec[i], 1000001);
        while(x > 1) {
            st.insert(pot[x]);
            x /= pot[x];
        }
        int j=0;
        /*for (j=0; j < vec[i].lastptr; j++) {
            if (vis[vec[i].array[j]]) {
                pairwise = false;
            }
            vis[vec[i].array[j]] = true;
        }*/
      	for (int &num: st[i]) {
          if (vis[num]) {
            pairwise=false;
          }
          vis[num] = true;
        }
        //delete(&vec[i]);
    }
    if (pairwise) {
        printf("pairwise coprime\n");
    } else if (setwise) {
        printf("setwise coprime\n");
    } else {
        printf("not coprime\n");
    }
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:74:16: error: request for member 'insert' in 'st', which is of non-class type 'std::unordered_set<int> [N]'
   74 |             st.insert(pot[x]);
      |                ^~~~~~
a.cc:84:28: error: binding reference of type 'int&' to 'const int' discards qualifiers
   84 |         for (int &num: st[i]) {
      |                            ^
Language: C++

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

#define int long long int

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

int p[1000001];
 
void go(){
    for( int i = 2; i*i <= 1000000; i++ ){
        if( p[i] == 0 ){
            for( int j = i; j <= 1000000; j += i ){
                if( p[j] == 0 ){
                    p[j] = i;
                }
            }
        }
    }
    for( int i = 1; i <= 1000000; i++ ){
        if( p[i] == 0 )p[i] = i;
    }
}

int main(){
    go();
    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

    int n;
    cin >> n;
    int ar[n];
    for( int i = 0; i < n; i++ ){
        cin >> ar[i];
    }
    map<int,int> cnt;
    for( int i = 0; i < n; i++ ){
        int num = ar[i];
        while( num > 1 ){
            int d = p[num];
            cnt[d]++;
            while( num % d == 0 ){
                num /= d;
            }
        }
    }
    int flag = 1;
    for( auto it : cnt ){
        if( it.second > 1 ){
            flag = 0;
        }
    }
    if( flag ){
        cout << "pairwise coprime";
    }
    else{
        int gc = ar[0];
        for( int i = 1; i < n; i++ ){
            gc = gcd(gc, ar[i]);
        }
        if( gc == 1 ){
            cout << "setwise coprime";
        }
        else{
            cout << "not coprime";
        }
    }
}

Compiler output:
a.cc:4:23: error: '::main' must return 'int'
    4 | #define int long long int
      |                       ^~~
a.cc:29:1: note: in expansion of macro 'int'
   29 | int main(){
      | ^~~
Language: C++

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

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

int main() {
	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

	int n;
	cin >> n;
	vector<int> arr(n);
	for(int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	map<int, int> cnt;
	for(int i = 0; i < n; i++) {
		int num = arr[i];
		if(num > 1) {
			int d = primes[num];
			cnt[d] += 1;
			while(num % d == 0) num /= d;
		}
	}
	int flag = 1;
	for(auto it : cnt) {
		if(it.second > 1) flag = 0;
	}
	if(flag) cout << "pairwise coprime";
	else {
		int gc = arr[0];
		for(int i = 1; i < n; i++) {
			gc = gcd(gc, arr[i]);
		}
		if(gc == 1) cout << "setwise coprime";
		else cout << "not coprime";
	}
	return 0;
}

Compiler output:
a.cc:4:1: error: 'll' does not name a type
    4 | ll gcd(ll a, ll b) {
      | ^~
a.cc: In function 'int main()':
a.cc:30:33: error: 'primes' was not declared in this scope
   30 |                         int d = primes[num];
      |                                 ^~~~~~
Language: Java

import java.io.*;
import java.util.*;

public class EE {
    static int[] factorCnts;
    static boolean checkCoprime = true;

    public static void factorise(int num) {
        if (!checkCoprime)
            return;
        for (int i = 1; i * i <= num; i++) {
            if (num % i == 0) {
                int a = i;
                int b = num / i;
                if (a == b)
                    b = 1;
                if (a != 1) {
                    if (factorCnts[a] == 1) {
                        checkCoprime = false;
                        return;
                    }
                    factorCnts[a]++;
                }
                if (b != 1) {
                    if (factorCnts[b] == 1) {
                        checkCoprime = false;
                        return;
                    }
                    factorCnts[b]++;
                }
            }
        }
    }

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

    public static void main(String[] args) throws Exception {
        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(buffer.readLine());
        String[] inp = buffer.readLine().split(" ");
        int[] arr = new int[n];
        arr[0] = Integer.parseInt(inp[0]);
        factorCnts = new int[1000001];
        int gcdRes = arr[0];
        for (int pos = 1; pos < n; pos++) {
            arr[pos] = Integer.parseInt(inp[pos]);
            gcdRes = gcd(gcdRes, arr[pos]);
        }
        for (int pos = 0; pos < n; pos++) {
            factorise(arr[pos]);
        }
        if (checkCoprime) {
            System.out.println("pairwise coprime");
        } else if (gcdRes == 1)
            System.out.println("setwise coprime");
        else
            System.out.println("not coprime");
    }
}


Compiler output:
Main.java:4: error: class EE is public, should be declared in a file named EE.java
public class EE {
       ^
1 error
Language: Java

import java.io.*;
import java.util.*;

public class EE {
    public static int gcd(int a, int b){
        if (a==0)
            return b;
        return gcd(b%a, a);
    }
    public static void main(String[] args) throws Exception {
        BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();
        int n = Integer.parseInt(buffer.readLine());
        String [] inp = buffer.readLine().split(" ");
        int [] arr = new int[n];
        int gcdRes = Integer.parseInt(inp[0]);
        for (int pos = 0; pos < n; pos++) {
            arr[pos] = Integer.parseInt(inp[pos]);
            gcdRes = gcd(gcdRes, arr[pos]);
        }

        int [] factorCnts = new int[10000000];
        boolean checkCoprime = true;
        for (int pos = 0; pos < n; pos++) {
            for (int fact = 2; fact*fact < arr[pos]; fact++) {
                if (arr[pos]%fact==0) {
                    factorCnts[fact]++;
                    if (arr[pos]/fact!=fact)
                        factorCnts[arr[pos]/fact]++;
                }
                if (factorCnts[fact]>=2){
                    checkCoprime = false;
                    break;
                }
            }
            if (!checkCoprime)
                break;
        }
        if (checkCoprime){
            System.out.println("pairwise coprime");
        }
        else if (gcdRes==1)
            System.out.println("setwise coprime");
        else
            System.out.println("not coprime");
    }
}


Compiler output:
Main.java:4: error: class EE is public, should be declared in a file named EE.java
public class EE {
       ^
1 error
Language: C++

#include <iostream> 
#include <algorithm> 
int fact[1000008] ={0};
int status = false;
using namespace std;
void facti(int n)
{
    for(int i=2;i*i<=n;i++)
    {
        if(status == true)
        {
            return;
        }
        if(n%i==0)
        {
            int a = n/i;
            int b= n/a;
            if(a!=b)
            {
                if(fact[a])
                {
                    status = true;
                    return;
                }
                fact[a]++;
                if(fact[b])
                {
                    status = true;
                    return;
                }
                fact[b]++;
            }
            else
            {
                if(fact[a])
                {
                    status = true;
                    return;
                }
                fact[a]++;
            }
        }
    }
}
int main()
{
    int n;cin>>n;
    int arr[n+1];
    for(int i =0;i<n;i++)
    {
        cin>>arr[i];
    }
    //finding setwise gcd;
    int gcdans = arr[0];
    facti(arr[0]);
    for(int i=1;i<n;i++)
    {
        facti(arr[i]);
        gcdans = __gcd(arr[i],gcdans);
    }
    
    if(status==false)
    {
        cout<<"pairwise coprime\n";
    }
    else if(gcdans==1)
    {
       cout<<"setwise coprime\n"
    }
    else
    {
        cout<<"not coprime\n";
    }

    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:68:33: error: expected ';' before '}' token
   68 |        cout<<"setwise coprime\n"
      |                                 ^
      |                                 ;
   69 |     }
      |     ~
Language: C++

//bayemirov
#include <bits/stdc++.h>

using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;

#define pb push_back

const int N = 2e6;

int lp[N], a[N], gcd;
vector<int> p;
bool was[N];

bool factorize(int x, bool pairwise = 1) {
	vector<int> f;
	while (x > 1) {
		if (was[lp[x]]) pairwise = 0;
		f.pb(lp[x]);
		x /= lp[x];
	}
	for (auto x : f) was[x] = 1;
	return pairwise;
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
   for (int i = 2; i < N; i++) {
   	if (lp[i] == 0) {
   		lp[i] = i;
   		p.pb(i);
   	}
   	for (int j = 0; j < (int) p.size() && p[j] <= lp[i] && p[j] * i < N; j++)
   		lp[p[j] * i] = p[j];
   }
   int n;
   cin >> n;
   for (int i = 1; i <= n; i++) {
   	cin >> a[i];
   	gcd = __gcd(gcd, a[i]);
   }
   if (gcd != 1) cout << "not coprime", exit(0);
   for (int i = n; i; i--) 
   	if (factorize(a[i]) && i != n) 
   	 cout << "pairwise coprime", exit(0);
   cout << "setwise coprime";
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:9: error: reference to 'gcd' is ambiguous
   44 |         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:14:18: note:                 'int gcd'
   14 | int lp[N], a[N], gcd;
      |                  ^~~
a.cc:44:21: error: reference to 'gcd' is ambiguous
   44 |         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:14:18: note:                 'int gcd'
   14 | int lp[N], a[N], gcd;
      |                  ^~~
a.cc:46:8: error: reference to 'gcd' is ambiguous
   46 |    if (gcd != 1) cout << "not coprime", exit(0);
      |        ^~~
/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:14:18: note:                 'int gcd'
   14 | int lp[N], a[N], gcd;
      |                  ^~~
Language: C++

//bayemirov
#include <bits/stdc++.h>

using namespace std;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef long long ll;

#define pb push_back

const int N = 2e6;

int lp[N], a[N], gcd;
vector<int> p;
bool was[N];

bool factorize(int x, bool pairwise = 1) {
	vector<int> f;
	while (x > 1) {
		if (was[lp[x]]) pairwise = 0;
		f.pb(lp[x]);
		x /= lp[x];
	}
	for (auto x : f) was[x] = 1;
	return pairwise;
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
   for (int i = 2; i < N; i++) {
   	if (lp[i] == 0) {
   		lp[i] = i;
   		p.pb(i);
   	}
   	for (int j = 0; j < p.size() && p[j] <= lp[i] && p[j] * i < N; j++)
   		lp[p[j] * i] = p[j];
   }
   int n;
   cin >> n;
   for (int i = 1; i <= n; i++) {
   	cin >> a[i];
   	gcd = __gcd(gcd, a[i]);
   }
   if (gcd != 1) cout << "not coprime", exit(0);
   for (int i = n; i; i--) 
   	if (factorize(a[i]) && i != n) 
   	 cout << "pairwise coprime", exit(0);
   cout << "setwise coprime";
   return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:44:9: error: reference to 'gcd' is ambiguous
   44 |         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:14:18: note:                 'int gcd'
   14 | int lp[N], a[N], gcd;
      |                  ^~~
a.cc:44:21: error: reference to 'gcd' is ambiguous
   44 |         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:14:18: note:                 'int gcd'
   14 | int lp[N], a[N], gcd;
      |                  ^~~
a.cc:46:8: error: reference to 'gcd' is ambiguous
   46 |    if (gcd != 1) cout << "not coprime", exit(0);
      |        ^~~
/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:14:18: note:                 'int gcd'
   14 | int lp[N], a[N], gcd;
      |                  ^~~
Language: Java

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
import java.util.*;
/**
 *
 * @author ujjwal abhishek
 */
public class E 
{
    static int gcd(int a, int b) 
    { 
        if (a == 0) 
            return b; 
        return gcd(b % a, a); 
    } 
    static int max = (int)(1e6+1);
    static int[] spf = new int[max];
    static void solve()
    {
        spf[1] = 1;
        for(int i=2;i<max;i++)
        {
            spf[i] = i;
        }
        for(int i=4;i<max;i+=2)
        {
            spf[i] = 2;
        }
        for(int i=3;i*i<max;i++)
        {
            if(spf[i]==i)
            {
                for(int j=i*i;j<max;j+=i)
                {
                    if(spf[j]==j)
                        spf[j] = i;
                }
            }
        }
    }
    public static boolean isPairwise(int[] arr,int n)
    {
        Set<Integer> set = new HashSet<>();
        for(int x:arr)
        {
            Set<Integer> list = new HashSet<>(factors(x));
            for(int y:list)
            {
                if(set.contains(y))
                    return false;
                else
                    set.add(y);
            }
        }
        return true;
    }
    public static List<Integer> factors(int x)
    {
        List<Integer> res = new ArrayList<>();
        while(x!=1)
        {
            res.add(spf[x]);
            x/=spf[x];
        }
        return res;
    }
    public static void main(String []args)
    {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int[] arr=new int[n];
        for (int i=0;i<n;i++) arr[i]=sc.nextInt();
        int gcd=gcd(arr[0],arr[1]);
        for (int i=1;i<n;i++) gcd(gcd,arr[i]);
        if (gcd==1)
        {
            solve();
            if (isPairwise(arr,n))
                System.out.println("pairwise coprime");
            else
                System.out.println("setwise coprime");
        }
        else
            System.out.println("not coprime");
    }
}


Compiler output:
Main.java:11: error: class E is public, should be declared in a file named E.java
public class E 
       ^
1 error
Language: C++

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 100000000;
#define rep1(i, n) for (ll i=0; i<(n); i++) 
#define rep2(i, k, n) for (ll i=k; i<(n); i++)
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; }

map<ll, ll> m;
ll cnt=0, n, a;

void prime_factorize(ll N) {
    bool flag = true;
    for (long long a = 2; a * a <= N; ++a) {
        if (N % a != 0) continue;
        long long ex = 0; // 指数

        // 割れる限り割り続ける
        while (N % a == 0) {
            ++ex;
            N /= a;
        }
        if (m[a]!=0) flag = false;
        m[a]++;
    }
    if (flag) cnt++;
}

int main() {
    cin >> n;
    vector<ll> a(n);
    cnt = 0;
    rep1(i, n){
        cin >> a[i];
        prime_factorize(a[i]);
    }
    cout << "pairwise coprime" << endl;
    
    //cout << "setwise coprime" << endl;
    //cout << "not coprime" << endl;
    }
    //printf("%.12f", ans);
}

Compiler output:
a.cc:45:1: error: expected declaration before '}' token
   45 | }
      | ^
Language: C++

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

const int mn=1e6+7;
int p[mn],n;
bool np[mn],vis[mn];

void get_prime()
{
    for(int i=2;i<mn;++i) {
        if(!np[i]) p[++p[0]]=i;
        for(int j=1;j<=p[0]&&i*p[j]<mn;++j) {
            np[i*p[j]]=1;
            if(i%p[j]==0) break;
        }
    }
}

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

int main()
{
    get_prime();
    scanf("%d",&n);
    int a,g=0;
    for(int i=1;i<=n;++i) {
        scanf("%d",&a);
        g=gcd(a,g);
        vis[a]++;
    }
    int flag=1;
    for(int i=1;i<=p[0];++i) {
        int t=mn/p[i],cnt=0;
        for(int j=1;j<=t;++j) cnt+=vis[p[i]*j];
        if(cnt>1) flag=0;
    }
    if(flag) {puts("pairwise coprime");return 0;}
    if(g==1) puts("setwise coprime");
    else puts("not coprime");
    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:32:14: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
   32 |         vis[a]++;
      |         ~~~~~^