Problem:


Score : 300 points

Problem Statement

There are N integers a_1, a_2, ..., a_N not less than 1.
The values of a_1, a_2, ..., a_N are not known, but it is known that a_1 \times a_2 \times ... \times a_N = P.

Find the maximum possible greatest common divisor of a_1, a_2, ..., a_N.

Constraints

1 \leq N \leq 10^{12}

1 \leq P \leq 10^{12}

Input

Input is given from Standard Input in the following format:

N P

Output

Print the answer.

Sample Input 1

3 24

Sample Output 1

2

The greatest common divisor would be 2 when, for example, a_1=2, a_2=6 and a_3=2.

Sample Input 2

5 1

Sample Output 2

1

As a_i are positive integers, the only possible case is a_1 = a_2 = a_3 = a_4 = a_5 = 1.

Sample Input 3

1 111

Sample Output 3

111

Sample Input 4

4 972439611840

Sample Output 4

206



Sample input:
3 24


Sample output:
2

Submission status: Wrong Answer

Solution code:
import math,sys

n,p=map(int,sys.stdin.readline().split())
limit = int(round(p ** (1/n), 5))
if limit==1:
    print(1)
elif n==1:
    print(p)
else:
    i = 3
    cnt,ans=0,1

    while True:
        if limit % 2 == 0:
            limit /= 2
            ans *= 2
        else:
            break
    while i <= limit:
        if limit % i == 0:
            ans *= i
            limit /= i
        else:
            i = i + 2
    print(ans)

Submission status: Wrong Answer

Solution code:
n, p = map(int, raw_input().split())
fac = {}
primes = [1]*(10**6 + 200)
i = 2
prim = []
while i <= 10**6 + 100:
    if primes[i]:
        prim.append(i)
        j = i*2
        while j <= 10**6 + 100:
            primes[j] = 0
            j += i 
    i += 1 
for i in prim:
    while p%i == 0:
        p /= i 
        fac[i] = fac[i] + 1 if i in fac else 1
ans = 1
for i in fac:
    if fac[i] >= n:
        ans *= i**(fac[i]/n)
print ans

Submission status: Wrong Answer

Solution code:
n, p = map(int, raw_input().split())
fac = {}
primes = [1]*(10**6 + 1)
i = 2
prim = []
while i <= 10**6:
    if primes[i]:
        prim.append(i)
        j = i*2
        while j <= 10**6:
            primes[j] = 0
            j += i 
    i += 1 
for i in prim:
    while p%i == 0:
        p /= i 
        fac[i] = fac[i] + 1 if i in fac else 1
ans = 1
for i in fac:
    if fac[i] >= n:
        ans *= i**(fac[i]/n)
print ans

Submission status: Wrong Answer

Solution code:
import math
N, P = (int(i) for i in input().split())
a = 1
b = math.floor(math.sqrt(P))
i = 2
c = P

if N ==1:
    a = P
if N ==2 and P == 1000000000000:
    a = 1000000
else:
    while (i**N <= P) and (i<=b):
        if c % (i**N) == 0:
            a = i
        i = i+1

print(a)

Submission status: Wrong Answer

Solution code:
import math
N, P = (int(i) for i in input().split())
a = 1
b = math.floor(math.sqrt(P))
i = 2

if N ==1:
    a = P
