Buggy python submission (verdict: Time Limit Exceeded):
num,product = map(int,input().split())
order = len(str(product)) / num
cnt = round(10 ** order)
gcd = 1
while(cnt > 1):
    calc = cnt ** num
    if calc > product:
        cnt = cnt - 1
        continue
    if product % calc == 0:
        gcd = cnt
        break
    else:
        cnt = cnt - 1
print(gcd)

Fixed submission:
# -*- coding: utf-8 -*-
from collections import defaultdict
from math import sqrt,floor
num,product = map(int,input().split())
cnt = int(sqrt(product) + 2)
dd = defaultdict(int)

for i in range(2,cnt):
    if product % i == 0:
        a = 0
        while product % i == 0:
            a += 1
            product = product // i
        dd[i] = a
if product != 1:
    dd[product] =  1
ans = 1
for p,n in dd.items():
    ans *= pow(p,floor(n/num))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import math
num,product = map(int,input().split())
order = len(str(product)) / num

cnt = round(10 ** order)
gcd = 1
while(cnt > 1):
    calc = cnt ** num
    if product % calc == 0:
        gcd = cnt
        break
    else:
        cnt = cnt - 1
print(gcd)

Fixed submission:
# -*- coding: utf-8 -*-
from collections import defaultdict
from math import sqrt,floor
num,product = map(int,input().split())
cnt = int(sqrt(product) + 2)
dd = defaultdict(int)

for i in range(2,cnt):
    if product % i == 0:
        a = 0
        while product % i == 0:
            a += 1
            product = product // i
        dd[i] = a
if product != 1:
    dd[product] =  1
ans = 1
for p,n in dd.items():
    ans *= pow(p,floor(n/num))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
import math
num,product = map(int,input().split())
order = math.ceil(len(str(product)) / num)

cnt = 10 ** order
gcd = 1
while(cnt > 1):
    calc = cnt ** num
    if calc > product:
        cnt = cnt - 1
    elif product % calc == 0:
        gcd = cnt
        break
    else:
        cnt = cnt - 1
print(gcd)

Fixed submission:
# -*- coding: utf-8 -*-
from collections import defaultdict
from math import sqrt,floor
num,product = map(int,input().split())
cnt = int(sqrt(product) + 2)
dd = defaultdict(int)

for i in range(2,cnt):
    if product % i == 0:
        a = 0
        while product % i == 0:
            a += 1
            product = product // i
        dd[i] = a
if product != 1:
    dd[product] =  1
ans = 1
for p,n in dd.items():
    ans *= pow(p,floor(n/num))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
num,product = map(int,input().split())

cnt = 1
gcd = 1
while(True):
    cnt += 1
    calc = cnt ** num
    if calc > product:
        break
    elif product % calc == 0:
        gcd = cnt
    else:
        continue
print(gcd)

Fixed submission:
# -*- coding: utf-8 -*-
from collections import defaultdict
from math import sqrt,floor
num,product = map(int,input().split())
cnt = int(sqrt(product) + 2)
dd = defaultdict(int)

for i in range(2,cnt):
    if product % i == 0:
        a = 0
        while product % i == 0:
            a += 1
            product = product // i
        dd[i] = a
if product != 1:
    dd[product] =  1
ans = 1
for p,n in dd.items():
    ans *= pow(p,floor(n/num))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
num,product = map(int,input().split())

cnt = 1
gcd = 1
while(True):
    cnt += 1
    calc = cnt ** num
    if product % calc == 0:
        gcd = cnt
    elif calc > product:
        break
    else:
        continue
print(gcd)

Fixed submission:
# -*- coding: utf-8 -*-
from collections import defaultdict
from math import sqrt,floor
num,product = map(int,input().split())
cnt = int(sqrt(product) + 2)
dd = defaultdict(int)

for i in range(2,cnt):
    if product % i == 0:
        a = 0
        while product % i == 0:
            a += 1
            product = product // i
        dd[i] = a
if product != 1:
    dd[product] =  1
ans = 1
for p,n in dd.items():
    ans *= pow(p,floor(n/num))
print(ans)