Problem p03194 (python)

Fixed submission:
N,P = map(int,input().split())
i = round(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

Buggy submission (verdict: Runtime Error):
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.1/N)):
  while P%(i**N) == 0:
    ans *= i
    P = P//(i**N)
  if i==2:
    i+=1
  else:
    i+=2
print(ans)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.1/N)):
  while P%(i**N) == 0:
    ans *= i
    P = P//(i**N)
  if i==2:
    i+=1
  else:
    i+=2
print(ans)

Buggy submission (verdict: Runtime Error):
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**(N/1)):
  while P%(i**N) == 0:
    ans *= i
    P = P//(i**N)
  if i==2:
    i+=1
  else:
    i+=2
print(ans)

Buggy submission (verdict: Runtime Error):
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+=1N,P = map(int,input().split())
ans=1
if N==1:
  print(P)
  exit()

Buggy submission (verdict: Runtime Error):
N,P = map(int,input().split())
ans=1
if N==1|N>=40:
  print(P)
  exit()
elif P==1:
  print(1)
  exit()
else:
  i=2
  while(i*i<=P):	
	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)

Buggy submission (verdict: Runtime Error):
N,P = map(int,input().split())
i = round(P**(1/N))
j = 2
res = 1
if N == 1:
  print(P)
  break
elif P == 1|N>=40:
  print(1)
  break
else:
  while P%(j**N)==0:
    P = P//(j**N)
    res *= j
  j += 1
  for f in range(j,i+1,2):
    while P%(f**N) == 0:
      P = P//(f**N)
      res *= f
      
  print(res)
  break

Buggy submission (verdict: Runtime Error):
import functools
import operator

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

i = 2
res = []
if N == 1:
  print(P)
elif P == 1:
  print(1)
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
  result = functools.reduce(operator.mul, res)
  print(result)

Buggy submission (verdict: Runtime Error):
import functools
import operator

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

i = 2
res = []
if N == 1:
  print(P)
elif P == 1:
  print(1)
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
    
    
result = functools.reduce(operator.mul, res)
print(result)

Buggy submission (verdict: Runtime Error):
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)

Buggy submission (verdict: Runtime Error):
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
    
result.append(1)
result = functools.reduce(operator.mul, res)
print(result)

Buggy submission (verdict: Runtime Error):
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
    
result = functools.reduce(operator.mul, res)
print(result)

Buggy submission (verdict: Runtime Error):
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
    
print(res)
result = functools.reduce(operator.mul, res)
print(result)

Buggy submission (verdict: Runtime Error):
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)))

Buggy submission (verdict: Runtime Error):
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]
if temp == []:
  temp.append(1)
print(int(reduce(lambda x,y:x*y,temp)))

Buggy submission (verdict: Runtime Error):
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]

if temp == []:

  temp.append(1)

print(int(reduce(lambda x,y:x*y,temp)))

Buggy submission (verdict: Runtime Error):
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

M = prime_decomposition(P)
            
c = Counter(M)
temp = [i[0] for i in c.items() if i[1] >= N]
if temp == []:
  temp.append(1)
print(int(reduce(lambda x,y:x*y,temp)))

Buggy submission (verdict: Runtime Error):
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

M = prime_decomposition(P)
            
c = Counter(M)
temp = [i[0] for i in c.items() if i[1] >= N]
if temp == []:
  temp.append(1)
print(reduce(lambda x,y:x*y,temp))

Buggy submission (verdict: Runtime Error):
from functools import reduce
from collections import Counter
N,P = map(int,input().split())
import math
s=0
R=int(P)
L=[]
while s==0:
    for i in range(2,R+1):
        if P%i==0:
            P=P/i
            if P==1:
                s=1
            L.append(i)
            break

            
c = Counter(L)
temp = [i[0] for i in c.items() if i[1] >= N]
print(reduce(lambda x,y:x*y,temp))