Language: C++

//khodaya khodet komak kon
#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int N = 100000 + 10;
const ll MOD = 1000000000 + 7;
const ll INF = 1000000010;
const ll LOG = 25;

int mark[N], n;
ll a[N];
vector<ll> P, pr[N], ted[N];
map<ll, int>cnt, Com;


int32_t main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n;
	for (int i = 1; i <= n; i++) cin >> a[i];
	for (int i = 2; i < N; i++){
		if (!mark[i]){
			P.pb(i);
			for (int j = 2 * i; j < N; j += i){
				mark[j] = 1;
			}
		}
	}
	vector<ll> num;
	for (int i = 1; i <= n; i++){
		ll x = a[i];
		for (int j = 0; j < P.size(); j++){
			if (x < P[j]) break;
			if (x % P[j] == 0){
				int res = 0;
				while (x % P[j] == 0){
					x /= P[j];
					res++;
				}
				pr[i].pb(P[j]);
				ted[i].pb(res);
			}
		}
		if (x != 1){
			pr[i].pb(x);
			ted[i].pb(1);
		}
		ll res = 1;	
		ll res2 = 1;
		for (int j = 0; j < pr[i].size(); j++){
			ted[i][j] %= 3;
			if (ted[i][j] == 0) continue;
			for (int z = 1; z <= 3 - ted[i][j]; z++) res2 *= pr[i][j];
			for (int z = 1; z <= ted[i][j]; z++) res *= pr[i][j];
		}
		cnt[res]++;
		Com[res] = res2;
		if (res < res2) num.pb(res);
		else if (res2 < res) num.pb(res2);
	}
	int ans = 0;
	sort(all(num));
	num.resize(unique(all(num)) - num.begin());
	for (auto u:num){
		ans += max(cnt[u], cnt[Com[u]]);
	}
	ans += min(cnt[1], 1ll);
	cout << ans;







	return 0;
}


Compiler output:
a.cc: In function 'int32_t main()':
a.cc:77:19: error: no matching function for call to 'min(std::map<long long int, int>::mapped_type&, long long int)'
   77 |         ans += min(cnt[1], 1ll);
      |                ~~~^~~~~~~~~~~~~
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:2:
/usr/include/c++/14/bits/stl_algobase.h:233:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  233 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:233:5: note:   template argument deduction/substitution failed:
a.cc:77:19: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   77 |         ans += min(cnt[1], 1ll);
      |                ~~~^~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:281:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  281 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:281: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:5686:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(initializer_list<_Tp>)'
 5686 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5686:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5696:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(initializer_list<_Tp>, _Compare)'
 5696 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5696:5: note:   template argument deduction/substitution failed:
a.cc:77:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   77 |         ans += min(cnt[1], 1ll);
      |                ~~~^~~~~~~~~~~~~