Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from numba import njit

@njit('i8(i8,i4[:,:],i8[:,:],i8)', cache=True)
def solve(N, aff, dpt, MOD):
    for i in range(N):
        row = aff[i]
        for idx in range(N):
            if row[idx] == 1:
                dpt[i+1][(1<<idx):] += dpt[i][:-(1<<idx)]
        dpt[i+1] %= MOD
    return dpt[N][(1<<N)-1]

def main():
    MOD = 10**9 + 7
 
    N = int(input())
    aff = np.array([list(map(int, input().split())) for i in range(N)], dtype='int32')
    dpt = np.zeros((N+1, 1<<N), dtype='int64')
    dpt[0][0] = 1

    print(solve(N, aff, dpt, MOD))


if __name__ == '__main__':
    main()

Fixed submission:
import numpy as np

MOD = 10**9 + 7
 
N = int(input())
aff = np.array([map(int, input().split()) for i in range(N)])
dpt = np.zeros((N+1, 1<<N), dtype='int64')
dpt[0][0] = 1

for i, row in enumerate(aff):
    for idx, v in enumerate(row):
        if v == 1:
            dpt[i+1][(1<<idx):] += dpt[i][:-(1<<idx)]
    dpt[i+1] %= MOD

print(dpt[N][(1<<N)-1])

Buggy python submission (verdict: Runtime Error):
import numpy as np
from numba import njit

@njit('i8(i8,i4[:,:],i8[:,:],i8)', cache=True)
def solve(N, aff, dpt, MOD):
    for i, row in enumerate(aff):
        for idx, v in enumerate(row):
            if v == 1:
                dpt[i+1][(1<<idx):] += dpt[i][:-(1<<idx)]
        dpt[i+1] %= MOD
    return dpt[N][(1<<N)-1]

def main():
    MOD = 10**9 + 7
 
    N = int(input())
    aff = np.array([list(map(int, input().split())) for i in range(N)], dtype='int32')
    dpt = np.zeros((N+1, 1<<N), dtype='int64')
    dpt[0][0] = 1

    print(solve(N, aff, dpt, MOD))


if __name__ == '__main__':
    main()

Fixed submission:
import numpy as np

MOD = 10**9 + 7
 
N = int(input())
aff = np.array([map(int, input().split()) for i in range(N)])
dpt = np.zeros((N+1, 1<<N), dtype='int64')
dpt[0][0] = 1

for i, row in enumerate(aff):
    for idx, v in enumerate(row):
        if v == 1:
            dpt[i+1][(1<<idx):] += dpt[i][:-(1<<idx)]
    dpt[i+1] %= MOD

print(dpt[N][(1<<N)-1])

Buggy python submission (verdict: Runtime Error):
import numpy as np
from numba import njit
MOD = 10**9 + 7

def main():
 
    N = int(input())
    aff = np.array([list(map(int, input().split())) for i in range(N)], dtype='int32')
    dpt = np.zeros((N+1, 1<<N), dtype='int64')
    dpt[0][0] = 1

    print(solve(N, aff, dpt))

@njit(cache=True)
def solve(N, aff, dpt):
    for i, row in enumerate(aff):
        for idx, v in enumerate(row):
            if v == 1:
                dpt[i+1][(1<<idx):] += dpt[i][:-(1<<idx)]
        dpt[i+1] %= MOD
    return dpt[N][(1<<N)-1]

if __name__ == '__main__':
    main()

Fixed submission:
import numpy as np

MOD = 10**9 + 7
 
N = int(input())
aff = np.array([map(int, input().split()) for i in range(N)])
dpt = np.zeros((N+1, 1<<N), dtype='int64')
dpt[0][0] = 1

for i, row in enumerate(aff):
    for idx, v in enumerate(row):
        if v == 1:
            dpt[i+1][(1<<idx):] += dpt[i][:-(1<<idx)]
    dpt[i+1] %= MOD

print(dpt[N][(1<<N)-1])

Buggy python submission (verdict: Runtime Error):
import numpy as np
from numba import njit
MOD = 10**9 + 7

def main():
 
    N = int(input())
    aff = np.array([list(map(int, input().split())) for i in range(N)], dtype='int32')
    dpt = np.zeros((N+1, 1<<N), dtype='int64')
    dpt[0][0] = 1

    print(solve(N, aff, dpt))

@njit('i8(i8,i4[:,:],i8[:,:])', cache=True)
def solve(N, aff, dpt):
    for i, row in enumerate(aff):
        for idx, v in enumerate(row):
            if v == 1:
                dpt[i+1][(1<<idx):] += dpt[i][:-(1<<idx)]
        dpt[i+1] %= MOD
    return dpt[N][(1<<N)-1]

if __name__ == '__main__':
    main()

Fixed submission:
import numpy as np

MOD = 10**9 + 7
 
N = int(input())
aff = np.array([map(int, input().split()) for i in range(N)])
dpt = np.zeros((N+1, 1<<N), dtype='int64')
dpt[0][0] = 1

for i, row in enumerate(aff):
    for idx, v in enumerate(row):
        if v == 1:
            dpt[i+1][(1<<idx):] += dpt[i][:-(1<<idx)]
    dpt[i+1] %= MOD

print(dpt[N][(1<<N)-1])