Language: C++

	#include <bits/stdc++.h>
#include<string.h>
#define ll long long 
#include<vector>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const int mod=1e9+7; 
const int max_n=1000006;
bool vis[1000006];
bool sieve[1000006];
void build_sieve(int i){
	
	if(vis[i])
	return;
	if(sieve[i]==false)
	return;
	vis[i]=true;
    
	int start=2*i;
	for(int j=start;j<=max_n;j+=i)
	{
		
		sieve[j]=false;
		
	}
}
void find_factors(int n){
	
	for(int i=2;i*i<=n;i++){
		if(n%i==0){
			build_sieve(i);
		    while(n%i==0){
		    	n/=i;
			}
		}
	}
	if(n!=1)
	{
	
	build_sieve(n);}
}
int main(){

	memset(sieve, true, sizeof(sieve));
	memset(vis,false, sizeof(vis));
	bool pair_wise=true;
	bool set_wise=true;
	int n;
	cin>>n;
	vector<int> a(n);
	for(int i=0;i<n;i++)
	cin>>a[i];
	
	for(int i=0;i<n;i++){
	if(a[i]==1)
	continue;
	if(sieve[a[i]]==false){
		//cout<<vis[i]<<sieve[i];
		pair_wise=false;
	}
	
	else{
	
		find_factors(a[i]);
	}
}

    int overall_gcd=0;
    for(int i=0;i<n;i++){
    	overall_gcd=__gcd(overall_gcd,a[i]);
    	if(overall_gcd==1)
    	break;
	}
	if(overall_gcd!=1)
	set_wise=false;
	if(pair_wise==true)
	cout<<"pairwise coprime";
	else if(set_wise==true)
	cout<<"setwise coprime";
	else
	cout<<"not coprime";

}
	
	if(sieve[i]==false)
	return;
	vis[i]=true;
    
	int start=2*i;
	for(int j=start;j<=max_n;j+=i)
	{
		
		sieve[j]=false;
		
	}
}
void find_factors(int n){
	
	for(int i=2;i*i<=n;i++){
		if(n%i==0){
			build_sieve(i);
		    while(n%i==0){
		    	n/=i;
			}
		}
	}
	if(n!=1)
	{
	
	build_sieve(n);}
}
int main(){

	memset(sieve, true, sizeof(sieve));
	memset(vis,false, sizeof(vis));
	bool pair_wise=true;
	bool set_wise=true;
	int n;
	cin>>n;
	vector<int> a(n);
	for(int i=0;i<n;i++)
	cin>>a[i];
	
	for(int i=0;i<n;i++){
	if(a[i]==1)
	continue;
	if(sieve[a[i]]==false){
		//cout<<vis[i]<<sieve[i];
		pair_wise=false;
	}
	
	else{
	
		find_factors(a[i]);
	}
}

    int overall_gcd=0;
    for(int i=0;i<n;i++){
    	overall_gcd=__gcd(overall_gcd,a[i]);
    	if(overall_gcd==1)
    	break;
	}
	if(overall_gcd!=1)
	set_wise=false;
	if(pair_wise==true)
	cout<<"pairwise coprime";
	else if(set_wise==true)
	cout<<"setwise coprime";
	else
	cout<<"not coprime";

}

Compiler output:
a.cc:85:9: error: expected unqualified-id before 'if'
   85 |         if(sieve[i]==false)
      |         ^~
a.cc:87:9: error: 'vis' does not name a type
   87 |         vis[i]=true;
      |         ^~~
a.cc:89:21: error: 'i' was not declared in this scope
   89 |         int start=2*i;
      |                     ^
a.cc:90:9: error: expected unqualified-id before 'for'
   90 |         for(int j=start;j<=max_n;j+=i)
      |         ^~~
a.cc:90:25: error: 'j' does not name a type
   90 |         for(int j=start;j<=max_n;j+=i)
      |                         ^
a.cc:90:34: error: 'j' does not name a type
   90 |         for(int j=start;j<=max_n;j+=i)
      |                                  ^
a.cc:96:1: error: expected declaration before '}' token
   96 | }
      | ^
a.cc:97:6: error: redefinition of 'void find_factors(int)'
   97 | void find_factors(int n){
      |      ^~~~~~~~~~~~
a.cc:27:6: note: 'void find_factors(int)' previously defined here
   27 | void find_factors(int n){
      |      ^~~~~~~~~~~~
a.cc:112:5: error: redefinition of 'int main()'
  112 | int main(){
      |     ^~~~
a.cc:42:5: note: 'int main()' previously defined here
   42 | int main(){
      |     ^~~~