Language: C++

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const long long mod = 998244353;
const long long inf = 1ll << 61;
const double eps = 0.000000000001;
const long long A = 1000000000;
typedef pair<int, int> P;
typedef pair<P, int>PP;
struct edge { int to; int cost; };
int s[100005];
map<int, int>M,pa;

 int modpow( int x, int k, int m ){
    int res = 1;
    while( k ){
      if( k & 1 ){
        res = res * x % m;
      }
      k /= 2;
      x = x * x % m;
    }
    return res;
  }

int gcd(int a,int b){
    if(!b)return a;return gcd(b,a%b);
}
struct Miller{
    const int v[3]={2,7,61};
    bool check(int n){
        if(n<2)return false;
        int d=n-1;
        int s=0;
        while(d%2){
            d/=2;s++;
        }
        for(int a:v){
            if(a==n)return true;
            if(modpow(a,d,n)!=1){
                bool ok=rue;
                rep(r,s){
                    if(modpow(a,d*(1ll<<r),n)==n-1){
                        ok=false;break;
                    }
                }
                if(ok)return false;
            }
        }
        return true;
    }
};

struct Rho{
    mt19937 mt;
    Miller miller;
    int c;
    Rho(){
        mt.seed(clock());
    }
    inline int f(int x,int n){
        return (x*x+c)%n;
    }
    int check(int n){
        if(n==4)return 2;
        c=mt()%n;
        int x=mt()%n;
        int y=x;
        int d=1;
        while(d==1){
            x=f(x,n);
            y=f(f(y,n),n);
            d=gcd(abs(x-y),n);
        }
        if(d==n)return -1;
        return d;
    }
    vector<int>factor(int n){
        if(n<=1)return {};
        if(miller.check(n))return {n};
        int res=-1;
        while(res==-1){
            res=check(n);
        }
        vector<int>fa=factor(res);
        vector<int>fb=factor(n/res);
        fa.insert(fa.end(),fb.begin(),fb.end());
        return fa;
    }
};
Rho rho;

signed main() {
	int n; cin >> n;
	rep(i,n)cin >> s[i];
	rep(i, n) {//n*2300
		for (long long j = 2; j*j*j <= s[i]; j++) {
			int x = j*j*j;
			while (s[i] % x == 0)s[i] /= x;
		}
		M[s[i]]++;
	}
	for(auto itr1=M.begin();itr1!=M.end();itr1++) {
		int S = itr1->first;
		map<int, int>M1, M2;
		int cnt;
		for (int j = 2; j*j <= S; j++) {
			cnt = 3;
			while (S % j == 0) {
				M1[j]++;
				S /= j;
				cnt--;
			}
			if(cnt!=3)M2[j] = cnt;
		}
		if (S != 1) {
			M1[S]++;
			M2[S] = 2;
		}
		int now = 1;
		for (auto itr = M2.begin(); itr != M2.end(); itr++) {
			int t = itr->first, k = itr->second;
			if (k == 2)t = t*t;
			double keta = log10(now) + log10(t);
			if (keta >= 18.5) {
				now = -1;
				break;
			}
			now *= t;
		}
		pa[itr1->first] = now;
//		cout << now << endl;
	}
	int ans = 0;
	for (auto itr = M.begin(); itr != M.end(); itr++) {
		int x = itr->first;
		int y = itr->second;
		if (x == 1)ans += min(1ll,y);
		else if (y == 0)continue;
		else if (pa[x] == 0||pa[x]==-1)ans += y;
		else if (pa[x] == -3)continue;
		else {
			int pl = M[pa[x]];
			ans += max(y, pl);
			pa[pa[x]] = -3;
			pa[x] = -3;
		}
	}
	cout << ans << endl;
}


Compiler output:
a.cc: In member function 'bool Miller::check(long long int)':
a.cc:42:25: error: 'rue' was not declared in this scope
   42 |                 bool ok=rue;
      |                         ^~~