Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
def poly_divide(f, g):
    n = len(g)
    a, b = f
    q = np.zeros(n-1, dtype = np.int64)
    r = 0
    q[-1] = g[-1]*inv[b%p]%p
    for i in range(n-2)[::-1]:
        q[i] = (g[i+1]-q[i+1]*a)*inv[b%p]%p
    r = g[0]-q[0]
    return q, r
  
def poly_product(f, g):
    n, m = len(f), len(g)
    res = np.zeros(n+m-1, dtype = np.int64)
    for i in range(n):
        res[i:i+m]+=g*f[i]
        res%=p
    return res
def assign(f, x):
    tmp = 1
    res = 0
    n = len(f)
    for i in range(n):
        res+=f[i]*tmp
        tmp*=x
        tmp%=p
        res%=p
    return res


p = int(input())
a = list(map(int, input().split()))
inv = [0]*p
P = np.ones(1, dtype = np.int64)
for i in range(p):
    inv[i] = pow(i, p-2, p)
for i in range(p):
    b = np.array([-i, 1], dtype = np.int64)
    P = poly_product(b, P)
R = np.zeros(p, dtype = np.int64)
for i in range(p):
    b = np.array([-i, 1], dtype = np.int64)
    Q, _ = poly_divide(b, P)
    v = assign(Q, i)
    R+=Q*inv[v%p]*a[i]
    R%=p
print(*R)
    
    







Fixed submission:

def poly_divide(f, g):
    n = len(g)
    a, b = f
    q = [0]*(n-1)
    r = 0
    q[-1] = g[-1]*inv[b%p]%p
    for i in range(n-2)[::-1]:
        q[i] = (g[i+1]-q[i+1]*a)*inv[b%p]%p
    r = g[0]-q[0]
    return q, r
  
def poly_product(f, g):
    n, m = len(f), len(g)
    res = [0]*(n+m-1)
    for i in range(n):
        for j in range(m):
            res[i+j]+=g[j]*f[i]
            res[i+j]%=p
    return res
def assign(f, x):
    tmp = 1
    res = 0
    n = len(f)
    for i in range(n):
        res+=f[i]*tmp
        tmp*=x
        tmp%=p
        res%=p
    return res
def c_mul(c, f):
    n = len(f)
    for i in range(n):
        f[i]*=c
        f[i]%=p
    return f
def poly_add(f, g):
    n = len(g)
    for i in range(n):
        f[i]+=g[i]
        f[i]%=p
    return f


p = int(input())
a = list(map(int, input().split()))
inv = [0]*p
P = [1]
for i in range(p):
    inv[i] = pow(i, p-2, p)
for i in range(p):
    b = [-i, 1]
    P = poly_product(b, P)
R = [0]*p
for i in range(p):
    b = [-i, 1]
    Q, _ = poly_divide(b, P)
    v = assign(Q, i)
    Q=c_mul(inv[v%p]*a[i], Q)
    R = poly_add(R, Q)
print(*R)

Buggy python submission (verdict: Runtime Error):
import numpy as np
p = int(input())
a =list(map(int, input().split()))
Q = [0]*p
R = [0]*p

for i in range(p):
    R[i] = pow(i, p-2, p)
for i in range(p):
    res = 1
    for j in range(p):
        if i==j:
            continue
        res*=i-j
    Q[i] = a[i]*R[res%p]
C = [0]*(p+1)
C[0] = 1
for i in range(p):
    for j in range(i+1)[::-1]:
        C[j+1] += C[j]
        C[j] = -i*C[j]
ans = np.poly1d([0])
for i in range(p):
    ans += np.poly1d(C[::-1])/np.poly1d([1, -i])*np.poly1d([Q[i]])
res = ans[1]
res = list(map(lambda x:int(x)%p, res))
print(*res[::-1])

Fixed submission:

def poly_divide(f, g):
    n = len(g)
    a, b = f
    q = [0]*(n-1)
    r = 0
    q[-1] = g[-1]*inv[b%p]%p
    for i in range(n-2)[::-1]:
        q[i] = (g[i+1]-q[i+1]*a)*inv[b%p]%p
    r = g[0]-q[0]
    return q, r
  
def poly_product(f, g):
    n, m = len(f), len(g)
    res = [0]*(n+m-1)
    for i in range(n):
        for j in range(m):
            res[i+j]+=g[j]*f[i]
            res[i+j]%=p
    return res
def assign(f, x):
    tmp = 1
    res = 0
    n = len(f)
    for i in range(n):
        res+=f[i]*tmp
        tmp*=x
        tmp%=p
        res%=p
    return res
def c_mul(c, f):
    n = len(f)
    for i in range(n):
        f[i]*=c
        f[i]%=p
    return f
def poly_add(f, g):
    n = len(g)
    for i in range(n):
        f[i]+=g[i]
        f[i]%=p
    return f


p = int(input())
a = list(map(int, input().split()))
inv = [0]*p
P = [1]
for i in range(p):
    inv[i] = pow(i, p-2, p)
for i in range(p):
    b = [-i, 1]
    P = poly_product(b, P)
R = [0]*p
for i in range(p):
    b = [-i, 1]
    Q, _ = poly_divide(b, P)
    v = assign(Q, i)
    Q=c_mul(inv[v%p]*a[i], Q)
    R = poly_add(R, Q)
print(*R)