Language: C++

#include <bits/stdc++.h>
#include <omp.h>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef double ld;


#define int ll
#define rand shittttty_shit
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng_64(chrono::steady_clock::now().time_since_epoch().count());


typedef pair<int, int> pii;
typedef pair<string, string> pst;
typedef pair<pii, pii> piii;
typedef vector<piii> vpii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector< vvi > vvvi;
typedef vector<pii> vpi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<string> vst;
typedef vector<vst> vvst;
typedef pair<ld, ld> pld;
typedef pair<pld, pld> pldd;
typedef vector<pld> vpd;
typedef complex<double> base;


#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define my_abs(a) (((a) >= 0) ? (a) : -(a))
#define mp(a, b) make_pair(a, (b))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define sqr(x) ((x) * (x))
#define fori(i, n) for(int i = 0; i < int(n); ++i)
#define SZ(a) ((int)((a).size()))
#define MODIK(a) (a >= M ? a - M : a)
#define triple(T) tuple<T, T, T>
#define quad(T) tuple<T, T, T, T>
#define watch(x) cout << (#x) << " = " << x << endl;
#ifdef ART_HOME
#define cerr cout
#else
#define cerr if (false) cerr
#endif


const double PI = 2 * acos(0.0);

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";

istream &operator >> (istream &in, pii &a)
{
    in >> a.first >> a.second;
    return in;
}


ostream &operator << (ostream &out, pii &a)
{
    out << a.first << ' ' << a.second;
    return out;
}


istream &operator >> (istream &in, pld &a)
{
    in >> a.first >> a.second;
    return in;
}


ostream &operator << (ostream &out, pld &a)
{
    out << a.first << ' ' << a.second;
    return out;
}


template <class T0, class T1>
inline ostream & operator << (ostream &out, pair<T0, T1> &a) {
    return out << "{" << a.first << ", " << a.second << "}";
}

template <class T0, class T1, class T2>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << "}";
}

template <class T0, class T1, class T2, class T3>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2, T3> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) <<
               ", " << get<2>(a) << ", " <<  get<3>(a) << "}";
}

template<class T>
inline ostream & operator << (ostream &out, vector<T> &a) {
    out << "[";
    fori (i, a.size())
        out << a[i] << vector<string>{", ", "]  "}[i + 1 == a.size()];
    return out;
}


void print(int a, int b, int n, vi h)
{
    ofstream cout("output.txt");
    cout << SZ(h) << ' ' << a << ' ' << b << '\n';
    for (int i = 0; i < SZ(h); ++i) {
        cout << h[i]  << ' ';
    }
    cout.close();
    exit(0);
}


inline bool break_time(ld time)
{
    return clock() > CLOCKS_PER_SEC * time;
}


void bonds()
{
    ld price, nkd, kd, year;
    int cnt;
    cout << "price nkd kd cnt year\n";
    cout << endl;
    cin >> price >> nkd >> kd >> cnt >> year;
    cout << 100 * ((1000 + kd * cnt - price * 10 - nkd) / (price * 10) / year);
}


ld get_rand_ld(ld l, ld r)
{
    uniform_real_distribution<double> gen(l, r);
    return gen(rng);
}


bool may(int E, ld T)
{
    if (E < 0)
        return 1;

    double eps = get_rand_ld(0, 1);
    return eps < exp(-E / T);
}


void smain();

signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

#ifdef ART_HOME
    freopen("input.txt", "r", stdin);
    clock_t start = clock();
#endif
    cout << setprecision(2) << fixed;
    smain();
#ifdef ART_HOME
    cout << "\nTOTAL EXECUTIOn TIME: " << float( clock () - start ) /  CLOCKS_PER_SEC << endl;
#endif
}


const int N = 4000 + 10, pw = 17, K = 2e3 + 10, B = 1e6, oo = 2e14, M = 1 << 14, LOG = 20;
const int M1 = 1000000093, x1 = 27162;
const int M2 = 1000000087, x2 = 241;
const ld pi = atan2(1, 0) * 2, EPS = 1e-9;