if N > 1 and P%(2**N) == 0:
    while ((2*i)**N <= P) and (i<=(b//2)):
        if P % ((2*i)**N) == 0:
            a = 2*i
        else:
            a = a
        i = i+1

if N > 1 and P%(2**N) != 0:
    while ((2*i+1)**N <= P) and (i<=(b//2)):
        if P % ((2*i+1)**N) == 0:
            a = 2*i+1
        else:
            a = a
        i = i+1

print(a)

Submission status: Wrong Answer

Solution code:
N, P = map(int,input().split())
 
output=1
 
for num in range(2,round(P**(1/N)),2):
  for i in range(10000):
    if P%(num**N) == 0:
      P = P/(num**N)
      output = num*output
    else:
      break
 
print(output)

Submission status: Wrong Answer

Solution code:
N, P = map(int,input().split())
 
output=1
if N==1:
  print(P)

for num in range(2,round(P**(1/N))+1):
  for i in range(10000):
    if P%(num**N) == 0:
      P = P/(num**N)
      output = num*output
    else:
      break
 
print(output)

Submission status: Wrong Answer

Solution code:
N, P = map(int,input().split())
 
output=1
 
for num in range(2,round(P**(1/(2*N)))+1):
  for i in range(10000):
    if P%(num**N) == 0:
      P = P/(num**N)
      output = num*output
    else:
      break
 
print(output)

Submission status: Wrong Answer

Solution code:
N, P = map(int,input().split())

output=1

for num in range(2,round(P**(1/N))):
  for i in range(10000):
    if P%(num**N) == 0:
      P = P/(num**N)
      output = num*output
    else:
      break

print(output)

Submission status: Wrong Answer

Solution code:
N, P = map(int,input().split())

output=1

for num in range(2,round(P**(1/N))):
  for i in range(100):
    if P%(num**N) == 0:
      P = P/(num**N)
      output = num*output
    else:
      break

print(output)

Submission status: Wrong Answer

Solution code:
n, p = map(int, input().split())

d = []
for i in range(1, p+1):
    if p % i == 0:
        d.append(i)
list.sort(d, reverse=True)
ans = 0
for i in d:
    print("i=",i)
    ret = 0
    for j in range(i):
        if j** n >i:
            break
        if j ** n == i:
            break
    if j ** n == i:
        ans = j
        break
if ans == 0:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n,p=map(int,input().split())
if p==1:
    print(1)
    exit()
if n==1:
    print(p)
    exit()
i = 2
cnt,ans=0,1
while i<=p:
    if p % i == 0:
        cnt+=1
        p/=i
    else:
        if cnt>=n:
            ans*=i*math.floor(cnt/n)
        cnt=0
        if i==2:
            i+=1
        else:
            i+=2
if cnt>=n:
    ans*=i*math.floor(cnt/n)
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n,p=map(int,input().split())
if p==1:
    print(1)
    exit()
if n==1:
    print(p)
    exit()
i = 2
cnt,ans=0,1
while i<=p:
    if p % i == 0:
        cnt+=1
        p/=i
    else:
        if cnt>=n:
            ans*=i*math.floor(cnt/n)
        cnt=0
        i+=1
if cnt>=n:
    ans*=i*math.floor(cnt/n)
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 31 14:30:45 2018

@author: Yamazaki Kenichi
"""

N,P = map(int, input().split())

limit = int(pow(P,1/N)//1)

if N == 1:
    ans = P
elif limit == 1:
    ans = 1
else:
    ans = 1
    for i in range(2,limit+1):
        if P % pow(i,N) == 0:
            ans = i
            
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 31 14:30:45 2018

@author: Yamazaki Kenichi
"""

N,P = map(int, input().split())

limit = int(pow(P,1/N)//1+1)

if N == 1:
    ans = P
else:
    ans = 1
    for i in range(2,limit):
        if P % pow(i,N) == 0:
            ans = i

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 31 14:30:45 2018

@author: Yamazaki Kenichi
"""

N,P = map(int, input().split())

limit = int(pow(P,1/N)//1+1)

if N == 1:
    ans = P
else:
    ans = 1
    for i in range(1,limit+1):
        if P % pow(i,N) == 0:
            ans = i
            print(ans)
    
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 31 14:30:45 2018

@author: Yamazaki Kenichi
"""

N,P = map(int, input().split())

limit = int(pow(P,1/N)//1+1)

if N == 1:
    ans = P
else:
    ans = 1
    for i in range(1,limit):
        if P % pow(i,N) == 0:
            ans = i
    
print(ans)

Submission status: Wrong Answer

Solution code:
line = raw_input()
line = line.split(" ")
N,P = line
N = int(N)
P = int(P)
     
     
i = int((P*1.0)**(1/(N*1.0)))
while True:
    if P%(i**N) == 0:
        print i
        break
    i -= 1

Submission status: Wrong Answer

Solution code:
line = raw_input()
line = line.split(" ")
N,P = line
N = int(N)*1.0
P = int(P)*1.0


i = int(P**(1/N))
while True:
    if P%(i**N) == 0:
        print i
        break
    i -= 1

Submission status: Wrong Answer

Solution code:
n,p = map(int,input().split())
flist = []
pp = p
alist = []
for i in range(2,n+1):
  while pp % i == 0:
    flist.append(i)
    pp = pp / i
for i in range(p+1):
  if flist.count(i) >= n:
    alist.append(flist.count(i)//n)
if alist == 0:
  ans = 0
else:
  ans = 1
  for i in alist:
    ans *= i
print(ans)

Submission status: Wrong Answer

Solution code:
import collections

n, p = [int(i) for i in input().split()]
d = collections.defaultdict(lambda: 0)

def bunkai(q):
	if q == 1:
		return 0
	for i in range(2,p):
		if q % i == 0:
			d[i] += 1
			return bunkai(q//i)


if n == 1 or p == 1:
	print(p)
else:
	bunkai(p)
	ans = 1

	for j in d.keys():
		k = d[j]
		if k >= n:
			ans *= j
	print(ans)

Submission status: Wrong Answer

Solution code:
n,p = map(int,input().split())
m=int(pow(p,1/n))
m+=1

for i in range(m,0,-1):
    if p%i == 0:
        print(i)
        break

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
i=2
if N==1:
  print(P)
  exit()
if N>=40 or P==1:
  print(1)
  exit()
  
while i<=(P**(1.0/N)):
  while P%(i**N) == 0:
    ans *= i
    P = P//(i**N)
  if i==2:
    i+=1
  else:
    i+=2
print(ans)

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
i=2
if N==1:
  print(P)
  exit()
if N>=40 or P==1:
  print(1)
  exit()
  
while i<=(P**(-(1//N))):
  while P%(i**N) == 0:
    ans *= i
    P = P//(i**N)
  if i==2:
    i+=1
  else:
    i+=2
print(ans)

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
i=2
if N==1:
  print(P)
  exit()
if N>=40 or P==1:
  print(1)
  exit()
  
while i<=(P**(1/N)):
  while P%(i**N) == 0:
    ans *= i
    P = P//(i**N)
  if i==2:
    i+=1
  else:
    i+=2
print(ans)

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
i=2
if N==1:
  print(P)
  exit()
if N>=40 or P==1:
  print(1)
  exit()
  
while i<=P**(1/N):
  while P%(i**N) == 0:
    ans *= i
    P = P//(i**N)
  if i==2:
    i+=1
  else:
    i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
i=2
if N==1:
  print(P)
  exit()
if N>=40 or P==1:
  print(1)
  exit()
  
while i<=P**(1/N):
  while P%(i**N) == 0:
    P = P//(i**N)
    ans*=i
  if i==2:
    i+=1
  else:
    i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    while P%(i**N) == 0:
      P = P//(i**N)
      ans*=i
    i+=1
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    while P%(i**N) == 0:
      P = P//(i**N)
      ans*=i
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=int(P/i)
      count+=1
    ans*=pow(i,count//N)
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=int(P/i)
      count+=1
    cn=int(count/N)
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=int(P/i)
      count+=1
    cn=-(count//N)
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(ans)
exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=int(P/i)
      count+=1
    cn=count//N
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(ans)
exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P/i
      count+=1
    cn=count//N
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(ans)
exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
      print(P)
    cn=count//N
    print(cn)
    ans*=i**cn
    print(ans)
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P/i
      count+=1
    cn=count//N
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))
exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
      print(P)
      print(count)
    cn=count//N
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P/i
      count+=1
    cn=count//N
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P/i
      count+=1
      print(P)
    cn=count//N
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P/=i
      count+=1
    cn=count/N
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))
exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P/=i
      count+=1
    cn=count//N
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P/=i
      count+=1
      print(P)
    cn=count//N
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
i=2
while i<=P**(1/N):
  count = 0
  while P%i==0:
    P=P//i
    count+=1
  cn=count//N
  ans*=i**cn
  if i==2:
    i+=1
  else:
    i+=2
print(int(ans))
exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
    cn=count//N
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))
exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1 or N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
    cn=count//N
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))
exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
    cn=count//N
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))
exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1|N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
    cn=count//N
    ans*=i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))
exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1|N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
    cn=count//N
    ans*= pow(i,cn)
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))
exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1|N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
    cn=count//N
    ans*= i**cn
    i+=1
