Language: C++

#include <cstdio>

using namespace std;

int main(){
  LL N,P; cin >> N >> P;
  if(N == 1) return cout << P << endl, 0;
  LL ans = 1;
  for(LL i = 2 ; ; ++i){
    LL k = 1;
    for(LL t = 0 ; t < N  && k <= P ; ++t){
      k *= i;
    }
    if(P%k==0) ans = i;
    if(P < k) break;
  }
  cout << ans << endl;
  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:6:3: error: 'LL' was not declared in this scope; did you mean 'NULL'?
    6 |   LL N,P; cin >> N >> P;
      |   ^~
      |   NULL
a.cc:6:11: error: 'cin' was not declared in this scope
    6 |   LL N,P; cin >> N >> P;
      |           ^~~
a.cc:2:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
    1 | #include <cstdio>
  +++ |+#include <iostream>
    2 | 
a.cc:6:18: error: 'N' was not declared in this scope
    6 |   LL N,P; cin >> N >> P;
      |                  ^
a.cc:6:23: error: 'P' was not declared in this scope
    6 |   LL N,P; cin >> N >> P;
      |                       ^
a.cc:7:21: error: 'cout' was not declared in this scope
    7 |   if(N == 1) return cout << P << endl, 0;
      |                     ^~~~
a.cc:7:21: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:7:34: error: 'endl' was not declared in this scope
    7 |   if(N == 1) return cout << P << endl, 0;
      |                                  ^~~~
a.cc:2:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
    1 | #include <cstdio>
  +++ |+#include <ostream>
    2 | 
a.cc:8:5: error: expected ';' before 'ans'
    8 |   LL ans = 1;
      |     ^~~~
      |     ;
a.cc:9:9: error: expected ';' before 'i'
    9 |   for(LL i = 2 ; ; ++i){
      |         ^~
      |         ;
a.cc:9:22: error: 'i' was not declared in this scope
    9 |   for(LL i = 2 ; ; ++i){
      |                      ^
a.cc:10:7: error: expected ';' before 'k'
   10 |     LL k = 1;
      |       ^~
      |       ;
a.cc:11:11: error: expected ';' before 't'
   11 |     for(LL t = 0 ; t < N  && k <= P ; ++t){
      |           ^~
      |           ;
a.cc:11:20: error: 't' was not declared in this scope
   11 |     for(LL t = 0 ; t < N  && k <= P ; ++t){
      |                    ^
a.cc:11:30: error: 'k' was not declared in this scope
   11 |     for(LL t = 0 ; t < N  && k <= P ; ++t){
      |                              ^
a.cc:14:10: error: 'k' was not declared in this scope
   14 |     if(P%k==0) ans = i;
      |          ^
a.cc:14:16: error: 'ans' was not declared in this scope
   14 |     if(P%k==0) ans = i;
      |                ^~~
a.cc:15:12: error: 'k' was not declared in this scope
   15 |     if(P < k) break;
      |            ^
a.cc:17:3: error: 'cout' was not declared in this scope
   17 |   cout << ans << endl;
      |   ^~~~
a.cc:17:3: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:17:11: error: 'ans' was not declared in this scope
   17 |   cout << ans << endl;
      |           ^~~
a.cc:17:18: error: 'endl' was not declared in this scope
   17 |   cout << ans << endl;
      |                  ^~~~
a.cc:17:18: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'