Language: C++

#include<bits/stdc++.h>
#define ll long long int
#define pragi(a,b) for(ll i = a;i<b;i++)
#define pragj(a,b) for(ll j = a;j<b;j++)
#define pragk(a,b) for(ll k = a;k>=b;k--)
#define all(v) (v.begin(),v.end())
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define MP make_pair
#define MT make_tuple
#define F first
#define S second
#define KAKA ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const int mod = 1e9 + 7;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef long double ld;
typedef pair<int, int> pii;
//typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef pair<ll, ll> pll;

void Compute(ll n)
{
    KAKA
    vector<ll,bool> present(10000001,false);
    vector<ll> freq(10000001,0);
    vector<ll> v(n);
    pragi(0,n)
    {
        cin>>v[i];
        present[v[i]] = true;
        freq[v[i]]++;
    }
    bool fg = false;
    pragi(0,n)
    {
        if(freq[v[i]] == n)
        {
          fg = true;
          break;
        }
    }
    ll cnt = 0;
    if(fg) cout<<0<<"\n";
    else{
    if(present[1] and (freq[1] == 1)) cout<<1<<"\n";
    else if(present[1]) cout<<0<<"\n";
    else{
    pragi(0,n)
    {
        ll ele = v[i];
        bool flag = true;
        vl factors;
        for(ll j = 2;(j * j) <= ele;j++)
        {
            if((ele % j) == 0)
            {
               factors.eb(j);
               if(j != (ele / j))
               factors.eb(ele/j);
            }
        }
        for(auto f : factors)
        {
            if(present[f])
            {
                flag = false;
                break;
            }
        }
        if((flag) and (freq[ele] > 1))
        {
            flag = false;
        }
        if(flag) cnt++;
    }
    cout<<cnt<<"\n";
    }}
}
int main()
{
    KAKA
    ll n;
    cin>>n;
    Compute(n);
}


Compiler output:
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:53,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'struct std::_Vector_base<long long int, bool>':
/usr/include/c++/14/bits/stl_vector.h:428:11:   required from 'class std::vector<long long int, bool>'
  428 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
a.cc:33:28:   required from here
   33 |     vector<ll,bool> present(10000001,false);
      |                            ^
/usr/include/c++/14/bits/stl_vector.h:87:28: error: 'bool' is not a class, struct, or union type
   87 |         rebind<_Tp>::other _Tp_alloc_type;
      |                            ^~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:89:9: error: 'bool' is not a class, struct, or union type
   89 |         pointer;
      |         ^~~~~~~
/usr/include/c++/14/bits/stl_vector.h: In instantiation of 'class std::vector<long long int, bool>':
a.cc:33:28:   required from here
   33 |     vector<ll,bool> present(10000001,false);
      |                            ^
/usr/include/c++/14/bits/stl_vector.h:518:20: error: '_M_allocate' has not been declared in 'std::vector<long long int, bool>::_Base'
  518 |       using _Base::_M_allocate;
      |                    ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:519:20: error: '_M_deallocate' has not been declared in 'std::vector<long long int, bool>::_Base'
  519 |       using _Base::_M_deallocate;
      |                    ^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:521:20: error: '_M_get_Tp_allocator' has not been declared in 'std::vector<long long int, bool>::_Base'
  521 |       using _Base::_M_get_Tp_allocator;
      |                    ^~~~~~~~~~~~~~~~~~~
a.cc: In function 'void Compute(long long int)':
a.cc:39:16: error: no match for 'operator[]' (operand types are 'std::vector<long long int, bool>' and '__gnu_cxx::__alloc_traits<std::allocator<long long int>, long long int>::value_type' {aka 'long long int'})
   39 |         present[v[i]] = true;
      |                ^
a.cc:54:15: error: no match for 'operator[]' (operand types are 'std::vector<long long int, bool>' and 'int')
   54 |     if(present[1] and (freq[1] == 1)) cout<<1<<"\n";
      |               ^
a.cc:55:20: error: no match for 'operator[]' (operand types are 'std::vector<long long int, bool>' and 'int')
   55 |     else if(present[1]) cout<<0<<"\n";
      |                    ^
a.cc:73:23: error: no match for 'operator[]' (operand types are 'std::vector<long long int, bool>' and 'long long int')
   73 |             if(present[f])
      |                       ^