print(int(ans))
exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()
elif P==1|N>=40:
  print(1)
  exit()
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
    cn=count//N
    ans*= i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))
exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
elif P==1|N>=40:
  print(1)
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
    cn=count//N
    ans*= i**cn
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
elif P==1|N>=40:
  print(1)
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
    ans*=pow(i,count//N)
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
elif P==1|N>=40:
  print(1)
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
    ans*=i**(count//N)
    if i==2:
      i+=1
    else:
      i+=2
print(int(ans))

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
elif P==1|N>=40:
  print(1)
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
    ans*=i**(count//N)
    if i==2:
      i+=1
    else:
      i+=2
print(ans)

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
elif P==1|N>=40:
  print(1)
else:
  i=2
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
    if count%N==0:
      ans*=i**(count//N)
    if i==2:
      i+=1
    else:
      i+=2
  print(ans)

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
i=2
if N==1|N>=40:
  print(P)
elif P==1:
  print(1)
else:
  while i<=P**(1/N):
    count = 0
    while P%i==0:
      P=P//i
      count+=1
    if count%N==0:
      ans*=i**(count//N)
    if i==2:
      i+=1
    else:
      i+=2
  print(ans)

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
i=2
count = 0
if N==1|N>=40:
  print(P)
elif P==1:
  print(1)
else:
  while i<=P**(1/N):
    while P%i==0:
      P=P//i
      count+=1
    if count%N==0:
      ans*=i**(count//N)
    if i==2:
      i+=1
    else:
      i+=2
  print(ans)

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
i=2
count = 0
if N==1|N>=40:
  print(P)
  exit()
elif P==1:
  print(1)
  exit()
else:
  while i<=P**(1/N):
    while P%i==0:
      P=P//i
      count+=1
    if count%N==0:
      ans*=i**(count//N)
    if i==2:
      i+=1
    else:
      i+=2
  print(ans)
  exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
i=2
count = 0
if N==1|N>=40:
  print(P)
  exit()
elif P==1:
  print(1)
  exit()
else:
  while i<=P**(1/N):
    while P%i==0:
      P=P//i
      count+=1
    if count%N==0:
      ans*=i**(count//N)
    if i==2:
      i+=1
    else:
      i+=2
    print(ans)
    exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
ans=1
i=2
count = 0
if N==1|N>=40:
  print(P)
  exit()
elif P==1:
  print(1)
  exit()
else:
  while i*i<=P:
    while P%i==0:
      P=P//i
      count+=1
    ans*=i**(count//N)
    if i==2:
      i+=1
    else:
      i+=2
    print(ans)
    exit()

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
i = int(P**(1/N))
res = []
if N == 1:
  print(P)
elif P == 1:
  print(1)
else:
  for i in range(i,0,-1):
    if P%i**N==0:
      print(i)
      break

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
i = int(P**(1/N))
res = []
if N == 1:
  print(P)
elif P == 1:
  print(1)
else:
  for i in range(i,0,-1):
    if P%i**N==0:
      print(i)

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
i = int(P**(1/N))
res = []
if N == 1:
  print(P)
elif P == 1:
  print(1)
else:
  for i in range(i,0,-1):
    print(i)
    if P%i**N==0:
      print(i)
      break

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
i = int(P**(1/N))
res = []
if N == 1:
  print(P)
elif P == 1:
  print(1)
else:
  for i in range(i,1,-1):
    if P%i**N==0:
      print(i)
      break

Submission status: Wrong Answer

Solution code:
N,P = map(int,input().split())
flag = False
i = int(P**(1/N))
res = []
if N == 1:
  print(P)
elif P == 1:
  print(1)
else:
  for i in range(i,1,-1):
    if P%i**N==0:
      print(i)
      break

Submission status: Wrong Answer

Solution code:
import functools
import operator

N,P = map(int,input().split())
flag = False
i = int(P**(1/N))
res = []
if N == 1:
  print(P)
elif P == 1:
  print(1)
else:
  for i in range(i,1,-1):
    if P%i**N==0:
      print(i)
      break

Submission status: Wrong Answer

Solution code:
def isprime(n):
    if(n==2 or n==3):
        return True
    if(n<=1):
        return False
    if(n%2==0 or n%3==0):
        return False
    x=5
    while(x*x<=n):
        if(n%x==0 or n%(x+2)==0):
            return False
        x+=6
    return True
n,p=map(int,input().split())
if(n==1):
    print(p)
else:
    ans=0
    for i in range(2,int(p**0.5)+1,1):
        num=p
        count=0
        while(num%i==0):
            num=num//i
            count+=1
        if(count>=n):
            ans=i
    print(ans)

Submission status: Wrong Answer

Solution code:
def isprime(n):
    if(n==2 or n==3):
        return True
    if(n<=1):
        return False
    if(n%2==0 or n%3==0):
        return False
    x=5
    while(x*x<=n):
        if(n%x==0 or n%(x+2)==0):
            return False
        x+=6
    return True
n,p=map(int,input().split())
if(isprime(p) or p==1):
    print(p)
elif(n==1):
    print(p)
else:
    ans=0
    for i in range(2,int(p**0.5)+1,1):
        num=p
        count=0
        while(num%i==0):
            num=num//i
            count+=1
        if(count>=n):
            ans=i
    print(ans)

Submission status: Wrong Answer

Solution code:
def isprime(n):
    if(n==2 or n==3):
        return True
    if(n<=1):
        return False
    if(n%2==0 or n%3==0):
        return False
    x=5
    while(x*x<=n):
        if(n%x==0 or n%(x+2)==0):
            return False
        x+=6
    return True
n,p=map(int,input().split())
if(isprime(p) or p==1):
    print(p)
elif(n==1):
    print(p)
else:
    ans=0
    for i in range(2,int(p**0.5)+2,1):
        num=p
        count=0
        while(num%i==0):
            num=num//i
            count+=1
        if(count>=n):
            ans=i
    print(ans)

Submission status: Wrong Answer

Solution code:
import functools
import operator

N,P = map(int,input().split())

i = 2
res = []
if N == 1:
  print(P)
else:
  while i <= P**0.5:
    while P % i**N == 0:
      P /= i**N
      res.append(i)
    else:
      if i == 2:
        i += 1
      else:
        i += 2
    
    
res.append(1)
result = functools.reduce(operator.mul, res)
print(result)

Submission status: Wrong Answer

Solution code:
import functools
import operator

N,P = map(int,input().split())

i = 2
res = []

while i <= P**0.5:
  while P % i**N == 0:
    P /= i**N
    res.append(i)
  else:
    if i == 2:
      i += 1
    else:
      i += 2
    
    
res.append(1)
result = functools.reduce(operator.mul, res)
print(result)

Submission status: Wrong Answer

Solution code:
import functools
import operator

N,P = map(int,input().split())

i = 2
res = []
i_2 = i**N
while i * i<=P:
  while P%i_2==0:
    P/=i_2
    res.append(i)
  else:
    i += 1
    
res.append(1)
result = functools.reduce(operator.mul, res)
print(result)

Submission status: Wrong Answer

Solution code:
import functools
import operator

N,P = map(int,input().split())

i = 2
res = []

while i<=P**0.5:
  while P%i**N==0:
    P/=i**N
    res.append(i)
  else:
    i += 1
    
res.append(1)
result = functools.reduce(operator.mul, res)
print(result)

Submission status: Wrong Answer

Solution code:
import collections
from functools import reduce
from operator import mul
N,P = map(int,input().split())

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

P = prime_decomposition(P)
c = collections.Counter(P)
temp = [i[0] for i in c.items() if i[1] >= N]
 
temp.append(1)
 
print(int(reduce(mul,temp)))

Submission status: Wrong Answer

Solution code:
from collections import Counter
from functools import reduce
from operator import mul
 
N,P = map(int,input().split())
i = 2
 
table = []
 
while i * i <= P:
 
  while P % i == 0:
 
    P /= i
 
    table.append(i)
 
  i += 1
 
if P > 1:
 
  table.append(P)
 
            
 
c = Counter(table)
 
temp = [i[0] for i in c.items() if i[1] >= N]
 
temp.append(1)
 
print(int(reduce(mul,temp)))

Submission status: Wrong Answer

Solution code:
from itertools import accumulate
import operator

N,P = map(int,input().split())
i = 2
res = []

while P>=i**N:
  while P % i == 0:
    P /= i**N
    res.append(i)
  else:
    i += 1
res = list(accumulate(res,func = operator.mul))
if res == []:
  res.append(1)
print(res[-1])

Submission status: Wrong Answer

Solution code:
from itertools import accumulate
import operator

N,P = map(int,input().split())
i = 2
res = []

while P>=i**N:
  while P % i == 0:
    P /= i**N
    res.append(i)
  else:
    i += 1

res = list(accumulate(res,func = operator.mul))
if res == []:
  res.append(1)
print(res[-1])

Submission status: Wrong Answer

Solution code:
from itertools import accumulate
import operator

N,P = map(int,input().split())
i = int(P**(1/2))
res = []

while P>=i**N:
  if P % i ** N == 0:
    P /= i**N
    res.append(i)
    i += 1
  else:
    i -= 1
  
res = list(accumulate(res,func = operator.mul))
if res == []:
  res.append(1)
print(res[-1])

Submission status: Wrong Answer

Solution code:
from itertools import accumulate
import operator

N,P = map(int,input().split())
i = 2
res = []

while P>=i**N:
  if P % i ** N == 0:
    P /= i**N
    res.append(i)
    i += 1
  else:
    i += 1
  
res = list(accumulate(res,func = operator.mul))
if res == []:
  res.append(1)
print(res[-1])

Submission status: Wrong Answer

Solution code:
n,p=map(int,input().split())
 
def C(N,P):
    if N == 1: return P
    a=P**(1/N)
 
    p = 2
    p_list={}
    
    while a >= p :
        while P % p == 0:
            P /= p
            if p in p_list:
                p_list[p]+=1
            else:
                p_list[p]=1
        p+=1
        
    res=1
    for b,c in p_list.items() :
        if c >= N : res *= b * int(c/N)
    return res
 
print(C(n,p))

Submission status: Wrong Answer

Solution code:
n,p=map(int,input().split())
 
def C(N,P):
    if N == 1: return P
    a=P**(1/N)

    p = 2
    p_list={}
    
    while a >= p :
        if P % p == 0:
            P /= p
            if p in p_list:
                p_list[p]+=1
            else:
                p_list[p]=1
        else :
            p+=1
    res=1
    for b,c in p_list.items() :
        if c >= N : res *= b * int(c/N)
    return res
 
print(C(n,p))

Submission status: Wrong Answer

Solution code:
n,p=map(int,input().split())
 
def C(N,P):
    if N == 1: return P
    a=P**(1/N)
    if a == int(a): return a
    
    a = int(a)
    p = 2
    p_list={}
    
    while a >= p :
        if P % p == 0:
            P /= p
            if p in p_list:
                p_list[p]+=1
            else:
                p_list[p]=1
        else :
            p+=1
    res=1
    for b,c in p_list.items() :
        if c >= N : res *= b * int(c/N)
    return res
 
print(C(n,p))

Submission status: Wrong Answer

Solution code:
n,p=map(int,input().split())
 
def C(N,P):
    if N == 1: return P
    a=P**(1/N)
    if a == int(a): return a
    
    a = int(a)
    p = 2
    p_list={}
    
    while a >= p :
        if a % p == 0:
            a /= p
            if p in p_list:
                p_list[p]+=1
            else:
                p_list[p]=1
        else :
            p+=1
    res=1
    for b,c in p_list.items() :
        if c >= N : res *= b * int(c/N)
    return res
 
print(C(n,p))

Submission status: Wrong Answer

Solution code:
import math

def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(int(n))
  return table


cnt=1
gcd=1
b,p=map(int,input().split())
a=prime_decomposition(p)

if b==1:
  print(p)

if b>1:
  l=len(a)
  if l==1:
    print(1)
  else:
    for i in range(l-1):
      if a[i+1]==a[i]:
        cnt+=1
        if cnt==b:
          gcd*=a[i]
          cnt=1
      else:
        cnt=1
    print(gcd)

Submission status: Wrong Answer

Solution code:
n,p=map(int,input().split())
 
def C(N,P):
    if N == 1: return P
    a=P**(1/N)
    if a == int(a): return a
    
    a = int(a)+1
    p = 2
    p_list={}
    
    while a >= p :
        if a % p == 0:
            a /= p
            if p in p_list:
                p_list[p]+=1
            else:
                p_list[p]=1
        else :
            p+=1
    res=1
    for b,c in p_list.items() :
        if c >= N : res *= int(b/N)
    return res
 
print(C(n,p))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
n,p = list(map(int,input().split())) 
i = a = o = 1
m = math.floor(p**(1/n))
for i in range(m,0,-1):
    a = i**n
    if p%a==0:
        print(i)
        exit()

Submission status: Wrong Answer

Solution code:
N, P = map(int, input().split())
if N > 40:
  print(1)
  exit()
for i in range(P):
  if i**N > P:
    print(i-1)
    exit()

Submission status: Wrong Answer

Solution code:
N, P = map(int, input().split())
ok = 1
ng = P+1
while ng-ok > 1:
  mid = (ok+ng) // 2
  if mid ** N > P:
    ng = mid
  else:
    ok = mid
print(ok)

Submission status: Wrong Answer

Solution code:
N, P = map(int, input().split())
ok = 0
ng = 1000000000000
while ng-ok > 1:
  mid = (ok+ng) // 2
  if mid ** N > P:
    ng = mid
  else:
    ok = mid
print(ok)

Submission status: Wrong Answer

Solution code:
n, p = map(int, input().split())
if n == 1 or p== 1:
    print(p)
    exit()
c2 = 0
while p%2 == 0:
    c2 += 1
    p//=2
c = 2**(c2//n)
i = int(p**(1/n))
if i%2 == 0:
    i -= 1
while i > 1:
    if p%(i**n) == 0:
        print(c*i)
        exit()
    else:
        i -= 2
print(c)