Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    arr = np.array(arr)

    brr = []
    for i in range(1,2 ** 10):

        mask = np.zeros(10)
        for j in range(0, 10):
            m = i >> j & 1
            mask[9-j] = m
        s = np.count_nonzero(arr == mask)

        sum = 0
        for _i in range(n):
            sum = sum + prr[_i][s[_i]]

        brr.append(sum)


    return brr

result = calculate(N, ARR, PRR)
print(max(result))




Fixed submission:
n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    arr = np.array(arr)

    brr = []
    for i in range(1,2 ** 10):

        mask = np.zeros(10)
        for j in range(0, 10):
            m = i >> j & 1
            mask[9-j] = m
        s = np.count_nonzero((arr == mask) & (arr == 1))

        sum = 0
        for _i in range(n):
            sum = sum + prr[_i][s[_i]]

        brr.append(sum)


    return brr

result = calculate(N, ARR, PRR)
print(max(result))




Fixed submission:
n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    arr = np.array(arr)

    brr = []
    for i in range(1,2 ** 10):

        mask = np.zeros(10)
        for j in range(0, 10):
            m = i >> j & 1
            mask[9-j] = m
        s = np.count_nonzero((arr == mask) & (arr == 1),axis=1)

        sum = 0
        for _i in range(n):
            sum = sum + prr[_i][s[_i]]

        brr.append(sum)


    return [1]

result = calculate(N, ARR, PRR)
print(max(result))




Fixed submission:
n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    arr = np.array(arr)

    brr = []
    for i in range(1,2 ** 10):

        mask = np.zeros(10)
        for j in range(0, 10):
            m = i >> j & 1
            mask[9-j] = m
        s = np.count_nonzero((arr == mask) & (arr == 1),axis=1)

        sum = 0
        for _i in range(n):
            sum = sum + prr[_i][s[_i]]

        brr.append(sum)


    return brr

result = calculate(N, ARR, PRR)
print(max(result))




Fixed submission:
n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    return []

result = calculate(N, ARR, PRR)
print(max(result))



Fixed submission:
n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    

    return []

result = calculate(N, ARR, PRR)
print(max(result))



Fixed submission:
n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    arr = np.array(arr)


    return []

result = calculate(N, ARR, PRR)
print(max(result))



Fixed submission:
n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    arr = np.array(arr)

    brr = []
 
    return brr

result = calculate(N, ARR, PRR)
print(max(result))



Fixed submission:
n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    arr = np.array(arr)

    brr = []
    for i in range(1,2 ** 10):

       a = 1


    return brr

result = calculate(N, ARR, PRR)
print(max(result))



Fixed submission:
n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    arr = np.array(arr)

    brr = []
    for i in range(1,2 ** 10):

        mask = np.zeros(10)

    return brr

result = calculate(N, ARR, PRR)
print(max(result))



Fixed submission:
n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    arr = np.array(arr)

    brr = []
    for i in range(1,2 ** 10):

        mask = np.zeros(10)
        for j in range(0, 10):
            m = i >> j & 1
            mask[9-j] = m


    return brr

result = calculate(N, ARR, PRR)
print(max(result))



Fixed submission:
n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    arr = np.array(arr)

    brr = []
    for i in range(1,2 ** 10):

        mask = np.zeros(10)
        for j in range(0, 10):
            m = i >> j & 1
            mask[9-j] = m
        s = np.count_nonzero((arr == mask) & (arr == 1),axis=1)


    return brr

result = calculate(N, ARR, PRR)
print(max(result))



Fixed submission:
n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))

Buggy python submission (verdict: Runtime Error):
import numpy as np
N = int(input())

ARR = []

for i in range(N):
    ARR.append([int(s) for s in input().split(" ")])

PRR = []

for i in range(N):
    PRR.append([int(s) for s in input().split(" ")])

def calculate(n, arr, prr):
    arr = np.array(arr)

    brr = []
    for i in range(1,2 ** 10):

        mask = np.zeros(10)
        for j in range(0, 10):
            m = i >> j & 1
            mask[9-j] = m
        s = np.count_nonzero((arr == mask) & (arr == 1),axis=1)

        sum = 0
        for _i in range(n):
            sum = sum + prr[_i][s[_i]]

        brr.append(sum)


    return brr

result = calculate(N, ARR, PRR)
print(max(result))



Fixed submission:
n = int(input())

frr = []

for i in range(n):
    frr.append([int(s) for s in input().split(" ")])

prr = []

for i in range(n):
    prr.append([int(s) for s in input().split(" ")])

# n = 2
#
# frr = [
#     [1, 1, 1, 1, 1, 0, 0, 0, 0, 0],
#     [0, 0, 0, 0, 0, 1, 1, 1, 1, 1]
# ]
#
# prr = [
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1],
#     [0, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1]
# ]


res = []
for i in range(1,2 ** 10):
    count = [0 for s in range(n)]

    mask = []
    for j in range(10):
        m =  i >> j & 1
        mask.append(m)
        if m == 1:
            for k in range(n):
                if frr[k][j] == 1:
                    count[k] = count[k] + 1

    mm = []
    for index,c in enumerate(count):
        mm.append(prr[index][c])

    res.append(sum(mm))

print(max(res))