Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, P = map(int, input().split())

    left = 0
    right = 10**12
    while left + 1 < right:
        mid = (left + right) // 2
        if mid**N <= P:
            left = mid
        else:
            right = mid

    cnt = 0
    for j in range(left, 0, -1):
        if P % (j**N) == 0:
            print(j)
            break
        else:
            cnt += 1

    j = left
    cnt = 0
    while P % (j**N) != 0:
        cnt += 1
        j = left // cnt


main()


Fixed submission:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def main():
    N, P = map(int, input().split())
    A = factorization(P)

    B = []
    for a, b in A:
        if b >= N:
            B.append((a, b // N))

    ans = 1
    for a, b in B:
        ans *= a**b
    print(ans)


main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, P = map(int, input().split())

    left = 0
    right = 10**12
    while left + 1 < right:
        mid = (left + right) // 2
        if mid**N <= P:
            left = mid
        else:
            right = mid

    for j in range(left, 0, -1):
        if P % j**N == 0:
            print(j)
            break


main()


Fixed submission:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def main():
    N, P = map(int, input().split())
    A = factorization(P)

    B = []
    for a, b in A:
        if b >= N:
            B.append((a, b // N))

    ans = 1
    for a, b in B:
        ans *= a**b
    print(ans)


main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys


def main():
    N, P = map(int, input().split())

    left = 0
    right = 10**12
    while left + 1 < right:
        mid = (left + right) // 2
        if mid**N <= P:
            left = mid
        else:
            right = mid

    for j in range(left, 0, -1):
        if P % j**N == 0:
            print(j)
            break


main()


Fixed submission:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def main():
    N, P = map(int, input().split())
    A = factorization(P)

    B = []
    for a, b in A:
        if b >= N:
            B.append((a, b // N))

    ans = 1
    for a, b in B:
        ans *= a**b
    print(ans)


main()

Buggy python submission (verdict: Runtime Error):
import sys


def main():
    N, P = map(int, input().split())

    i = 0
    while i**N <= P:
        i += 1

    i -= 1

    for j in range(i, 0, -1):
        if P % j**N == 0:
            print(j)
            sys.exit()


main()


Fixed submission:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def main():
    N, P = map(int, input().split())
    A = factorization(P)

    B = []
    for a, b in A:
        if b >= N:
            B.append((a, b // N))

    ans = 1
    for a, b in B:
        ans *= a**b
    print(ans)


main()

Buggy python submission (verdict: Runtime Error):
def main():
    N, P = map(int, input().split())

    i = 0
    while i**N <= P:
        i += 1

    i -= 1

    for j in range(i, 0, -1):
        if P % j**N == 0:
            print(j)
            break


main()


Fixed submission:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def main():
    N, P = map(int, input().split())
    A = factorization(P)

    B = []
    for a, b in A:
        if b >= N:
            B.append((a, b // N))

    ans = 1
    for a, b in B:
        ans *= a**b
    print(ans)


main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, P = map(int, input().split())

    i = 0
    while i**N <= P:
        i += 1

    i -= 1

    for j in range(i, 0, -1):
        if P % j**N == 0:
            print(j)
            break


main()


Fixed submission:
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


def main():
    N, P = map(int, input().split())
    A = factorization(P)

    B = []
    for a, b in A:
        if b >= N:
            B.append((a, b // N))

    ans = 1
    for a, b in B:
        ans *= a**b
    print(ans)


main()