bool prime(int v)
{
    for (int d = 2; d * d <= v; ++d)
    {
        if (v % d == 0)
            return 0;
    }

    return 1;
}


void smain()
{
    int n;
    cin >> n;

    vi kek(n);
    for (int i = 0; i < n; ++i)
        cin >> kek[i];

    vi pr;
    for (int d = 2; d * d * d <= 1e10; ++d)
    {
        if (prime(d))
            pr.push_back(d);
    }

    vi div = pr;

    int ans = 0;

    map<pair<__int128, __int128>, pii> flex;
    __int128 a = 1, b = 1;
    flex[mp(a, b)] = mp(1, 1);
    return;
    for (int v : kek)
    {
        map<int, int> cur;
        for (int d : pr)
        {
            while (v % d == 0)
            {
                cur[d]++;
                v /= d;
            }
        }

        if (v == 1)
        {
            ans = 1;
            continue;
        }



        if (v != 1) {
            int c = sqrt(v);
            for (int i = max(0LL, c - 5); i <= c + 5; ++i) {
                if (i * i == v) {
                    cur[i]++;
                    cur[i]++;
                    div.push_back(i);
                }
                else if (i == c + 5)
                    cur[v]++;
            }
        }

        map<int, int> cur2;
        for (auto &p : cur)
        {
            p.second %= 3;
            if (p.second)
                cur2[p.first] = p.second;
        }

        if (SZ(cur2) == 0)
            ans = 1;
        else
            flex[cur2]++;
    }

    map<map<int, int>, int> used;

    for (auto p : flex) {
        if (used.count(p.first))
            continue;

        map<int, int> cur;
        for (auto p1 : p.first)
            cur[p1.first] = 3 - p1.second;

        if (flex.count(cur))
        {
            ans += max(p.second, flex[cur]);
            used[cur] = 1;
        }
        else
            ans += p.second;
    }

    cout << ans;
}

Compiler output:
a.cc: In function 'void smain()':
a.cc:271:17: error: no match for 'operator[]' (operand types are 'std::map<std::pair<__int128, __int128>, std::pair<long long int, long long int> >' and 'std::map<long long int, long long int>')
  271 |             flex[cur2]++;
      |                 ^
