Language: C++

#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll inf=1000000000000000000;
double pi=2*acos(0);
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll lmax(ll a,ll b){
    if(a<b)return b;
    else return a;
}
ll lmin(ll a,ll b){
    if(a<b)return a;
    else return b;
}
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
int main(){
    ios::sync_with_stdio(false);cin.tie(0);
    ll n;cin>>n;
    ll s[n];
    unordered_map<ll,ll> mp;
    vector<pll> vv;
    vector<ll> pri;
    bool uu[100001];
    fill(uu,uu+100001,false);
    rep(i,2,100001){
        if(uu[i])continue;
        pri.push_back(i);
        for(ll j=i;j<100001;j+=i)uu[j]=true;
    }
    rep(i,0,n){
        cin>>s[i];
        rep(j,0,pri.size()){
            ll now=pri[j];
            now=now*now*now;
            if(now>s[i])break;
            while(s[i]%now==0)s[i]/=now;
        }
    }
    unordered_map<ll,ll> hei;
    rep(i,0,pri.size()){
        hei[pri[i]*pri[i]]=pri[i];
    }
    ll ans=0;
    rep(i,0,n){
        
        ll ns=1;
        ll gy=1;
        rep(jj,0,pri.size()){
            ll j=pri[jj];
            if(j*j*j>10000000000)break;
            
            if(s[i]%j==0){
                ll sum=0;
                while(s[i]%j==0){
                    s[i]/=j;
                    sum++;
                }
                sum%=3;
                rep(k,0,sum)ns*=j;
                sum=3-sum;
                sum%=3;
                rep(k,0,sum)gy*=j;
            }
        }
        //cout<<ns<<" "<<s[i]<<endl;
        if(s[i]==1){
            s[i]=ns;
        mp[s[i]]++;
        vv.push_back({ns,gy});
            continue;
        }
        if(s[i]<=100000){
            ns=s[i]*ns;
            gy*=s[i]*s[i];
            s[i]=ns;
            mp[s[i]]++;
            vv.push_back({ns,gy});
            continue;
        }
        if(hei[s[i]]>0){
            ns=s[i]*ns;
            gy*=hei[s[i]];
            s[i]=ns;
            mp[s[i]]++;
            vv.push_back({ns,gy});
            continue;
        }
        ans++;
      // cout<<ns<<" "<<gy<<endl;
    }
    rep(i,0,vv.size()){
       / cout<<vv[i].first<<" "<<vv[i].second<<endl;
    }
    unordered_map<ll,bool> used;
    
    rep(i,0,vv.size()){
        pll p=vv[i];
        if(used[p.first])continue;
        if(p.first==1){
            ans++;
            used[1]=true;
        }
        else{
            ans+=max(mp[p.first],mp[p.second]);
            used[p.first]=true;
            used[p.second]=true;
        }
    }
    cout<<ans<<endl;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:125:8: error: expected primary-expression before '/' token
  125 |        / cout<<vv[i].first<<" "<<vv[i].second<<endl;
      |        ^