Language: C++

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

map<__int64, __int64> match;
map<__int64, __int64> cnt;
__int64 arr[100050];
bool isPrime[100050];
vector<__int64> prime;
__int64 Slove(__int64 n)
{
    for(vector<__int64>::size_type i = 0; i < prime.size(); ++i)
    {
        while(n % (prime[i] * prime[i] * prime[i]) == 0)
            n /= prime[i] * prime[i] * prime[i];
    }
    return n;
}
int main()
{
    memset(isPrime, true, sizeof(isPrime));
    for(__int64 i = 2; i <= 100000; ++i)
    {
        if(!isPrime[i])
            continue;
        prime.push_back(i);
        for(__int64 j = i + i; j <= 100000; j += i)
            isPrime[j] = false;
    }
    __int64 n;
    scanf("%I64d", &n);
    for(__int64 i = 1; i <= n; ++i)
        scanf("%I64d", &arr[i]);
    __int64 ans = 0;
    for(__int64 i = 1; i <= n; ++i)
    {
        if(arr[i] == 1)
            ++cnt[1];
        else
        {
            __int64 b;
            __int64 a = Slove(arr[i]);
            if(a > 100000000)
                b = 0;
            else
                b = Slove(a * a);
            ++cnt[a];
            if(a > b)
                swap(a, b);
            if(a != 1)
                match[a] = b;
        }
    }
    if(cnt.find(1) != cnt.end())
        ans = 1;
    for(auto it = match.begin(); it != match.end(); ++it)
    {
        __int64 a, b;
        a = it->first;
        b = it->second;
        ans += max(cnt[a], cnt[b]);
        cnt[a] = 0;
        cnt[b] = 0;
    }
    printf("%I64d\n", ans);
    return 0;
}


Compiler output:
a.cc:4:5: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    4 | map<__int64, __int64> match;
      |     ^~~~~~~
      |     __ynf64
a.cc:4:14: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    4 | map<__int64, __int64> match;
      |              ^~~~~~~
      |              __ynf64
a.cc:4:21: error: template argument 1 is invalid
    4 | map<__int64, __int64> match;
      |                     ^
a.cc:4:21: error: template argument 2 is invalid
a.cc:4:21: error: template argument 3 is invalid
a.cc:4:21: error: template argument 4 is invalid
a.cc:5:5: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    5 | map<__int64, __int64> cnt;
      |     ^~~~~~~
      |     __ynf64
a.cc:5:14: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    5 | map<__int64, __int64> cnt;
      |              ^~~~~~~
      |              __ynf64
a.cc:5:21: error: template argument 1 is invalid
    5 | map<__int64, __int64> cnt;
      |                     ^
a.cc:5:21: error: template argument 2 is invalid
a.cc:5:21: error: template argument 3 is invalid
a.cc:5:21: error: template argument 4 is invalid
a.cc:6:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    6 | __int64 arr[100050];
      | ^~~~~~~
      | __int64_t
a.cc:8:8: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
    8 | vector<__int64> prime;
      |        ^~~~~~~
      |        __ynf64
a.cc:8:15: error: template argument 1 is invalid
    8 | vector<__int64> prime;
      |               ^
a.cc:8:15: error: template argument 2 is invalid
a.cc:9:1: error: '__int64' does not name a type; did you mean '__int64_t'?
    9 | __int64 Slove(__int64 n)
      | ^~~~~~~
      | __int64_t
a.cc: In function 'int main()':
a.cc:21:9: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
   21 |     for(__int64 i = 2; i <= 100000; ++i)
      |         ^~~~~~~
      |         __ynf64
a.cc:21:24: error: 'i' was not declared in this scope
   21 |     for(__int64 i = 2; i <= 100000; ++i)
      |                        ^
a.cc:25:15: error: request for member 'push_back' in 'prime', which is of non-class type 'int'
   25 |         prime.push_back(i);
      |               ^~~~~~~~~
a.cc:26:20: error: expected ';' before 'j'
   26 |         for(__int64 j = i + i; j <= 100000; j += i)
      |                    ^~
      |                    ;
