Language: C++

// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
 
#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif
 
// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
 
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
 
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
#define REP(i,n) for(ll i=0; i<(n); i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define ALL(n) begin(n),end(n)
#define IN(a, x, b) (a<=x && x<b)
#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
template<class T> inline T CHMAX(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T CHMIN(T & a, const T b) { return a = (a > b) ? b : a; }
 
const long double EPS = 1e-10;
const long long INF = 1e18;
const long double PI = acos(-1.0L);
const long long MOD = 1000000007;
 
int main(void){
    ll n;
    vector <ll> input;
    cin >> n;
    REP(i,n){
        ll tmp;
        cin >> tmp;
        input.push_back(tmp);
    }
    bool dp[200010];
    REP(i, 200010){
        dp[i] = true;
    }
 
    sort(ALL(input));
 
    REP(i,n){
        ll pos = i+1;
        if(i>0){
            if(input[i]==input[i-1]){
                dp[i] = dp[i-1] = false;
            }
        }
        if(! dp[i] ){
            continue;
        }
        ll value = input[i]*2;
        while(true){
            while(value < input[pos]){
                value += input[i];
            }
            if(value == input[pos]){
                dp[pos] = false;
                pos++;
                value += input[i];
            }
            if(value > input[pos]){
                pos++;
            }
            if(pos >= n){
                break;
            }
        }
    }
        ll ans=0;
        REP(i,n){
            if(dp[i]){
                ans++;
            }
        }
        cout << ans << endl;
    return 0;
}
// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;
typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
#define REP(i,n) for(ll i=0; i<(n); i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define ALL(n) begin(n),end(n)
#define IN(a, x, b) (a<=x && x<b)
#define INIT std::ios::sync_with_stdio(false);std::cin.tie(0);
template<class T> inline T CHMAX(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T CHMIN(T & a, const T b) { return a = (a > b) ? b : a; }

const long double EPS = 1e-10;
const long long INF = 1e18;
const long double PI = acos(-1.0L);
const long long MOD = 1000000007;

int main(void){
    ll n;
    vector <ll> input;
    cin >> n;
    REP(i,n){
        ll tmp;
        cin >> tmp;
        input.push_back(tmp);
    }
    bool dp[200010];
    REP(i, 200010){
        dp[i] = true;
    }

    sort(ALL(input));

    REP(i,n){
        ll pos = i+1;
        if(i>0){
            if(input[i]==input[i-1]){
                dp[i] = dp[i-1] = false;
            }
        }
        if(! dp[i] ){
            continue;
        }
        ll value = input[i]*2;
        if(!dp[input[i]*2]){continue;}
        while(true){
            while(value < input[pos]){
                value += input[i];
            }
            if(value == input[pos]){
                dp[pos] = false;
                pos++;
                value += input[i];
            }
            if(value > input[pos]){
                pos++;
            }
            if(pos >= n){
                break;
            }
        }
    }
        ll ans=0;
        REP(i,n){
            if(dp[i]){
                ans++;
            }
        }
        cout << ans << endl;
    return 0;
}


Compiler output:
a.cc:258:28: error: redefinition of 'template<class T> T CHMAX(T&, T)'
  258 | template<class T> inline T CHMAX(T & a, const T b) { return a = (a < b) ? b : a; }
      |                            ^~~~~
a.cc:99:28: note: 'template<class T> T CHMAX(T&, T)' previously declared here
   99 | template<class T> inline T CHMAX(T & a, const T b) { return a = (a < b) ? b : a; }
      |                            ^~~~~
a.cc:259:28: error: redefinition of 'template<class T> T CHMIN(T&, T)'
  259 | template<class T> inline T CHMIN(T & a, const T b) { return a = (a > b) ? b : a; }
      |                            ^~~~~
a.cc:100:28: note: 'template<class T> T CHMIN(T&, T)' previously declared here
  100 | template<class T> inline T CHMIN(T & a, const T b) { return a = (a > b) ? b : a; }
      |                            ^~~~~
a.cc:261:19: error: redefinition of 'const long double EPS'
  261 | const long double EPS = 1e-10;
      |                   ^~~
a.cc:102:19: note: 'const long double EPS' previously defined here
  102 | const long double EPS = 1e-10;
      |                   ^~~
a.cc:262:17: error: redefinition of 'const long long int INF'
  262 | const long long INF = 1e18;
      |                 ^~~
a.cc:103:17: note: 'const long long int INF' previously defined here
  103 | const long long INF = 1e18;
      |                 ^~~
a.cc:263:19: error: redefinition of 'const long double PI'
  263 | const long double PI = acos(-1.0L);
      |                   ^~
a.cc:104:19: note: 'const long double PI' previously defined here
  104 | const long double PI = acos(-1.0L);
      |                   ^~
a.cc:264:17: error: redefinition of 'const long long int MOD'
  264 | const long long MOD = 1000000007;
      |                 ^~~
a.cc:105:17: note: 'const long long int MOD' previously defined here
  105 | const long long MOD = 1000000007;
      |                 ^~~
a.cc:266:5: error: redefinition of 'int main()'
  266 | int main(void){
      |     ^~~~
a.cc:107:5: note: 'int main()' previously defined here
  107 | int main(void){
      |     ^~~~