Language: C++

#include <bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define MOD (int)(1e9+7)
#define ceil(x, y) (x%y==0? (x/y) : (x/y+1))
#define FOR(i, N) for(int i = 0; i < N; ++i)
#define FOR1(i, N) for(int i = 1; i <= N; ++i)
#define vi vector <int>
#define pii pair <int, int>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mset(a, v) memset(a, v, sizeof(a))
#define all(v) (v).begin(), (v).end()
#define INF 2e9
#define EPS 1e-9
#define MAX 200009
#define int long long
void __print(int x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif
using namespace std;
bool chk(multiset<int>& st, int fac, int num){
	dbg(st);
	dbg(fac, num);
	if(fac == num) return st.count(fac) > 1;
	else{
		return (st.count(fac) > 0? true : false);
	}

}
int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
    	freopen("in.txt", "r", stdin);
    	freopen("out.txt", "w", stdout);
    #endif

	int T=1;
	//cin >> T;
	FOR1(tp, T)
	{
		//cout << "Case #" << tp << ": ";
		int n; cin >> n;
		unordered_multiset<int> st;
		FOR1(i, n){
			int x;
			cin >> x;
			st.insert(x);
		}
		int cnt = 0;
		for(int num : st){
			//cout << num << ":";
			bool f = false;
			for(int i = 1; i*i <= num; i++){
				if(num % i == 0){
					//cout << i << " " << num/i << " ";
					if(chk(st, i, num)){
						f = true;
						break;
					}
					if(i*i != num){
						if(chk(st, num/i, num)){
							f = true;
							break;
						}
					}
				}
			}
			//cout << '\n';
			if(f == false) {
				//cout << num << " ";
				cnt++;
			}
		}
		cout << cnt;
		cout<<'\n';
	}
	return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:81:48: error: invalid initialization of reference of type 'std::multiset<long long int>&' from expression of type 'std::unordered_multiset<long long int>'
   81 |                                         if(chk(st, i, num)){
      |                                                ^~
a.cc:45:25: note: in passing argument 1 of 'bool chk(std::multiset<long long int>&, long long int, long long int)'
   45 | bool chk(multiset<int>& st, int fac, int num){
      |          ~~~~~~~~~~~~~~~^~
a.cc:86:56: error: invalid initialization of reference of type 'std::multiset<long long int>&' from expression of type 'std::unordered_multiset<long long int>'
   86 |                                                 if(chk(st, num/i, num)){
      |                                                        ^~
a.cc:45:25: note: in passing argument 1 of 'bool chk(std::multiset<long long int>&, long long int, long long int)'
   45 | bool chk(multiset<int>& st, int fac, int num){
      |          ~~~~~~~~~~~~~~~^~