In file included from /usr/include/c++/14/map:63,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:152,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_map.h:504:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](const key_type&) [with _Key = std::pair<__int128, __int128>; _Tp = std::pair<long long int, long long int>; _Compare = std::less<std::pair<__int128, __int128> >; _Alloc = std::allocator<std::pair<const std::pair<__int128, __int128>, std::pair<long long int, long long int> > >; mapped_type = std::pair<long long int, long long int>; key_type = std::pair<__int128, __int128>]'
  504 |       operator[](const key_type& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:504:34: note:   no known conversion for argument 1 from 'std::map<long long int, long long int>' to 'const std::map<std::pair<__int128, __int128>, std::pair<long long int, long long int> >::key_type&' {aka 'const std::pair<__int128, __int128>&'}
  504 |       operator[](const key_type& __k)
      |                  ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/14/bits/stl_map.h:524:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::mapped_type& std::map<_Key, _Tp, _Compare, _Alloc>::operator[](key_type&&) [with _Key = std::pair<__int128, __int128>; _Tp = std::pair<long long int, long long int>; _Compare = std::less<std::pair<__int128, __int128> >; _Alloc = std::allocator<std::pair<const std::pair<__int128, __int128>, std::pair<long long int, long long int> > >; mapped_type = std::pair<long long int, long long int>; key_type = std::pair<__int128, __int128>]'
  524 |       operator[](key_type&& __k)
      |       ^~~~~~~~
/usr/include/c++/14/bits/stl_map.h:524:29: note:   no known conversion for argument 1 from 'std::map<long long int, long long int>' to 'std::map<std::pair<__int128, __int128>, std::pair<long long int, long long int> >::key_type&&' {aka 'std::pair<__int128, __int128>&&'}
  524 |       operator[](key_type&& __k)
      |                  ~~~~~~~~~~~^~~
a.cc:277:23: error: no matching function for call to 'std::map<std::map<long long int, long long int>, long long int>::count(const std::pair<__int128, __int128>&)'
  277 |         if (used.count(p.first))
      |             ~~~~~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_map.h:1270:9: note: candidate: 'template<class _Kt> decltype (((const std::map<_Key, _Tp, _Compare, _Alloc>*)this)->std::map<_Key, _Tp, _Compare, _Alloc>::_M_t._M_count_tr(__x)) std::map<_Key, _Tp, _Compare, _Alloc>::count(const _Kt&) const [with _Key = std::map<long long int, long long int>; _Tp = long long int; _Compare = std::less<std::map<long long int, long long int> >; _Alloc = std::allocator<std::pair<const std::map<long long int, long long int>, long long int> >]'
 1270 |         count(const _Kt& __x) const -> decltype(_M_t._M_count_tr(__x))
      |         ^~~~~
/usr/include/c++/14/bits/stl_map.h:1270:9: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/stl_map.h: In substitution of 'template<class _Kt> decltype (((const std::map<std::map<long long int, long long int>, long long int>*)this)->std::map<std::map<long long int, long long int>, long long int>::_M_t.std::_Rb_tree<std::map<long long int, long long int>, std::pair<const std::map<long long int, long long int>, long long int>, std::_Select1st<std::pair<const std::map<long long int, long long int>, long long int> >, std::less<std::map<long long int, long long int> >, std::allocator<std::pair<const std::map<long long int, long long int>, long long int> > >::_M_count_tr<_Kt, _Req>(__x)) std::map<std::map<long long int, long long int>, long long int>::count(const _Kt&) const [with _Kt = std::pair<__int128, __int128>]':
a.cc:277:23:   required from here
  277 |         if (used.count(p.first))
      |             ~~~~~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_map.h:1270:65: error: no matching function for call to 'std::_Rb_tree<std::map<long long int, long long int>, std::pair<const std::map<long long int, long long int>, long long int>, std::_Select1st<std::pair<const std::map<long long int, long long int>, long long int> >, std::less<std::map<long long int, long long int> >, std::allocator<std::pair<const std::map<long long int, long long int>, long long int> > >::_M_count_tr(const std::pair<__int128, __int128>&) const'
 1270 |         count(const _Kt& __x) const -> decltype(_M_t._M_count_tr(__x))
      |                                                 ~~~~~~~~~~~~~~~~^~~~~
In file included from /usr/include/c++/14/map:62:
/usr/include/c++/14/bits/stl_tree.h:1311:9: note: candidate: 'template<class _Kt, class _Req> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::size_type std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::_M_count_tr(const _Kt&) const [with _Req = _Kt; _Key = std::map<long long int, long long int>; _Val = std::pair<const std::map<long long int, long long int>, long long int>; _KeyOfValue = std::_Select1st<std::pair<const std::map<long long int, long long int>, long long int> >; _Compare = std::less<std::map<long long int, long long int> >; _Alloc = std::allocator<std::pair<const std::map<long long int, long long int>, long long int> >]'
 1311 |         _M_count_tr(const _Kt& __k) const
      |         ^~~~~~~~~~~
/usr/include/c++/14/bits/stl_tree.h:1311:9: note:   template argument deduction/substitution failed:
In file included from /usr/include/c++/14/string:49,
                 from /usr/include/c++/14/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:52:
/usr/include/c++/14/bits/stl_function.h: In substitution of 'template<class _Func, class _SfinaeType> using std::__has_is_transparent_t = typename std::__has_is_transparent<_Func, _SfinaeType>::type [with _Func = std::less<std::map<long long int, long long int> >; _SfinaeType = std::pair<__int128, __int128>]':
/usr/include/c++/14/bits/stl_tree.h:1309:9:   required by substitution of 'template<class _Kt> decltype (((const std::map<std::map<long long int, long long int>, long long int>*)this)->std::map<std::map<long long int, long long int>, long long int>::_M_t.std::_Rb_tree<std::map<long long int, long long int>, std::pair<const std::map<long long int, long long int>, long long int>, std::_Select1st<std::pair<const std::map<long long int, long long int>, long long int> >, std::less<std::map<long long int, long long int> >, std::allocator<std::pair<const std::map<long long int, long long int>, long long int> > >::_M_count_tr<_Kt, _Req>(__x)) std::map<std::map<long long int, long long int>, long long int>::count(const _Kt&) const [with _Kt = std::pair<__int128, __int128>]'
 1309 |                typename _Req = __has_is_transparent_t<_Compare, _Kt>>
      |                ^~~~~~~~
a.cc:277:23:   required from here
  277 |         if (used.count(p.first))
      |             ~~~~~~~~~~^~~~~~~~~
/usr/include/c++/14/bits/stl_function.h:1427:11: error: no type named 'type' in 'struct std::__has_is_transparent<std::less<std::map<long long int, long long int> >, std::pair<__int128, __int128>, void>'
 1427 |     using __has_is_transparent_t
      |           ^~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_map.h:1264:7: note: candidate: 'std::map<_Key, _Tp, _Compare, _Alloc>::size_type std::map<_Key, _Tp, _Compare, _Alloc>::count(const key_type&) const [with _Key = std::map<long long int, long long int>; _Tp = long long int; _Compare = std::less<std::map<long long int, long long int> >; _Alloc = std::allocator<std::pair<const std::map<long long int, long long int>, long long int> >; size_type = long unsigned int; key_type = std::map<long long int, long long int>]'
 1264 |       count(const key_type& __x) const
      |       ^~~~~
/usr/include/c++/14/bits/stl_map.h:1264:29: note:   no known conversion for argument 1 from 'const std::pair<__int128, __int128>' to 'const std::map<std::map<long long int, long long int>, long long int>::key_type&' {aka 'const std::map<long long int, long long int>&'}
 1264 |       count(const key_type& __x) const
      |             ~~~~~~~~~~~~~~~~^~~
a.cc:281:26: error: no matching function for call to 'begin(const std::pair<__int128, __int128>&)'
  281 |         for (auto p1 : p.first)
      |                          ^~~~~
In file included from /usr/include/c++/14/bits/algorithmfwd.h:39,
                 from /usr/include/c++/14/bits/stl_algo.h:59,
                 from /usr/include/c++/14/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51:
/usr/include/c++/14/initializer_list:88:5: note: candidate: 'template<class _Tp> constexpr const _Tp* std::begin(initializer_list<_Tp>)'
   88 |     begin(initializer_list<_Tp> __ils) noexcept
      |     ^~~~~
/usr/include/c++/14/initializer_list:88:5: note:   template argument deduction/substitution failed:
a.cc:281:26: note:   'std::pair<__int128, __int128>' is not derived from 'std::initializer_list<_Tp>'
  281 |         for (auto p1 : p.first)
      |                          ^~~~~
In file included from /usr/include/c++/14/string:53:
/usr/include/c++/14/bits/range_access.h:52:5: note: candidate: 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&)'
   52 |     begin(_Container& __cont) -> decltype(__cont.begin())
      |     ^~~~~
/usr/include/c++/14/bits/range_access.h:52:5: note:   template argument deduction/substitution failed:
/usr/include/c++/14/bits/range_access.h: In substitution of 'template<class _Container> constexpr decltype (__cont.begin()) std::begin(_Container&) [with _Container = const std::pair<__int128, __int128>]':
a.cc:281:26:   required from here
  281 |         for (auto p1 : p.first)
      |                          ^~~~~
/usr/include/c++/14/bits/range_access.h:52:50: error: 'const struct std::pair<__int128, __int128>' has no member named 'begin'
   52 |     begin(_Cont