Language: C++

#include <bits/stdc++.h>
#include <vector>
#include <cmath>
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP2(i, m, n) for (int i = (m); i < (int)(n); ++i)
#define REPR(i, n) for (int i = (n)-1; i >= 0; --i)
#define REPR2(i, m, n) for (int i = (n)-1; i >= (m); --i)
#define REPx(x, a) for(auto x : a)
#define ALL(a) a.begin(), a.end()
#define SORT(a) sort(ALL(a))
#define SORTR(a) sort(ALL(a), greater<int>())
#define REVERSE(a) reverse(ALL(a))
#define bit_search(bit, n) REP(bit, 1<<(n))
#define bit_check(bit, i) (bit>>(i)) & 1
#define setpre(n) fixed << setprecision((n))
#define UNIQUE(a) do {SORT(a); (a).erase(unique(ALL(a)), (a).end());} while(0
)
#define MAX(a) *max_element(ALL(a))
#define MIN(a) *min_element(ALL(a))
#define bisect_left(a, x) lower_bound(ALL(a), (x)) - a.begin()
#define bisect_right(a, x) upper_bound(ALL(a), (x)) - a.begin()
#define INPUT(a) REP(i, a.size()) cin >> a[i];
#define INPUTP(a) REP(i, a.size()) cin >> a[i].first >> a[i].second;
#define ENDL cout << endl;
using namespace std;
using LL = long long;
using LD = long double;
using PII = pair<int, int>;
using VPII = vector<PII>;
using PLL = pair<LL, LL>;
using VPLL = vector<PLL>;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VC = vector<char>;
using VS = vector<string>;
using VB = vector<bool>;
const int INF = 1e9;
const LL MOD = 1e9 + 7;

template<class T> inline bool chmin(T &a, T b){if (a > b) {a = b; return true
;} return false;}
template<class T> inline bool chmax(T &a, T b){if (a < b) {a = b; return true
;} return false;}

void prime_factorize(auto n, auto &res)
{
  // 素因数分解する。計算量はO(√N)。
  for (LL s = 2; n >= s * s; s += 2)
  {
    LL e = 0;
    if (n % s == 0)
    {
      while(n % s == 0)
      {
        n /= s;
        e++;
      }
      res.emplace_back(s, e);
    }
    if (s == 2) s--;
  }
  if (n != 1) res.emplace_back(n, 1);
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  LL n, p;
  cin >> n >> p;
  LL ans = 1;
  VPLL res;
  prime_factorize(p, res);
  REPx(x, res)
  {
    LL s = x.first, e = x.second;
    ans *= pow(s, e/n);
  }
  cout << ans << endl;

  return 0;
 }


Compiler output:
a.cc:17:1: error: expected unqualified-id before ')' token
   17 | )
      | ^
a.cc:28:13: error: 'pair' does not name a type
   28 | using PII = pair<int, int>;
      |             ^~~~
a.cc:29:14: error: 'vector' does not name a type
   29 | using VPII = vector<PII>;
      |              ^~~~~~
a.cc:30:13: error: 'pair' does not name a type
   30 | using PLL = pair<LL, LL>;
      |             ^~~~
a.cc:31:14: error: 'vector' does not name a type
   31 | using VPLL = vector<PLL>;
      |              ^~~~~~
a.cc:32:12: error: 'vector' does not name a type
   32 | using VI = vector<int>;
      |            ^~~~~~
a.cc:33:13: error: 'vector' does not name a type
   33 | using VVI = vector<VI>;
      |             ^~~~~~
a.cc:34:13: error: 'vector' does not name a type
   34 | using VLL = vector<LL>;
      |             ^~~~~~
a.cc:35:14: error: 'vector' does not name a type
   35 | using VVLL = vector<VLL>;
      |              ^~~~~~
a.cc:36:12: error: 'vector' does not name a type
   36 | using VC = vector<char>;
      |            ^~~~~~
a.cc:37:12: error: 'vector' does not name a type
   37 | using VS = vector<string>;
      |            ^~~~~~
a.cc:38:12: error: 'vector' does not name a type
   38 | using VB = vector<bool>;
      |            ^~~~~~
a.cc:47:22: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   47 | void prime_factorize(auto n, auto &res)
      |                      ^~~~
a.cc:47:30: warning: use of 'auto' in parameter declaration only available with '-std=c++20' or '-fconcepts'
   47 | void prime_factorize(auto n, auto &res)
      |                              ^~~~
a.cc: In function 'int main()':
a.cc:69:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
   69 |   cin.tie(0);
      |   ^~~
      |   std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:146,
                 from a.cc:1:
/usr/include/c++/14/iostream:62:18: note: 'std::cin' declared here
   62 |   extern istream cin;           ///< Linked to standard input
      |                  ^~~
a.cc:70:3: error: 'ios' has not been declared
   70 |   ios::sync_with_stdio(false);
      |   ^~~
a.cc:74:3: error: 'VPLL' was not declared in this scope; did you mean 'LL'?
   74 |   VPLL res;
      |   ^~~~
      |   LL
a.cc:75:22: error: 'res' was not declared in this scope
   75 |   prime_factorize(p, res);
      |                      ^~~
a.cc:79:19: error: 'e' was not declared in this scope
   79 |     ans *= pow(s, e/n);
      |                   ^
a.cc:81:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   81 |   cout << ans << endl;
      |   ^~~~
      |   std::cout
/usr/include/c++/14/iostream:63:18: note: 'std::cout' declared here
   63 |   extern ostream cout;          ///< Linked to standard output
      |                  ^~~~
a.cc:81:18: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   81 |   cout << ans << endl;
      |                  ^~~~
      |                  std::endl
In file included from /usr/include/c++/14/istream:41,
                 from /usr/include/c++/14/sstream:40,
                 from /usr/include/c++/14/complex:45,
                 from /usr/include/c++/14/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:127:
/usr/include/c++/14/ostream:744:5: note: 'std::endl' declared here
  744 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~