Language: C++

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define cvector vector<char>
#define svector vector<string>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define rep(i,n) for(ll i=0; i<n; ++i)
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,lim,r;cin>>n;
  lvector A(n);rep(i,n) cin>>A[i];
  set<ll> ng;
  sort(ALL(A));
  if(n==1) {print(1);return 0;}
  if(n>1&&A[0]==1) {
    if(A[1]==1) print(0);
    else print(1);
    return 0;
  }
  for(ll pos=0;pos<n;++pos) {
    if(pos>0&&A[pos]==A[pos-1]) {ng.insert(pos);continue;}
    if(pos<n-1&&A[pos]==A[pos+1]) {ng.insert(pos);continue;}
    lim=2*A[pos];
    while(lim<=A[n-1]) {
      r=lower_bound(ALL(A),lim)-A.begin();
      if(r!=pos&&A[r]==lim) ng.insert(r);
      lim+=A[pos]; 
    }
  }
  print(max(0ll,n-ng.size()));
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:39:12: error: no matching function for call to 'max(long long int, long long unsigned int)'
   39 |   print(max(0ll,n-ng.size()));
      |         ~~~^~~~~~~~~~~~~~~~~
a.cc:14:27: note: in definition of macro 'print'
   14 | #define print(a) cout << (a) << endl
      |                           ^
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:39:12: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'long long unsigned int')
   39 |   print(max(0ll,n-ng.size()));
      |         ~~~^~~~~~~~~~~~~~~~~
a.cc:14:27: note: in definition of macro 'print'
   14 | #define print(a) cout << (a) << endl
      |                           ^
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:39:12: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   39 |   print(max(0ll,n-ng.size()));
      |         ~~~^~~~~~~~~~~~~~~~~
a.cc:14:27: note: in definition of macro 'print'
   14 | #define print(a) cout << (a) << endl
      |                           ^