Language: C++

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


Compiler output:
a.cc: In function 'int main()':
a.cc:16:13: error: '__gcd' was not declared in this scope; did you mean '__gid_t'?
   16 |         d = __gcd(j, d);
      |             ^~~~~
      |             __gid_t
a.cc: At global scope:
a.cc:26:1: error: 'include' does not name a type
   26 | include <cstdio>
      | ^~~~~~~
a.cc:29:5: error: redefinition of 'int spf [1000001]'
   29 | int spf[N], u[N], s[17], d, i, j, k;
      |     ^~~
a.cc:4:5: note: 'int spf [1000001]' previously declared here
    4 | int spf[N], u[N], s[17], d, i, j, k;
      |     ^~~
a.cc:29:13: error: redefinition of 'int u [1000001]'
   29 | int spf[N], u[N], s[17], d, i, j, k;
      |             ^
a.cc:4:13: note: 'int u [1000001]' previously declared here
    4 | int spf[N], u[N], s[17], d, i, j, k;
      |             ^
a.cc:29:19: error: redefinition of 'int s [17]'
   29 | int spf[N], u[N], s[17], d, i, j, k;
      |                   ^
a.cc:4:19: note: 'int s [17]' previously declared here
    4 | int spf[N], u[N], s[17], d, i, j, k;
      |                   ^
a.cc:29:26: error: redefinition of 'int d'
   29 | int spf[N], u[N], s[17], d, i, j, k;
      |                          ^
a.cc:4:26: note: 'int d' previously declared here
    4 | int spf[N], u[N], s[17], d, i, j, k;
      |                          ^
a.cc:29:29: error: redefinition of 'int i'
   29 | int spf[N], u[N], s[17], d, i, j, k;
      |                             ^
a.cc:4:29: note: 'int i' previously declared here
    4 | int spf[N], u[N], s[17], d, i, j, k;
      |                             ^
a.cc:29:32: error: redefinition of 'int j'
   29 | int spf[N], u[N], s[17], d, i, j, k;
      |                                ^
a.cc:4:32: note: 'int j' previously declared here
    4 | int spf[N], u[N], s[17], d, i, j, k;
      |                                ^
a.cc:29:35: error: redefinition of 'int k'
   29 | int spf[N], u[N], s[17], d, i, j, k;
      |                                   ^
a.cc:4:35: note: 'int k' previously declared here
    4 | int spf[N], u[N], s[17], d, i, j, k;
      |                                   ^
a.cc:30:13: error: redefinition of 'const char* r'
   30 | char const* r = "pairwise";
      |             ^
a.cc:5:13: note: 'const char* r' previously defined here
    5 | char const* r = "pairwise";
      |             ^
a.cc:32:5: error: redefinition of 'int main()'
   32 | int main() {
      |     ^~~~
a.cc:7:5: note: 'int main()' previously defined here
    7 | int main() {
      |     ^~~~
a.cc: In function 'int main()':
a.cc:41:13: error: '__gcd' was not declared in this scope; did you mean '__gid_t'?
   41 |         d = __gcd(j, d);
      |             ^~~~~
      |             __gid_t