a.cc:26:32: error: 'j' was not declared in this scope; did you mean 'jn'?
   26 |         for(__int64 j = i + i; j <= 100000; j += i)
      |                                ^
      |                                jn
a.cc:29:5: error: '__int64' was not declared in this scope; did you mean '__ynf64'?
   29 |     __int64 n;
      |     ^~~~~~~
      |     __ynf64
a.cc:30:21: error: 'n' was not declared in this scope; did you mean 'yn'?
   30 |     scanf("%I64d", &n);
      |                     ^
      |                     yn
a.cc:31:16: error: expected ';' before 'i'
   31 |     for(__int64 i = 1; i <= n; ++i)
      |                ^~
      |                ;
a.cc:31:24: error: 'i' was not declared in this scope
   31 |     for(__int64 i = 1; i <= n; ++i)
      |                        ^
a.cc:32:25: error: 'arr' was not declared in this scope
   32 |         scanf("%I64d", &arr[i]);
      |                         ^~~
a.cc:33:12: error: expected ';' before 'ans'
   33 |     __int64 ans = 0;
      |            ^~~~
      |            ;
a.cc:34:16: error: expected ';' before 'i'
   34 |     for(__int64 i = 1; i <= n; ++i)
      |                ^~
      |                ;
a.cc:34:24: error: 'i' was not declared in this scope
   34 |     for(__int64 i = 1; i <= n; ++i)
      |                        ^
a.cc:36:12: error: 'arr' was not declared in this scope
   36 |         if(arr[i] == 1)
      |            ^~~
a.cc:37:18: error: invalid types 'int[int]' for array subscript
   37 |             ++cnt[1];
      |                  ^
a.cc:40:20: error: expected ';' before 'b'
   40 |             __int64 b;
      |                    ^~
      |                    ;
a.cc:41:20: error: expected ';' before 'a'
   41 |             __int64 a = Slove(arr[i]);
      |                    ^~
      |                    ;
a.cc:42:16: error: 'a' was not declared in this scope
   42 |             if(a > 100000000)
      |                ^
a.cc:43:17: error: 'b' was not declared in this scope
   43 |                 b = 0;
      |                 ^
a.cc:45:17: error: 'b' was not declared in this scope
   45 |                 b = Slove(a * a);
      |                 ^
a.cc:45:21: error: 'Slove' was not declared in this scope
   45 |                 b = Slove(a * a);
      |                     ^~~~~
a.cc:46:19: error: 'a' was not declared in this scope
   46 |             ++cnt[a];
      |                   ^
a.cc:47:20: error: 'b' was not declared in this scope
   47 |             if(a > b)
      |                    ^
a.cc:50:28: error: 'b' was not declared in this scope
   50 |                 match[a] = b;
      |                            ^
a.cc:53:12: error: request for member 'find' in 'cnt', which is of non-class type 'int'
   53 |     if(cnt.find(1) != cnt.end())
      |            ^~~~
a.cc:53:27: error: request for member 'end' in 'cnt', which is of non-class type 'int'
   53 |     if(cnt.find(1) != cnt.end())
      |                           ^~~
a.cc:54:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   54 |         ans = 1;
      |         ^~~
      |         abs
a.cc:55:25: error: request for member 'begin' in 'match', which is of non-class type 'int'
   55 |     for(auto it = match.begin(); it != match.end(); ++it)
      |                         ^~~~~
a.cc:55:46: error: request for member 'end' in 'match', which is of non-class type 'int'
   55 |     for(auto it = match.begin(); it != match.end(); ++it)
      |                                              ^~~
a.cc:57:16: error: expected ';' before 'a'
   57 |         __int64 a, b;
      |                ^~
      |                ;
a.cc:58:9: error: 'a' was not declared in this scope
   58 |         a = it->first;
      |         ^
a.cc:59:9: error: 'b' was not declared in this scope
   59 |         b = it->second;
      |         ^
a.cc:60:9: error: 'ans' was not declared in this scope; did you mean 'abs'?
   60 |         ans += max(cnt[a], cnt[b]);
      |         ^~~
      |         abs
a.cc:64:23: error: 'ans' was not declared in this scope; did you mean 'abs'?
   64 |     printf("%I64d\n", ans);
      |                       ^~~
      |                       abs