Language: C++

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

template<class T> inline bool chmin(T& a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

template<class T> inline bool chmax(T& a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
struct Unionfind {
    vector<int> par;

    Unionfind(int n) : par(n) {
        for(int i = 0; i < n; ++i) par[i] = i;
    }

    int root(int x) {
        if(par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if(rx == ry) return;
        par[rx] =ry;
    }

    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

    int n;
    cin >> n;

    const int num = 1000000;
    vector<int> cnt(num+1, 0);
    vector<int> a(n);

    rep(i, n) {
        cin >> a[i];
        if(cnt[a[i]] != 0) {
            cnt[a[i]] = 10;
            continue;
        }
        for(int j = a[i]; j <= num; j += a[i]) ++cnt[a[i]];
    }

    int ans = 0;
    rep(i, n) {
        if(cnt[a[i]] == 1) ++ans;
    }
    cout << ans << endl;
    return 0;
}

Compiler output:
a.cc:1:1: error: extended character ¥ is not valid in an identifier
    1 | ¥#include <bits/stdc++.h>
      | ^
a.cc:1:2: error: stray '#' in program
    1 | ¥#include <bits/stdc++.h>
      |  ^
a.cc:1:1: error: '\U000000a5' does not name a type
    1 | ¥#include <bits/stdc++.h>
      | ^
a.cc:22:5: error: 'vector' does not name a type
   22 |     vector<int> par;
      |     ^~~~~~
a.cc: In constructor 'Unionfind::Unionfind(int)':
a.cc:24:24: error: class 'Unionfind' does not have any field named 'par'
   24 |     Unionfind(int n) : par(n) {
      |                        ^~~
a.cc:25:36: error: 'par' was not declared in this scope
   25 |         for(int i = 0; i < n; ++i) par[i] = i;
      |                                    ^~~
a.cc: In member function 'int Unionfind::root(int)':
a.cc:29:12: error: 'par' was not declared in this scope
   29 |         if(par[x] == x) return x;
      |            ^~~
a.cc:30:16: error: 'par' was not declared in this scope
   30 |         return par[x] = root(par[x]);
      |                ^~~
a.cc: In member function 'void Unionfind::unite(int, int)':
a.cc:37:9: error: 'par' was not declared in this scope
   37 |         par[rx] =ry;
      |         ^~~
a.cc: In function 'int main()':
a.cc:48:5: error: 'cin' was not declared in this scope
   48 |     cin.tie(nullptr);
      |     ^~~
a.cc:49:5: error: 'ios_base' has not been declared
   49 |     ios_base::sync_with_stdio(false);
      |     ^~~~~~~~
a.cc:55:5: error: 'vector' was not declared in this scope
   55 |     vector<int> cnt(num+1, 0);
      |     ^~~~~~
a.cc:55:12: error: expected primary-expression before 'int'
   55 |     vector<int> cnt(num+1, 0);
      |            ^~~
a.cc:56:12: error: expected primary-expression before 'int'
   56 |     vector<int> a(n);
      |            ^~~
a.cc:59:16: error: 'a' was not declared in this scope
   59 |         cin >> a[i];
      |                ^
a.cc:60:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   60 |         if(cnt[a[i]] != 0) {
      |            ^~~
      |            int
a.cc:64:50: error: 'cnt' was not declared in this scope; did you mean 'int'?
   64 |         for(int j = a[i]; j <= num; j += a[i]) ++cnt[a[i]];
      |                                                  ^~~
      |                                                  int
a.cc:69:12: error: 'cnt' was not declared in this scope; did you mean 'int'?
   69 |         if(cnt[a[i]] == 1) ++ans;
      |            ^~~
      |            int
a.cc:69:16: error: 'a' was not declared in this scope
   69 |         if(cnt[a[i]] == 1) ++ans;
      |                ^
a.cc:71:5: error: 'cout' was not declared in this scope
   71 |     cout << ans << endl;
      |     ^~~~
a.cc:71:20: error: 'endl' was not declared in this scope
   71 |     cout << ans << endl;
      |                    ^~~~