criyle/codenet-compile-errors huggingface dataset:
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<functional>
#include<map>
#include<unordered_set>
using namespace std;
long long p  = 998244353;
//long long p = 1000000007;
#define int long long
#define vel vector<long long>
#define vvel vector<vel>
#define rep(i,n) for(int i=0;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mmax(a,b) a=max(a,b)
#define mmin(a,b) a=min(a,b)
#define mkp make_pair
#define pin pair<int,int>
#define qin pair<int,pin>
#define V vector
#define Endl endl
#define veb vector<bool>
#define rev(s) reverse(s.begin(),s.end())
#define lower(h,val) lower_bound(h.begin(),h.end(),val)
#define upper(h,val) upper_bound(h.begin(),h.end(),val)
int max_kai = 150000;
vel kai(max_kai, 1);
vel inv_kai;
int rui(int a, int n) {
	if (n == 0) { return 1; }
	int x = rui(a, n / 2);
	x *= x; x %= p;
	if (n % 2 == 1) { x *= a; x %= p; }
	return x;
}
int inv(int a) { return rui(a, p - 2); }
void make_kai() {
	for (int i = 1; i < max_kai; i++) { kai[i] = kai[i - 1] * i; kai[i] %= p; }
	inv_kai = kai;
	rep(i, max_kai) { inv_kai[i] = inv(kai[i]); }
}
int nCr(int n, int r) {
	int a = kai[n] * inv_kai[r]; a %= p;
	a *= inv_kai[n - r]; a %= p;
	return a;
}
vel pa;
int root(int x) {
	if (pa[x] == -1) { return x; }
	int ans = root(pa[x]); pa[x] = ans;
	return ans;
}
void marge(int x, int y) {
	x = root(x);
	y = root(y);
	if (x != y) {pa[x] = y;}
}
#define end_s(a) cout <<a<<endl;return 0
int reve(int n,vel &p) {
	int a = 1, b = 1;
	for (int i = 0; p[i] * p[i] * p[i] <= n; i++) {
		if (n%p[i] == 0) {
			n /= p[i];
			if (n%p[i] == 0) { b *= p[i]; n /= p[i]; }
			else { a *= p[i]; }
		}
	}
	if (n != 1) {
		int m = sqrt(n);
		rep(i, 3) {
			if ((m - 1 + i)*(m - 1 + i) == n) { b *= (m-1+i); n = 1; }
		}
	}
	a *= n;
	if (a > 1000000) { return -1; }
	return a * a*b;
}
signed main(){
	int n; cin >> n;
	vel s(n);
	rep(i, n) {
		cin >> s[i];
		for (int j = 2; j*j*j <= s[i]; j++) {
			while (s[i] % (j*j*j) == 0) {
				s[i] /= (j*j*j);
			}
		}
	}
	sor(s);
	vel t(1, s[0]);
	rep(i, n - 1) {
		if (s[i + 1] != s[i]) { t.push_back(s[i+1]); }
	}
	int sz = t.size();
	vel co(sz);
	rep(i, sz) {
		co[i] = upper(s, t[i]) - lower(s, t[i]);
	}
	vel pr;
	for (int i = 2; i <= 3000; i++) {
		bool fl = true;
		for (int j = 2; j*j <= i; j++) {
			if (i%j == 0) { fl = false; }
		}
		if (fl) { pr.push_back(i); }
	}
	int ans = n;
	if (t[0] == 1) { ans -= (co[0] - 1); }
	rep(i, sz) {
		if (t[i] != 1) {
			int re1 = reve(t[i],pr);
			int ind = lower(t, re1)-t.begin();
			if (i<ind &&ind < sz) {
				if (re1 == t[ind]) {
					ans -= min(co[i], co[ind]);
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'long long int reve(long long int, std::vector<long long int>&)':
a.cc:74:25: error: 'sqrt' was not declared in this scope
   74 |                 int m = sqrt(n);
      |                         ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<functional>
#include<map>
#include<unordered_set>
using namespace std;
long long p  = 998244353;
//long long p = 1000000007;
#define int long long
#define vel vector<long long>
#define vvel vector<vel>
#define rep(i,n) for(int i=0;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mmax(a,b) a=max(a,b)
#define mmin(a,b) a=min(a,b)
#define mkp make_pair
#define pin pair<int,int>
#define qin pair<int,pin>
#define V vector
#define Endl endl
#define veb vector<bool>
#define rev(s) reverse(s.begin(),s.end())
#define lower(h,val) lower_bound(h.begin(),h.end(),val)
#define upper(h,val) upper_bound(h.begin(),h.end(),val)
int max_kai = 150000;
vel kai(max_kai, 1);
vel inv_kai;
int rui(int a, int n) {
	if (n == 0) { return 1; }
	int x = rui(a, n / 2);
	x *= x; x %= p;
	if (n % 2 == 1) { x *= a; x %= p; }
	return x;
}
int inv(int a) { return rui(a, p - 2); }
void make_kai() {
	for (int i = 1; i < max_kai; i++) { kai[i] = kai[i - 1] * i; kai[i] %= p; }
	inv_kai = kai;
	rep(i, max_kai) { inv_kai[i] = inv(kai[i]); }
}
int nCr(int n, int r) {
	int a = kai[n] * inv_kai[r]; a %= p;
	a *= inv_kai[n - r]; a %= p;
	return a;
}
vel pa;
int root(int x) {
	if (pa[x] == -1) { return x; }
	int ans = root(pa[x]); pa[x] = ans;
	return ans;
}
void marge(int x, int y) {
	x = root(x);
	y = root(y);
	if (x != y) {pa[x] = y;}
}
#define end_s(a) cout <<a<<endl;return 0
int reve(int n,vel &p) {
	int a = 1, b = 1;
	for (int i = 0; p[i] * p[i] * p[i] <= n; i++) {
		if (n%p[i] == 0) {
			n /= p[i];
			if (n%p[i] == 0) { b *= p[i]; }
			else { a *= p[i]; }
		}
	}
	if (n != 1) {
		int m = sqrt(n);
		rep(i, 3) {
			if ((m - 1 + i)*(m - 1 + i) == n) { b *= n; n = 1; }
		}
	}
	a *= n;
	if (a > 1000000) { return -1; }
	return a * a*b;
}
signed main(){
	int n; cin >> n;
	vel s(n);
	rep(i, n) {
		cin >> s[i];
		for (int j = 2; j*j*j <= s[i]; j++) {
			while (s[i] % (j*j*j) == 0) {
				s[i] /= (j*j*j);
			}
		}
	}
	sor(s);
	vel t(1, s[0]);
	rep(i, n - 1) {
		if (s[i + 1] != s[i]) { t.push_back(s[i+1]); }
	}
	int sz = t.size();
	vel co(sz);
	rep(i, sz) {
		co[i] = upper(s, t[i]) - lower(s, t[i]);
	}
	vel pr;
	for (int i = 2; i <= 3000; i++) {
		bool fl = true;
		for (int j = 2; j*j <= i; j++) {
			if (i%j == 0) { fl = false; }
		}
		if (fl) { pr.push_back(i); }
	}
	int ans = n;
	if (t[0] == 1) { ans -= (co[0] - 1); }
	rep(i, sz) {
		if (t[i] != 1) {
			int re1 = reve(t[i],pr);
			int ind = lower(t, re1)-t.begin();
			if (i<ind &&ind < sz) {
				if (re1 == t[ind]) {
					ans -= min(co[i], co[ind]);
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'long long int reve(long long int, std::vector<long long int>&)':
a.cc:74:25: error: 'sqrt' was not declared in this scope
   74 |                 int m = sqrt(n);
      |                         ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<functional>
#include<map>
#include<unordered_set>
using namespace std;
long long p  = 998244353;
//long long p = 1000000007;
#define int long long
#define vel vector<long long>
#define vvel vector<vel>
#define rep(i,n) for(int i=0;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mmax(a,b) a=max(a,b)
#define mmin(a,b) a=min(a,b)
#define mkp make_pair
#define pin pair<int,int>
#define qin pair<int,pin>
#define V vector
#define Endl endl
#define veb vector<bool>
#define rev(s) reverse(s.begin(),s.end())
#define lower(h,val) lower_bound(h.begin(),h.end(),val)
#define upper(h,val) upper_bound(h.begin(),h.end(),val)
int max_kai = 150000;
vel kai(max_kai, 1);
vel inv_kai;
int rui(int a, int n) {
	if (n == 0) { return 1; }
	int x = rui(a, n / 2);
	x *= x; x %= p;
	if (n % 2 == 1) { x *= a; x %= p; }
	return x;
}
int inv(int a) { return rui(a, p - 2); }
void make_kai() {
	for (int i = 1; i < max_kai; i++) { kai[i] = kai[i - 1] * i; kai[i] %= p; }
	inv_kai = kai;
	rep(i, max_kai) { inv_kai[i] = inv(kai[i]); }
}
int nCr(int n, int r) {
	int a = kai[n] * inv_kai[r]; a %= p;
	a *= inv_kai[n - r]; a %= p;
	return a;
}
vel pa;
int root(int x) {
	if (pa[x] == -1) { return x; }
	int ans = root(pa[x]); pa[x] = ans;
	return ans;
}
void marge(int x, int y) {
	x = root(x);
	y = root(y);
	if (x != y) {pa[x] = y;}
}
#define end_s(a) cout <<a<<endl;return 0
int reve(int n,vel &p) {
	int a = 1, b = 1;
	for (int i = 0; p[i] * p[i] * p[i] <= n; i++) {
		if (n%p[i] == 0) {
			n /= p[i];
			if (n%p[i] == 0) { b *= p[i]; }
			else { a *= p[i]; }
		}
	}
	if (n != 1) {
      double qn=n;
		int m = sqrt(qn);
		rep(i, 3) {
			if ((m - 1 + i)*(m - 1 + i) == n) { b *= n; n = 1; }
		}
	}
	a *= n;
	return a * a*b;
}
signed main(){
	int n; cin >> n;
	vel s(n);
	rep(i, n) {
		cin >> s[i];
		for (int j = 2; j*j*j <= s[i]; j++) {
			while (s[i] % (j*j*j) == 0) {
				s[i] /= (j*j*j);
			}
		}
	}
	sor(s);
	vel t(1, s[0]);
	rep(i, n - 1) {
		if (s[i + 1] != s[i]) { t.push_back(s[i+1]); }
	}
	int sz = t.size();
	vel co(sz);
	rep(i, sz) {
		co[i] = upper(s, t[i]) - lower(s, t[i]);
	}
	vel pr;
	for (int i = 2; i <= 3000; i++) {
		bool fl = true;
		for (int j = 2; j*j <= i; j++) {
			if (i%j == 0) { fl = false; }
		}
		if (fl) { pr.push_back(i); }
	}
	int ans = n;
	if (t[0] == 1) { ans -= (co[0] - 1); }
	rep(i, sz) {
		if (t[i] != 1) {
			int re1 = reve(t[i],pr);
			int ind = lower(t, re1)-t.begin();
			if (ind < sz) {
				if (t[i] < re1 && re1 == t[ind]) {
					ans -= min(co[i], co[ind]);
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Compiler output:
a.cc: In function 'long long int reve(long long int, std::vector<long long int>&)':
a.cc:75:25: error: 'sqrt' was not declared in this scope
   75 |                 int m = sqrt(qn);
      |                         ^~~~
Language: C++

#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<functional>
#include<map>
#include<unordered_set>
using namespace std;
long long p  = 998244353;
//long long p = 1000000007;
#define int long long
#define vel vector<long long>
#define vvel vector<vel>
#define rep(i,n) for(int i=0;i<n;i++)
#define sor(v) sort(v.begin(),v.end())
#define mmax(a,b) a=max(a,b)
#define mmin(a,b) a=min(a,b)
#define mkp make_pair
#define pin pair<int,int>
#define qin pair<int,pin>
#define V vector
#define Endl endl
#define veb vector<bool>
#define rev(s) reverse(s.begin(),s.end())
#define lower(h,val) lower_bound(h.begin(),h.end(),val)
#define upper(h,val) upper_bound(h.begin(),h.end(),val)
int max_kai = 150000;
vel kai(max_kai, 1);
vel inv_kai;
int rui(int a, int n) {
	if (n == 0) { return 1; }
	int x = rui(a, n / 2);
	x *= x; x %= p;
	if (n % 2 == 1) { x *= a; x %= p; }
	return x;
}
int inv(int a) { return rui(a, p - 2); }
void make_kai() {
	for (int i = 1; i < max_kai; i++) { kai[i] = kai[i - 1] * i; kai[i] %= p; }
	inv_kai = kai;
	rep(i, max_kai) { inv_kai[i] = inv(kai[i]); }
}
int nCr(int n, int r) {
	int a = kai[n] * inv_kai[r]; a %= p;
	a *= inv_kai[n - r]; a %= p;
	return a;
}
vel pa;
int root(int x) {
	if (pa[x] == -1) { return x; }
	int ans = root(pa[x]); pa[x] = ans;
	return ans;
}
void marge(int x, int y) {
	x = root(x);
	y = root(y);
	if (x != y) {pa[x] = y;}
}
#define end_s(a) cout <<a<<endl;return 0
int reve(int n,vel &p) {
	int a = 1, b = 1;
	for (int i = 0; p[i] * p[i] * p[i] <= n; i++) {
		if (n%p[i] == 0) {
			n /= p[i];
			if (n%p[i] == 0) { b *= p[i]; }
			else { a *= p[i]; }
		}
	}
	if (n != 1) {
		int m = sqrt(n);
		rep(i, 3) {
			if ((m - 1 + i)*(m - 1 + i) == n) { b *= n; n = 1; }
		}
	}
	a *= n;
	return a * a*b;
}
signed main(){
	int n; cin >> n;
	vel s(n);
	rep(i, n) {
		cin >> s[i];
		for (int j = 2; j*j*j <= s[i]; j++) {
			while (s[i] % (j*j*j) == 0) {
				s[i] /= (j*j*j);
			}
		}
	}
	sor(s);
	vel t(1, s[0]);
	rep(i, n - 1) {
		if (s[i + 1] != s[i]) { t.push_back(s[i+1]); }
	}
	int sz = t.size();
	vel co(sz);
	rep(i, sz) {
		co[i] = upper(s, t[i]) - lower(s, t[i]);
	}
	vel pr;
	for (int i = 2; i <= 3000; i++) {
		bool fl = true;
		for (int j = 2; j*j <= i; j++) {
			if (i%j == 0) { fl = false; }
		}
		if (fl) { pr.push_back(i); }
	}
	int ans = n;
	if (t[0] == 1) { ans -= (co[0] - 1); }
	rep(i, sz) {
		if (t[i] != 1) {
			int re1 = reve(t[i],pr);
			int ind = lower(t, re1)-t.begin();
			if (ind < sz) {
				if (t[i] < re1 && re1 == t[ind]) {
					ans -= min(co[i], co[ind]);
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Compiler output:
a.cc: In function 'long long int reve(long long int, std::vector<long long int>&)':
a.cc:74:25: error: 'sqrt' was not declared in this scope
   74 |                 int m = sqrt(n);
      |                         ^~~~
Language: C++

#include<bits/stdc++.h>
using namespace std;

#define int long long
#define rep(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define reps(i, n) for (int (i) = 1; (i) <= (n); (i)++)
typedef vector<int> vint;
typedef pair<int, int> pint;
const double PI = 3.141592653589793238462643383279;
const int DY[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int DX[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
template<typename T, typename U> inline bool chmax(T &a, const U &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T, typename U> inline bool chmin(T &a, const U &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
struct Init {
    Init() {
        cout << fixed << setprecision(20);
    };
} init;

int N;
int s[110000];
unordered_map<int, int> mp;

// オーバーフロー怖いけど、通るやろ！ｗ
signed main() {
    cin >> N;
    rep(i, N) {
        cin >> s[i];
        for (int j = 2; j * j * j <= s[i]; j++) { while (s[i] % (j * j * j) == 0) { s[i] /= (j * j * j); }}
        mp[s[i]]++;
    }
    int ans = 0;
    if (mp[1] > 0) { ans++, mp[1] = 0; }
    rep(i, N) {
        int cur = s[i], counter = 1;
        for (int j = 2; j * j * j <= s[i]; j++) {
            if (cur % (j * j) == 0) {
                counter *= j;
                cur /= (j * j);
            } else if (cur % j == 0) {
                prod(counter, j * j);
                counter *= j * j;
            }
        }
        int rt = round(sqrt(cur));
        if (rt * rt == cur) { counter *= rt; }
        else { counter *= cur * cur; }
        ans += max(mp[s[i]], mp[counter]);
        mp[s[i]] = mp[counter] = 0;
    }
    cout << ans << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:54:17: error: 'prod' was not declared in this scope
   54 |                 prod(counter, j * j);
      |                 ^~~~
Language: C++

#include <bits/stdc++.h>

#define ft first
#define sd second

using namespace std;


typedef long long ll;

const int MAXN = 100 * 1000 + 12;



unordered_map<ll, int> mp;

bool inp[MAXN];
vector<int> p;

void gh() {
	inp[0] = inp[1] = true;
	for (int i = 2; i < MAXN; i++)
		if (!inp[i]) {
			p.push_back(i);
			for (ll j = (ll)i * i; j < MAXN; j += i)
				inp[j] = true;
		}
}
ll kam(ll x) {
	ll ret = 1;
	for (int i = 0; i < (int)p.size() && (ll)p[i] * p[i] <= x; i++) {
		ll j = p[i];
		if (x % j == 0) {
			ll m = j * j * j;
			while (x % m == 0)
				x /= m;
			while (x % j == 0)
				ret *= j, x /= j;
		}
	}
	return ret * x;
}
ll ziad(ll x) {
	ll ret = 1;
	for (int i = 0; i < (int)p.size() && (ll)p[i] * p[i] <= x; i++) {
		ll j = p[i];
		if (x % j == 0) {
			ll m = j * j * j;
			while (x % m == 0)
				x /= m;
			while (x % j == 0)
				m /= j, x/= j;
			ret *= ((m == j * j * j)? 1: m);
		}
	}
	return ret * x * x;
}


int main() {
	gh();
	{
		int n, a;
		cin >> n;
		for (int i = 0; i < n; i++) {
			cin >> a;
			mp[kam(a)]++;
		}
	}
	for (auto i : mp) {
		if (i.ft == 1) {
			ans++;
			continue;
		}
	    ll x = mp[ziad(i.ft)];
		if (i.sd > x)
			ans += ((x)? i.sd: (i.sd << 1));
		else
			ans += x;
	}
	cout << (ans >> 1);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:72:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   72 |                         ans++;
      |                         ^~~
      |                         abs
a.cc:77:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   77 |                         ans += ((x)? i.sd: (i.sd << 1));
      |                         ^~~
      |                         abs
a.cc:79:25: error: 'ans' was not declared in this scope; did you mean 'abs'?
   79 |                         ans += x;
      |                         ^~~
      |                         abs
a.cc:81:18: error: 'ans' was not declared in this scope; did you mean 'abs'?
   81 |         cout << (ans >> 1);
      |                  ^~~
      |                  abs
Language: C++

#include <bits/stdc++.h>
#define int long long
//#pragma GCC optimize ("O3")
#define map unordered_map
using namespace std;

int m3[2160];
int m2[2160];
int n;
int cnt[100005];
int it=0;
int b[100005];
int a[100005];
map<int, int> concac;
map<int, int> used;

signed main()
{
	ios::sync_with_stdio(false);
	for(int i=1; i<=2155; i++)
	{
		m3[i]=i*i*i;
		m2[i]=i*i;
	}
	cin>>n;
	for(int i=1; i<=n; i++)
	{
		cin>>a[i];
		for(int j=2155; j>=1; j--)
		{
			if(a[i]%m3[j]==0)
			{
				a[i]/=m3[j];
				break;
			}
		}
	}
	sort(a+1, a+n+1);
	for(int i=1; i<=n; i++)
	{
//		cout<<a[i]<<" ";
		if(a[i]!=a[i-1])
		{
			it++;
			b[it]=a[i];
		}
		cnt[it]++;
	}
//	cout<<endl;
//	for(int i=1; i<=it; i++)
//	{
//		concac[b[i]]=cnt[i];
//	}
//	int ans=0;
//	for(int i=1; i<=it; i++)
//	{
//		if(used[b[i]]) continue;
//		used[b[i]]=1;
//		bool cophaikhong=false;
//		for(int j=1; j<=2155; j++)
//		{
//			if(b[i]%j==0)
//			{
//				int cac=sqrt(b[i]/j);
//				if(cac*cac*j==b[i])
//				{
//					cophaikhong=true;
//					int caccac=cac*j*j;
//					if(caccac==b[i]) ans++;
//					else ans+=max(concac[b[i]], concac[caccac]);
//					used[caccac]=1;
//					break;
//				}
//			}
//		}
//		if(!cophaikhong)
//		for(int j=2155; j>=1; j--)
//		{
//			if(b[i]%m2[j]==0)
//			{
//				if(b[i]/m2[j]>=1000000)
//				{
//					ans++;
//					break;
//				}
//				int cac=j*b[i]/m2[j]*b[i]/m2[j];
//				cophaikhong=true;
//				if(cac==b[i]) ans++;
//				else ans+=max(concac[b[i]], concac[cac]);
//				used[cac]=1;
//				break;
//			}
//		}
////		cout<<i<<" "<<ans<<endl;
//	}
	cout<<ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:96:15: error: 'ans' was not declared in this scope; did you mean 'abs'?
   96 |         cout<<ans;
      |               ^~~
      |               abs
Language: C++

//fold
#ifndef KHALIL
#include <bits/stdc++.h>
#else
#include "header.h"
#endif
#define endl '\n'
#define mp make_pair
#define tostr(x) static_cast<ostringstream&>((ostringstream()<<dec<<x)).str()
#define rep(i,begin,end) for(auto i = begin;i < end;i++)
#define repr(i,begin,end) for(auto i = begin-1;i >= end;i--)
#define pb push_back
#define sz(a) ((int)(a).size())
#define fi first
#define se second
#define abs(a) ((a) < (0) ? (-1)*(a) : (a))
#define SQ(a) ((a)*(a))
#define eqd(a,b) (abs(a-b)<1e-9)
#define X real()
#define Y imag()
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename t> t in(t q){cin >> q;return q;}
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v){os << "[";for (int i = 0; i < sz(v); ++i) { os << v[i]; if (i != sz(v) - 1) os << ",";}os << "]";return os;}
template <typename T, typename S>ostream& operator<<(ostream& os, const map<T, S>& v){for (auto it : v)os << "(" << it.first << ":" << it.second << ")";return os;}
template <typename T, typename S>ostream& operator<<(ostream& os, const pair<T, S>& v){os << "(" << v.first << "," << v.second << ")";return os;}
const long double PI = acosl(-1);
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng64(chrono::steady_clock::now().time_since_epoch().count());
inline int rand(int l,int r){return uniform_int_distribution<int>(l, r)(rng);}
inline ll rand(ll l,ll r){return uniform_int_distribution<ll>(l, r)(rng64);}
//endfold
#define  N  (200005)
#define MOD (1000000000ll + 7ll)
#define OO (1050000000)
#define OOL (1100000000000000000)

//global
ll a[N];
map<ll,int> act;
map<ll,int> ful;

int main(){
	//fold
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cout << setprecision(10);
	//endfold
	int n;
	cin >> n;	
	rep(i,0,n){
		cin >> a[i];
	}
	rep(i,0,n){
		vector<pair<int,int>> bs;
		vector<pair<int,int>> rs;
		ll j = 2;
		while(j*j <= a[i]){
			int k = 0;
			while(a[i]%j == 0){
				k++;
				a[i] /= j;
			}
			if(k%3 != 0) bs.push_back({j,k%3});
			j++;
		}
		if(a[i] > 100000) continue;
		if(a[i] > 1) bs.push_back({a[i],1});
		ll bsn = 1;
		ll rsn = 1;
		for(pair<int,int> w:bs){
			if(w.second == 1){
				bsn *= w.first;
				rsn *= w.first;
				rsn *= w.first;
			}
			if(w.second == 2){
				bsn *= w.first;
				bsn *= w.first;
				rsn *= w.first;
			}
		}
		if(bsn <= rsn) act[bsn]++;
		ful[min(bsn,rsn)]++;
	}
	int ans = 0;
	for(auto el:act){
		i = el.first;
		ans += max(act[i],ful[i]-act[i]);
	}
	cout << ans+(act[1]>0);
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:89:17: error: 'i' was not declared in this scope
   89 |                 i = el.first;
      |                 ^
Language: C++

#include <map>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
map <ll ,int > ma;
const int M=3005,N=100005;
int p[M],tot=0;bool notp[M];
ll a[N];ll c1[N],c2[N];
int cnt[N];
map <ll,bool > used;
inline void getp(){
	for (int i=2;i<=3000;i++){
		if (!notp[i]) p[++tot]=i;
		for (int j=1;i*p[j]<=3000&&j<=tot;j++){
			notp[i*p[j]]=true;
			if (i%p[j]==0) break;
		}
	}
}
int main (){
	int n;scanf ("%d",&n);
	getp();bool flag=false;
	for (int i=1;i<=n;i++) scanf ("%lld",&a[i]);
	for (int i=1;i<=n;i++){
		for (int j=1;j<=tot;j++) cnt[j]=0;
		ll hash=1,hash2=1;
		for (int j=1;j<=tot;j++)
			while (a[i]%p[j]==0) a[i]/=p[j],cnt[j]++;
		for (int j=1;j<=tot;j++) {
			cnt[j]%=3;
			for (int k=1;k<=cnt[j];k++) hash*=p[j];
			if (cnt[j]) for (int k=2;k>=cnt[j];k--) hash2*=p[j];
		}
		if (a[i]==1) c1[i]=hash,c2[i]=hash2;
		else {
			ll t=(ll)sqrt(a[i]);
			if (t*t==a[i]) hash*=t,hash*=t,hash2*=t;
			else hash*=a[i],hash2*=a[i],hash2*=a[i];
			c1[i]=hash,c2[i]=hash2;
		}
	}
	int ans=0;
	for (int i=1;i<=n;i++) ma[c1[i]]++;
	for (int i=1;i<=n;i++){
        ll x=c1[i],y=c2[i];
        if (used[x]||used[y]) continue;
        ll t=ma[x]>ma[y]?x:y;used[t]=1;
        ans+=(t==1)?1:ma[t];
    }
	printf ("%d",ans);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:39:34: error: 'sqrt' was not declared in this scope
   39 |                         ll t=(ll)sqrt(a[i]);
      |                                  ^~~~
Language: C++

#include <map>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
#define ll long long
map <ll ,int > ma;
const int M=3005,N=100005;
int p[M],tot=0;bool notp[M];
ll a[N];ll c1[N],c2[N];
int cnt[N];
inline void getp(){
	for (int i=2;i<=3000;i++){
		if (!notp[i]) p[++tot]=i;
		for (int j=1;i*p[j]<=3000&&j<=tot;j++){
			notp[i*p[j]]=true;
			if (i%p[j]==0) break;
		}
	}
}
int main (){
	int n;scanf ("%d",&n);
	getp();bool flag=false;
	for (int i=1;i<=n;i++) scanf ("%lld",&a[i]);
	for (int i=1;i<=n;i++){
		for (int j=1;j<=tot;j++) cnt[j]=0;
		ll hash=1,hash2=1;
		for (int j=1;j<=tot;j++)
			while (a[i]%p[j]==0) a[i]/=p[j],cnt[j]++;
		for (int j=1;j<=tot;j++) {
			cnt[j]%=3;
			for (int k=1;k<=cnt[j];k++) hash*=p[j];
			if (cnt[j]) for (int k=2;k>=cnt[j];k--) hash2*=p[j];
		}
		if (a[i]==1) c1[i]=hash,c2[i]=hash2;
		else {
			int t=(int)sqrt(a[i]);
			if (t*t==a[i]) hash*=t,hash*=t,hash2*=t;
			else hash*=a[i],hash2*=a[i],hash2*=a[i];
			c1[i]=hash,c2[i]=hash2;
		}
	}
	int ans=0;
	for (int i=1;i<=n;i++) if (c1[i]!=1) ma[c1[i]]++;else flag=true;
	ans+=flag;
	for (int i=1;i<=n;i++)
		if (ma[c1[i]]>ma[c2[i]]) ans++;
		else if (ma[c1[i]]&&ma[c1[i]]==ma[c2[i]]) ans+=ma[c1[i]],ma[c1[i]]=ma[c2[i]]=0;
	printf ("%d",ans);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:38:36: error: 'sqrt' was not declared in this scope
   38 |                         int t=(int)sqrt(a[i]);
      |                                    ^~~~
Language: C++

#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll p[10000],a[100005],k[100005];
int cnt=0;
map<ll,int>x;
map<ll,bool>vis;
ll M(ll t,ll h)
{
    ll ans1=1,ans2=1;
    for(int i=0;i<cnt&&p[i]*p[i]<=t;i++)
    {
        int cot=0;
        while(t%p[i]==0) cot++,t/=p[i];
        cot%=3;
        if(cot==0) continue;
        if(cot==1) 
        {
            ans1*=p[i],ans2*=p[i];
            if(ans2>1e10) ans2=0;
            ans2*=p[i];
            if(ans2>1e10) ans2=0;
        }
        else 
        {
            ans1*=p[i]*p[i],ans2*=p[i];
            if(ans2>1e10) ans2=0;
        }
    }
    if(t>1) 
    {
        ans1*=t,ans2*=t
        if(ans>1e10) ans2=0;
        ans2=*t;
        if(ans2>1e10) ans2=0;
    }
    x[ans1]++;
    if(ans2!=0)
        k[h]=ans2;
    else k[h]=ans1;
    return ans1;
}
int main()
{
    for(int i=2;i<=100000;i++)
    {
        bool flag=true;
        for(int j=2;j*j<=i;j++)
        if(i%j==0) {flag=false;break;}
        if(flag) p[cnt++]=i;
    }
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        ll m;
        scanf("%lld",&m);
        a[i]=M(m,i);
    }
    int ans=0;
    vis[1]=true;
    for(int i=1;i<=n;i++)
        if(!vis[a[i]]) ans+=max(x[a[i]],x[k[i]]),vis[a[i]]=vis[k[i]]=true;
    if(x[1]>=1) ans++;
    printf("%d\n",ans);
}

Compiler output:
a.cc: In function 'long long int M(long long int, long long int)':
a.cc:32:24: error: expected ';' before 'if'
   32 |         ans1*=t,ans2*=t
      |                        ^
      |                        ;
   33 |         if(ans>1e10) ans2=0;
      |         ~~              
a.cc:34:14: error: invalid type argument of unary '*' (have 'long long int')
   34 |         ans2=*t;
      |              ^~
Language: C++

#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cassert>
#include<map>
#define ll long long
using namespace std;
inline ll read(){
	ll re=0,flag=1;char ch=getchar();
	while(!isdigit(ch)){
		if(ch=='-') flag=-1;
		ch=getchar();
	}
	while(isdigit(ch)) re=(re<<1)+(re<<3)+ch-'0',ch=getchar();
	return re*flag;
}
ll n,vis[200010],pri[100010],cntp,mark;
map<ll,ll>big;
void init(){
	ll i,j,k;vis[1]=1;
	for(i=2;i<=100000;i++){
		if(!vis[i]){pri[++cntp]=i;big[(ll)i*(ll)i]=i;}
		for(j=1;j<=cntp;j++){
			k=i*pri[j];if(k>100000) break;
			vis[k]=1;
			if(i%pri[j]==0) break;
		}
		if(i==3000) mark=cntp;
	}
}
vector<ll>f1,f2;bool cb=0;
ll cur[100010],inv[100010];
map<ll,ll>s;
void F(ll x,ll num){
	if(x==1){cur[num]=inv[num]=1e15;cb=1;return;}
	ll i,cnt,flag=0;
	f1.clear();f2.clear();
	for(i=1;i<=mark;i++){
		if(x%pri[i]) continue;
		cnt=0;
		while(x%pri[i]==0) cnt++,x/=pri[i];
		if(cnt%3==1) f1.push_back(pri[i]),flag=1;
		if(cnt%3==2) f2.push_back(pri[i]),flag=1;
	}
//	cout<<"mid "<<x<<' '<<num<<'\n';
	if(x!=1){
		flag=1;
		if(big.count(x)) f2.push_back(big[x]);
		else f1.push_back(x);
	}
//	cout<<"kkk "<<flag<<' '<<f1.size()<<' '<<f2.size()<<'\n';
	if(!flag){cur[num]=inv[num]=1e15;cb=1;return;}
	ll rer=1,rel=1;
	for(auto i:f1) rer*=(i*i),rel*=i;
	for(auto i:f2) rer*=i,rel*=(i*i);
	if(s.count(rel)) s[rel]++;
	else s[rel]=1;
	cur[num]=rel;inv[num]=rer;
//	cout<<"final "<<num<<' '<<cur[num]<<' '<<inv[num]<<'\n';
}
ll rk[100010];
inline bool cmp(ll l,ll r){
	return cur[l]<cur[r];
}
int main(){
	init();
	n=read();ll i,tmp,j,de=0,tot=0;
	for(i=1;i<=n;i++){
		tmp=read();
		F(tmp,i);rk[i]=i;
	}
	sort(rk+1,rk+n+1,cmp);
	for(j=1;j<=n;j++){
//		cout<<j<<' '<<rk[j]<<' '<<cur[rk[j]]<<' '<<inv[rk[j]]<<'\n';
		if(cur[rk[j]]==1e15) continue;
		tot++;
		if(cur[rk[j]]==cur[rk[j-1]]) continue;
		if(inv[rk[j]]>=cur[rk[j]]&&s.count(inv[rk[j]])){
//			cout<<"add de "<<'\n';
			de+=min(s[cur[rk[j]]],s[inv[rk[j]]]);
		}
	}
	cout<<tot-de+(cb!=0)<<'\n';
}
	

Compiler output:
a.cc:32:1: error: 'vector' does not name a type
   32 | vector<ll>f1,f2;bool cb=0;
      | ^~~~~~
a.cc: In function 'void F(long long int, long long int)':
a.cc:38:9: error: 'f1' was not declared in this scope
   38 |         f1.clear();f2.clear();
      |         ^~
a.cc:38:20: error: 'f2' was not declared in this scope
   38 |         f1.clear();f2.clear();
      |                    ^~
Language: C++

#include <cstdio>
#include <algorithm>
#include <map>
const int N=1e5+5,P=2200+5;
int n,tot,p[P];
long long a[N],s[N],t[N];
bool flg[P];
std::map<long long,int> mp;

void init() {
	for(int i=2;i<P;++i) {
		if(!flg[i]) p[++tot]=i;
		for(int j=1;j<=tot&&i*p[j]<P;++j) {
			flg[i*p[j]]=1;
			if(i%p[j]==0) break;
		}
	}
}
void solve() {
	scanf("%d",&n);
	for(int k=1;k<=n;++k) {
		long long x;
		scanf("%lld",&x);
		t[k]=1;
		for(int i=1;1LL*p[i]*p[i]*p[i]<=x;++i) {
			long long c=1LL*p[i]*p[i]*p[i];
			while(x%c==0) x/=c;
		}
		++mp[s[k]=x];
		for(int i=1;1LL*p[i]*p[i]*p[i]<=x;++i) {
			int cnt=0;
			while(x%p[i]==0) x/=p[i],++cnt;
			if(cnt==1) t[k]*=1LL*p[i]*p[i];
			if(cnt==2) t[k]*=p[i];
		}
		long long rt=std::sqrt(x);
		rt*rt==x?t[k]*=rt:t[k]*=x*x;
	}
	int ans=0;
	if(mp[1]) ++ans,mp[1]=0;
	for(int i=1;i<=n;++i) {
		ans+=std::max(mp[s[i]],mp[t[i]]);
		mp[s[i]]=mp[t[i]]=0;
	}
	printf("%d\n",ans);
}
int main() {
	init();
	solve();
	return 0;
}

Compiler output:
a.cc: In function 'void solve()':
a.cc:36:35: error: 'sqrt' is not a member of 'std'; did you mean 'sort'?
   36 |                 long long rt=std::sqrt(x);
      |                                   ^~~~
      |                                   sort
Language: C++

#include <bits/stdc++.h>

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define EPS 1e-6
#define INF 1000000000
#define LLINF 1000000000000000000
#define MOD 1000000007

typedef long long ll;
typedef pair<ll,ll> P;

bool noPrime[100011];

int main(){
	
	vector<int> primeList;
	set<ll> primeSet;
	for(int i = 2;i < 100011;i++){
		if(!noPrime[i]){
			primeList.PB(i);
			primeSet.insert(i);
			for(int j = i;j < 100011;j += i)noPrime[j] = true;
		}
	}
	
	int n;cin >> n;
	ll ans = 0;
	
	vector<pair<ll,ll>> v;
	REP(i,n){
		ll s;cin >> s;
		ll now = 1;
		ll ref = 1;
		for(int i = 0;primeList[i] <= 11111;i++){
			int cou = 0;
			while(s % primeList[i] == 0){
				cou = (cou + 1) % 3;
				s /= primeList[i];
			}
			if(cou){
				REP(j,cou)now *= primeList[i];
				REP(j,3-cou)ref *= primeList[i];
			}
			if(ref > 1e11)break;
		}

		if(ref * s * S > 1e11){
			ans++;
		}
		else {
			ll sq = sqrt(s);
			if(sq*sq != s)v.PB(MP(now*s,ref*s*s));
			else v.PB(MP(now*s,ref*sq));
		}
	}
	
	set<ll> s;
	
	REP(i,v.size()){
		if(s.count(v[i].FI))continue;
		s.insert(v[i].SE);
		ans++;
	}
	
	cout << ans << endl;
		
		
	return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:62:30: error: 'S' was not declared in this scope
   62 |                 if(ref * s * S > 1e11){
      |                              ^
Language: C++

#include <bits/stdc++.h>

using namespace std;

int n;
long long a[100005];
bool ex = false;
multiset<long long> s, ss;
map<long long, int> f;

int spf[100005];

const int MAXN = 100001;

void sieve() {
    spf[1] = 1;
    for (int i=2; i<=100000; i++)
        spf[i] = i;
 	for (int i=4; i<MAXN; i+=2)
        spf[i] = 2;
    for (int i=3; i*i<MAXN; i++)
    {
        if (spf[i] == i)
        {
            for (int j=i*i; j<MAXN; j+=i)
                if (spf[j]==j)
                    spf[j] = i;
        }
    }
}


long long get(long long x) {
	long long ou = 1;
	while (x != 1) {
		ou *= spf[x];
		x /= spf[x];
	}
	return ou;
}

long long p(long long n, long long k) {
	return n*n*n;
}

signed main() {
	sieve();
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%lld", &a[i]);
		s.insert(a[i]);
	}
	for (int i = 1; 1ll*i*i*i <= 10000000000; i ++) {
		if (s.find(1ll*i*i*i) != s.end()) {
			ex = true;
			s.erase(1ll*i*i*i);
			ss.insert(1ll*i*i*i);
		}
	}
	//cout << s.size() << endl;
	int res = 0;
	if (ex) res++;
	for (int i = 1; i <= n; i++) {
		if (ss.find(a[i]) != ss.end()) continue;
		for (int j = 2154; j >= 1; j--) {
			if (a[i] % (1ll*j*j*j) == 0) {
				a[i] /= 1ll*j*j*j;
			}
		}
		f[a[i]]++;
	}
	for (int i = 1; i <= n; i++) {
		if (ss.find(a[i]) != ss.end()) continue;
		//cout << a[i] << endl;
		if (a[i] > 100000) {res += f[a[i]]; f[a[i]] = 0;};
		else {
			long long op = p(get(a[i]), 3)/a[i];
			res += max(f[a[i]], f[op]);
			f[op] = 0;
			f[a[i]] = 0;
		}
	}	
	cout << res;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:76:17: error: 'else' without a previous 'if'
   76 |                 else {
      |                 ^~~~
Language: C++

#include<bits/stdc++.h>
const int N = 1e5 + 5;
using namespace std;

int n, ans;
long long a[N];

long long cal(long long x){
    long long ans = 1;
    for (long long i = 2; i * i <= x; i++){
        if (x % i != 0) continue;
        if (x % (i * i) == 0) ans *= i, x /= i * i;
        else ans *= i * i, x /= i;
    }
    if (x != 1) ans *= x * x;
    return ans;
}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++){
        for (long long j = 2; j * j * j <= a[i]; j++){
            long long x = j * j * j;
            while (a[i] % x == 0) a[i] /= x;
        }
        mymap[a[i]]++;
    }
    for (int i = 1; i <= n; i++){
        if (mymap[a[i]] == 0) continue;
        if (a[i] == 1) {ans++; mymap[1] = 0; continue;}
        long long x = cal(a[i]);
        ans += max(mymap[a[i]], mymap[x]), mymap[a[i]] = mymap[x] = 0;
    }
    cout << ans;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:28:9: error: 'mymap' was not declared in this scope
   28 |         mymap[a[i]]++;
      |         ^~~~~
a.cc:31:13: error: 'mymap' was not declared in this scope
   31 |         if (mymap[a[i]] == 0) continue;
      |             ^~~~~
a.cc:32:32: error: 'mymap' was not declared in this scope
   32 |         if (a[i] == 1) {ans++; mymap[1] = 0; continue;}
      |                                ^~~~~
a.cc:34:20: error: 'mymap' was not declared in this scope
   34 |         ans += max(mymap[a[i]], mymap[x]), mymap[a[i]] = mymap[x] = 0;
      |                    ^~~~~
Language: C++

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <queue>
#include <map>
#include <ctime>
#include <unordered_map>
using namespace std;
typedef long long ll;
const int maxn=150000;
const ll MOD=1e9+7;
ll prime[maxn],tot;
bool isprime[maxn];
void get_prime(){
	memset(isprime,true,sizeof isprime);
	isprime[0]=isprime[1]=false;
	for (ll i = 2; i < maxn; ++i)
	{
		if(!isprime[i]) continue;
		prime[tot++]=i;
		for (ll j = i*i; j < maxn; j+=i)
		{
			isprime[j]=false;
		}
	}
}
int n;
unordered_map<ll,int> mp;
unordered_map<ll,ll> rvs;
unordered_map<ll,bool> rvs;

ll L[maxn],R[maxn];
int main(int argc, char const *argv[])
{
	get_prime();
    scanf("%d", &n);
    for (int i = 0; i < n; ++i)
    {
    	ll x,y=1,z=1;
    	scanf("%lld", &x);
    	for (int j = 0; prime[j]*prime[j] <= x; ++j)
    	{
    		ll k=prime[j];
    		if(x%k==0){
    			int cnt=0;
    			while(x%k==0){
    				x/=k;
    				cnt++;
    			}
    			cnt%=3;
    			int tmp=(3-cnt)%3;
    			while(cnt--) y*=k;
    			while(tmp--){
    				z*=k;
    				if(z>1e10) z=0;
    			}
    		}
    	}
    	if(x>1){
    		y=y*x;
    		if(z*x>1e10 || z*x*x> 1e10) z=0;
    		z=z*x*x;
    	}
    	mp[y]++;
    	L[i]=y;
    	R[i]=z;
    	// rvs[y]=z;
    	// rvs[z]=y;
    }
    int ans=0;
    for (int i = 0; i < n; ++i)
    {
    	if(L[i]==1){
    		ans+=int(mp[1]>0);
    		mp[1]=0;
    	}
    	else if(vis.count(L[i])==0){
    		ans+=max(mp[L[i]],mp[R[i]]);
    		// mp[L[i]]=mp[R[i]]=0;
    		vis[L[i]]=vis[R[i]]=true;
    	}
    }
    printf("%d\n", ans);
    return 0;
}

Compiler output:
a.cc:32:24: error: conflicting declaration 'std::unordered_map<long long int, bool> rvs'
   32 | unordered_map<ll,bool> rvs;
      |                        ^~~
a.cc:31:22: note: previous declaration as 'std::unordered_map<long long int, long long int> rvs'
   31 | unordered_map<ll,ll> rvs;
      |                      ^~~
a.cc: In function 'int main(int, const char**)':
a.cc:79:17: error: 'vis' was not declared in this scope
   79 |         else if(vis.count(L[i])==0){
      |                 ^~~
Language: C++

#include<bits/stdc++.h>
#define debug puts("&&&&&&&&")
#define read(x) scanf("%lld",&x)
using namespace std;
typedef long long LL;
const int maxn=1e5+5;
const int maxx=1e10+2;
LL a[maxn];
LL b[maxn];
LL n;
map<LL,int>ma;
LL sqr(LL a) {
    return a*a;
}
int main() {
    while(read(n) != EOF) {
            ma.clear();
        for(LL i=1;i<=n;i++) {
            read(a[i]);
            LL t=a[i];
            for(LL j=2;j*j*j<=t;j++) {
                while(t%(j*j*j)==0) {
                    t/=(j*j*j);
                }
            }
            ma[t]++,a[i]=t;
            LL ans=1;
            for(LL j=2;j*j*j<=t;j++) {
                if(t%j==0) {
                    if(t%j*j==0) {
                        ans*=j;
                    }
                    else {
                        ans*=j*j;
                    }
                    while(t%j==0) {
                        t/=j;
                    }
                }
            }
            LL d=sqrt(t);
            if (sqr((LL)sqrt(t))==t) y*=(LL)sqrt(t);
            else ans*=t*t;
            b[i]=ans;
        }
        LL ans=0;
        if(ma[1]){ans++;
        ma[1]=0;}
        for(int i=1;i<=n;i++) {
            ans+=max(ma[a[i]],ma[b[i]]);
            ma[a[i]]=ma[b[i]]=0;
        }
        cout<<ans<<endl;
    }
    return 0;
}


Compiler output:
a.cc:7:20: warning: overflow in conversion from 'double' to 'int' changes value from '1.0000000002e+10' to '2147483647' [-Woverflow]
    7 | const int maxx=1e10+2;
      |                ~~~~^~
a.cc: In function 'int main()':
a.cc:42:38: error: 'y' was not declared in this scope
   42 |             if (sqr((LL)sqrt(t))==t) y*=(LL)sqrt(t);
      |                                      ^
Language: C++

#include <iostream>
#include <map>
#include <algorithm>
using namespace std;
long long n;
long long a[(1<<20)], f[(1<<20)];

vector < long long > prs;

pair < long long, long long > vals[(1<<20)];
map < long long, long long > cnt;

pair< long long, long long > gg ( long long x ) {
    long long a = 1, b = 1;

    for ( int i = 0 ; prs[i]*prs[i] <= x ; i ++ ) {

        if ( x%prs[i] == 0 ) {
            int cnt = 0;
            for ( ; x%prs[i] == 0 ; cnt ++ ) {
                x /= prs[i];
            }
            cnt %= 3;
            for ( int c = 0 ; c < cnt ; c ++ ) { a *= prs[i]; }
            cnt = (3-cnt)%3;
            for ( int c = 0 ; c < cnt ; c ++ ) { b *= prs[i]; }

        }
    }

    if ( x != 1 ) {
        a *= x;
        b *= x*x;
    }
    return make_pair( a, b );
}

int main () {

    for( long long i = 2 ; i*i < (10000000000LL) ; i ++ ) {
        if ( f[i] == 0 ) {
            prs.push_back( i );
            for ( long long j = 1;  i*i*j*j < (10000000000LL) ; j ++ ) {
                f[i*j] = 1;
            }
        }
    }

    cin >> n;
    for ( long long i = 0 ; i < n ; i ++ ) {
        cin >> a[i];
        vals[i] = gg( a[i] );
        cnt[ vals[i].first ] ++;
    }
    sort ( vals, vals+n );

    long long ans = 0;
    for ( long long i = 0 ; i < n ; ) {
        long long j = i;
        for ( ; j < n && vals[i].first == vals[j].first ; j ++ ) {}

        long long ccnt = j-i, revcnt = cnt[ vals[i].second ];

        if ( vals[i].first == 1 ) { ans ++; }
        else {
            if ( ccnt > revcnt ) {
                ans += ccnt;
            }else if ( ccnt < revcnt ) {
                //ans += revcnt;
            }else {
                if ( vals[i].first < vals[i].second ) {
                    ans += ccnt;
                }
            }

        }

        i = j;
    }
    cout << ans << "\n";
    return 0;
}


Compiler output:
a.cc:8:1: error: 'vector' does not name a type
    8 | vector < long long > prs;
      | ^~~~~~
a.cc: In function 'std::pair<long long int, long long int> gg(long long int)':
a.cc:16:23: error: 'prs' was not declared in this scope
   16 |     for ( int i = 0 ; prs[i]*prs[i] <= x ; i ++ ) {
      |                       ^~~
a.cc: In function 'int main()':
a.cc:42:13: error: 'prs' was not declared in this scope
   42 |             prs.push_back( i );
      |             ^~~
Language: C++

#include <bits/stdc++.h>

using namespace std;

typedef long long int lint;

map <lint, int> Map;

int main()
{
    ios_base :: sync_with_stdio(false);
    int N;
    cin >> N;
    while (N --) {
        lint nr;
        cin >> nr;
        for (int i = 2200; i; -- i) {
            const lint cube = (1LL * i * i * i);
            if (nr % cube == 0) {
                nr /= cube;
                break;
            }
        }
        ++ Map[nr];
    }

    int ans = 0;
    for (const auto it: Map) {
        lint nr = it.first;
        lint minimum = 1E9 + 15;
        for (int i = 1; i <= 2200; ++ i) {
            const lint cube = (1LL * i * i * i);
            if (cube % nr == 0)
                minimum = min(minimum, cube / nr);
        }

        if (minimum == nr && Map[nr])
            ++ ans, Map[nr] = 0;
        else if (minimum < 1E9 + 10) {
            ans += max(Map[nr], Map[minimum]);
            Map[nr] = 0;
            if (Map.count(minim))
                Map[minimum] = 0;
        }
        else
            ans += Map[nr];
    }

    cout << ans << '\n';
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:42:27: error: 'minim' was not declared in this scope; did you mean 'minimum'?
   42 |             if (Map.count(minim))
      |                           ^~~~~
      |                           minimum
Language: C++

#include <cstdio>
#include <algorithm>
#include <unordered_map>
using namespace std;

#define iter(i, n) for (int i = 1; i <= n; ++i)
#define forw(i, a, b) for (int i = a; i <= b; ++i)

typedef long long i64;

unordered_map<i64, int> mp;
unordered_map<i64, i64> inv;

#define fi first
#define se second

const int N = 2200;

bool vp[N + 10];
int p[N / 5], psz, n;

void sieve(int N) {
	forw(i, 2, N) {
		if (!vp[i]) p[++psz] = i;
		for (int j = 1; j <= psz && i * p[j] <= N; ++j) {
			vp[i * p[j]] = true;
			if (i % p[j] == 0) break;
		}
	}
}

int main() {
	//freopen("3D.in", "r", stdin);
	scanf("%d", &n);
	sieve(N);
	iter(i, n) {
		i64 a;
		scanf("%lld", &a);
		i64 s = 1, v = 1;
		for (int j = 1; j <= psz && a >= p[j]; ++j) if (a % p[j] == 0) {
			int c = 0;
			for (; a % p[j] == 0; a /= p[j]) ++c;
			c %= 3;
			if (c == 1) s *= p[j], v *= p[j] * p[j];
			else if (c == 2) s *= p[j] * p[j], v *= p[j];
		}
		if (a != 1) {
			i64 q = sqrt(a);
			if (q * q == a) s *= q * q, v *= q;
			else {
				if (log(v) + log(a) + log(a) > 11) s *= a, v = -1;
				else s *= a, v *= a * a;
			}
		}
		//printf("%lld %lld\n", s, v);
		++mp[s]; inv[s] = v;
	}
	int ans = 0;
	for (auto p : mp) {
		i64 v = inv[p.fi];
		if (p.fi == 1) {
			++ans;
		} else {
			if (mp.find(v) == mp.end()) ans += p.se;
			else if (p.fi < v) ans += max(p.se, mp[v]);
		}
	}
	printf("%d\n", ans);
	return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:48:33: error: 'sqrt' was not declared in this scope
   48 |                         i64 q = sqrt(a);
      |                                 ^~~~
a.cc:51:37: error: 'log' was not declared in this scope; did you mean 'long'?
   51 |                                 if (log(v) + log(a) + log(a) > 11) s *= a, v = -1;
      |                                     ^~~
      |                                     long
Language: C++

#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
const int maxn=2160;
bool flag[maxn];
int pri[maxn],t;
void pre()
{
    memset(flag,0,sizeof(flag));
    t=0;
    for(int i=2;i<maxn;i++)
    {
        if(!flag[i]){
            pri[t++]=i;
        }
        for(int j=0;j<t&&i*pri[j]<maxn;j++)
        {
            flag[i*pri[j]]=1;
            if(i%pri[j]==0) break;
        }
    }
}
long long shit[100005];
bool vis[100005];
map<long long,int> mp;
long long q[100005];
long long now[100005];
bool deal(long long num,int id)
{
    now[id]=1;
    q[id]=1;
    for(int i=0;i<t;i++)
    {
        if(num%pri[i]==0){
            int cnt=0;
            while(num%pri[i]==0){
                num=num/pri[i];
                cnt++;
            }
            cnt=cnt%3;
            if(cnt){
                for(int j=1;j<=cnt;j++)
                    now[id]=now[id]*pri[i];
                for(int j=1;j<=3-cnt;j++)
                    q[id]=q[id]*pri[i];
            }
        }
        if(num==1) break;
    }
    if(num==1) {
        mp[now[id]]++;return 0;
    }
    long long t=(long long)sqrtl(1.0*num);
    if(t*t==num){
        q[id]=q[id]*t;
        now[id]=now[id]*t*t;
        mp[now[id]]++;return 0;
    }
    else if((t-1)*(t-1)==num){
        q[id]=q[id]*(t-1);
        now[id]=now[id]*(t-1)*(t-1);
        mp[now[id]]++;return 0;
    }
    else if((t+1)*(t+1)==num){
        q[id]=q[id]*(t+1);
        now[id]=now[id]*(t+1)*(t+1);
        mp[now[id]]++;return 0;
    }
    else if(num<1000000){
        now[id]=now[id]*num;
        q[id]=q[id]*num*num;
        mp[now[id]]++;return 0;
    }
    else{
        return 1;
    }
}
int main()
{
    pre();
    int n;
    scanf("%d",&n);
    int ans=0;
    memset(vis,0,sizeof(vis));
    for(int i=1;i<=n;i++)
    {
        scanf("%d",shit+i);
        vis[i]=deal(shit[i],i);
        ans=ans+vis[i];
//        printf("%d %d-----\n",shit[i],vis[i]);
//        printf("%lld %lld\n",now[i],q[i]);
    }
    bool ss=0;
    for(int i=1;i<=n;i++)
    {
        if(vis[i]) continue;
        int num=mp[now[i]];
        //printf("%d %dkk %d %d\n",i,ans,num,q[i]);
        if(num==0) continue;
        mp[now[i]]=0;
        if(now[i]==1){
            ans++;
        }
        else{
            map<long long, int>::iterator iter = mp.find(q[i]);
            if (iter == M.end())
            {
                ans += num;
                continue;
            }
            num=max(num,iter->second);
            ans+=num;
            iter->second=0;
        }
    }
    printf("%d\n",ans);
    return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:106:25: error: 'M' was not declared in this scope
  106 |             if (iter == M.end())
      |                         ^
Language: C++

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <memory.h>
#include <vector>

using namespace std;
typedef long long LL;
const int maxn = 100005;

LL a[maxn],t[maxn];int n,cnt,m,ans;
int prm[maxn],tot,is[maxn],ord[maxn];

void predo(int n) {
	for (int i=2;i<=n;i++)
	{
		if (!is[i]) prm[++tot]=i;
		for (int j=1;j<=tot;j++)
		{
			int num=prm[j]*i;
			if (num>n) break;
			if (i%prm[j]) is[num]=1;
			else {is[num]=1;break;}
		}
	}
}
void solve(LL n)
{
	LL u=1ll,v=1ll;
	for (int i=1;i<=tot;i++)
	if (n%prm[i]==0) {
		int cnt=0,x=prm[i];
		while (n%x==0) n/=x,++cnt;
		cnt%=3;
		if (cnt==1) u*=x,v*=x*x;
		if (cnt==2) u*=x*x,v*=x;
	}
	LL n_=sqrt(n);
	if (n_*n_==n) u*=n,v*=n_;
	else if (n>(int)1e5) {ans++;return ;}
	else {u*=n;v*=n*n;}
	if (u==1) ++cnt;
	else {t[++m]=min(u,v);a[m]=v;}
}

bool comp(int x,int y) {return t[x]<t[y];}
int main()
{
	#ifdef Amberframe
		freopen("agc003d.in","r",stdin);
		freopen("agc003d.out","w",stdout);
	#endif
	scanf("%d",&n);predo((int)2200);
	for (int i=1;i<=n;i++) scanf("%lld",&a[i]);
	for (int i=1;i<=n;i++) solve(a[i]);
	for (int i=1;i<=m;i++) ord[i]=i;
	sort(ord+1,ord+m+1,comp);
	
	for (int i=1;i<=m;)
	{
		int pos=i,c1=0,c2=0;
		while (pos<=n&&t[ord[pos]]==t[ord[i]]) {
			a[ord[pos]]==a[ord[i]]?c1++:c2++;++pos;
		}
		ans+=max(c1,c2);i=pos;
	}
	printf("%d",ans+(cnt?1:0));
	return 0;
}

Compiler output:
a.cc: In function 'void solve(LL)':
a.cc:38:15: error: 'sqrt' was not declared in this scope
   38 |         LL n_=sqrt(n);
      |               ^~~~