Language: C++

#include <bits/stdc++.h>
using namespace std;
jypedef long long LL;
typedef double DB;

#define F(i,a,b) for(int i=(a);i<=(b);++i)
#define R(i,n) for(int i=0;i<(n);++i)
#define fill(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second

const LL INF = 1e10 + 7;

int n,tot;
map<LL,int> cnt;
map<LL,LL> cp;
LL p[4][3010];

void init()
{
	tot = 0;
	for(int i=2;;++i)
	{
		if(1LL*i*i*i >= INF) break;
		if(p[0][i]) continue;
		p[1][tot] = i;
		p[2][tot] = i*i;
		p[3][tot++] = 1LL*i*i*i;
		for(int j=i;;j+=i)
		{
			if(1LL*j*j*j >= INF) break;
			p[0][j] = 1;
		}
	}
}

int main()
{
	//freopen("test.txt","r",stdin);
	init();
	scanf("%d",&n);	
	int ans = 0,fi = 1;
	R(i,n)
	{
		LL s,x,y;
		scanf("%lld",&s);

		x = y = 1;
		R(j,tot)
		{
			while(s%p[3][j] == 0)
			{
				s /= p[3][j];
			}
			if(s%p[2][j] == 0)
			{
				x *= p[2][j];
				y *= p[1][j];
				if(y > INF) y = INF;
			}
			else if(s%p[1][j] == 0)
			{
				x *= p[1][j];
				y *= p[2][j];
				if(y > INF) y = INF;
			}
			if(x == s) break;
		}
		if(y >= INF)
		{
			++ans;
			continue;
		}
		s /= x;
		if(s != 1)
		{
			int t = sqrt(s),r = -1;
			F(j,max(1,t-10),t+10)
				if(1LL*j*j == s)
				{
					r = j;
					break;
				}
			if(r != -1)
			{
				if(y < INF) y *= r;
			}
			else
			{
				if(INF/s/s < y) y = INF;
				else y *= 1LL*s*s;
			}	
		}
		if(y >= INF)
		{
			++ans;
			continue;
		}

		s *= x;

		if(s == 1)
		{
			if(fi)
			{
				fi = 0;
				++ans;
			}
			continue;
		}

		cnt[s]++;
		cp[s] = y;
	}
	for(auto it = cnt.begin();it != cnt.end(); ++it)
	{
		int gf = cp[it->fi];
		if(it->fi < gf || cnt.find(gf) == cnt.end()) ans += max(it -> se,cnt[gf]);
	}
	printf("%d\n",ans);
	return 0;
}


Compiler output:
a.cc:3:1: error: 'jypedef' does not name a type; did you mean 'typedef'?
    3 | jypedef long long LL;
      | ^~~~~~~
      | typedef
a.cc:12:7: error: 'LL' does not name a type
   12 | const LL INF = 1e10 + 7;
      |       ^~
a.cc:15:5: error: 'LL' was not declared in this scope
   15 | map<LL,int> cnt;
      |     ^~
a.cc:15:11: error: template argument 1 is invalid
   15 | map<LL,int> cnt;
      |           ^
a.cc:15:11: error: template argument 3 is invalid
a.cc:15:11: error: template argument 4 is invalid
a.cc:16:5: error: 'LL' was not declared in this scope
   16 | map<LL,LL> cp;
      |     ^~
a.cc:16:8: error: 'LL' was not declared in this scope
   16 | map<LL,LL> cp;
      |        ^~
a.cc:16:10: error: template argument 1 is invalid
   16 | map<LL,LL> cp;
      |          ^
a.cc:16:10: error: template argument 2 is invalid
a.cc:16:10: error: template argument 3 is invalid
a.cc:16:10: error: template argument 4 is invalid
a.cc:17:1: error: 'LL' does not name a type
   17 | LL p[4][3010];
      | ^~
a.cc: In function 'void init()':
a.cc:24:33: error: 'INF' was not declared in this scope
   24 |                 if(1LL*i*i*i >= INF) break;
      |                                 ^~~
a.cc:25:20: error: 'p' was not declared in this scope
   25 |                 if(p[0][i]) continue;
      |                    ^
a.cc:26:17: error: 'p' was not declared in this scope
   26 |                 p[1][tot] = i;
      |                 ^
a.cc:31:41: error: 'INF' was not declared in this scope
   31 |                         if(1LL*j*j*j >= INF) break;
      |                                         ^~~
a.cc: In function 'int main()':
a.cc:45:17: error: 'LL' was not declared in this scope
   45 |                 LL s,x,y;
      |                 ^~
a.cc:46:31: error: 's' was not declared in this scope
   46 |                 scanf("%lld",&s);
      |                               ^
a.cc:48:17: error: 'x' was not declared in this scope
   48 |                 x = y = 1;
      |                 ^
a.cc:48:21: error: 'y' was not declared in this scope
   48 |                 x = y = 1;
      |                     ^
a.cc:51:33: error: 'p' was not declared in this scope
   51 |                         while(s%p[3][j] == 0)
      |                                 ^
a.cc:55:30: error: 'p' was not declared in this scope
   55 |                         if(s%p[2][j] == 0)
      |                              ^
a.cc:59:40: error: 'INF' was not declared in this scope
   59 |                                 if(y > INF) y = INF;
      |                                        ^~~
a.cc:65:40: error: 'INF' was not declared in this scope
   65 |                                 if(y > INF) y = INF;
      |                                        ^~~
a.cc:69:25: error: 'INF' was not declared in this scope
   69 |                 if(y >= INF)
      |                         ^~~
a.cc:81:41: error: 'r' was not declared in this scope
   81 |                                         r = j;
      |                                         ^
a.cc:84:28: error: 'r' was not declared in this scope
   84 |                         if(r != -1)
      |                            ^
a.cc:86:40: error: 'INF' was not declared in this scope
   86 |                                 if(y < INF) y *= r;
      |                                        ^~~
a.cc:90:36: error: 'INF' was not declared in this scope
   90 |                                 if(INF/s/s < y) y = INF;
      |                                    ^~~
a.cc:94:25: error: 'INF' was not declared in this scope
   94 |                 if(y >= INF)
      |                         ^~~
a.cc:115:27: error: request for member 'begin' in 'cnt', which is of non-class type 'int'
  115 |         for(auto it = cnt.begin();it != cnt.end(); ++it)
      |                           ^~~~~
a.cc:115:45: error: request for member 'end' in 'cnt', which is of non-class type 'int'
  115 |         for(auto it = cnt.begin();it != cnt.end(); ++it)
      |                                             ^~~
a.cc:118:39: error: request for member 'find' in 'cnt', which is of non-class type 'int'
  118 |                 if(it->fi < gf || cnt.find(gf) == cnt.end()) ans += max(it -> se,cnt[gf]);
      |                                       ^~~~
a.cc:118:55: error: request for member 'end' in 'cnt', which is of non-class type 'int'
  118 |                 if(it->fi < gf || cnt.find(gf) == cnt.end()) ans += max(it -> se,cnt[gf]);
      |                                                       ^~~
a.cc:118:85: error: invalid types 'int[int]' for array subscript
  118 |                 if(it->fi < gf || cnt.find(gf) == cnt.end()) ans += max(it -> se,cnt[gf]);
      |                                                                                     ^