qyliang/CodeNanoFix huggingface dataset:
Buggy code:
from itertools import product

N = int(input())
F = []
P = []
for _ in range(N):
    temp = list(map(int, input().split()))
    F.append([temp[:2], temp[2:4], temp[4:6], temp[6:8], temp[8:]])
for _ in range(N):
    P.append(list(map(int, input().split())))

prod = list(product((0, 1), (0, 1), (0, 1), (0, 1), (0, 1),
                    (0, 1), (0, 1), (0, 1), (0, 1), (0, 1)))
MAX = -float("inf")


def compute(pattern):
    x = 0
    for i in range(N):
        c = 0
        for j in range(5):
            for k in range(2):
                if pattern[j][k] == 1 and F[i][j][k] == 1:
                    c += 1
        x += P[i][c]
    return x


for e in prod:
    pattern = [e[:2], e[2:4], e[4:6], e[6:8], e[8:]]
    if pattern != [[0] * 2 for _ in range(5)]:
        MAX = max(compute(pattern), MAX)

print(MAX)


Fixed code:
from itertools import product

N = int(input())
F = []
P = []
for _ in range(N):
    temp = list(map(int, input().split()))
    F.append([temp[:2], temp[2:4], temp[4:6], temp[6:8], temp[8:]])
for _ in range(N):
    P.append(list(map(int, input().split())))

prod = list(product((0, 1), (0, 1), (0, 1), (0, 1), (0, 1),
                    (0, 1), (0, 1), (0, 1), (0, 1), (0, 1)))
MAX = -float("inf")


def compute(pattern):
    x = 0
    for i in range(N):
        c = 0
        for j in range(5):
            for k in range(2):
                if pattern[j][k] == 1 and F[i][j][k] == 1:
                    c += 1
        x += P[i][c]
    return x


del prod[0]
for e in prod:
    pattern = [e[:2], e[2:4], e[4:6], e[6:8], e[8:]]
    MAX = max(compute(pattern), MAX)

print(MAX)
Buggy code:
N = int(input())

F = [int(input().replace(" ",""),2) for _ in range(N)]
P = [list(map(int, input().split())) for _ in range(N)]


profit = float("-inf")

for i in range(1,1024):
	tmp = 0
	for j in range(N):
		if i & F[j] :
			tmp = tmp + 1
			tmp2 = P[tmp]
	profit = max(profit, tmp2)

print(profit)

Fixed code:
N = int(input())

F = [int(input().replace(" ", ""), 2) for _ in range(N)]
P = [list(map(int, input().split())) for _ in range(N)]


profit = float("-inf")

for i in range(1,1024):
	tmp = 0
	tmp2 = 0
	for j in range(N):
		tmp = (bin(i & F[j]).count('1'))
		tmp2 = tmp2 + P[j][tmp]
	profit = max(profit, tmp2)

print(profit)
Buggy code:
# encoding: utf-8
N = int(input())
F = [list(map(int, input().split())) for i in range(N)]
P = [list(map(int, input().split())) for i in range(N)]

def Fidx(i, j): return 2 * i + j

def bc10(num):
    num_tmp = num
    ret = 0
    for i in range(10):
        if num_tmp % 2: ret += 1
        num_tmp = num_tmp >> 1
    return ret

# re-arrange enemy infomation
F_mask = [0] * N
for i, F_row in enumerate(F): F_mask[i] += sum([(2 ** j) * item for j, item in enumerate(F_row)])

ans = - (10 ** 7) * N
for case in range(3 ** 5):
    # decide joisino-onechan's status
    joisino = 0
    case_tmp = case
    for i in range(5):
        joisino += ((case_tmp % 3 + 1) << (2 * i)) # 01, 10, 11
        case_tmp = case_tmp // 3
    # calc profit
    profit = 0
    for i, enemy in enumerate(F_mask): profit += P[i][bc10(joisino & enemy)]
    # update
    if ans < profit: ans = profit

print(ans)

Fixed code:
# encoding: utf-8
N = int(input())
F = [list(map(int, input().split())) for i in range(N)]
P = [list(map(int, input().split())) for i in range(N)]

def bc10(num):
    num_tmp = num
    ret = 0
    for i in range(10):
        if num_tmp % 2: ret += 1
        num_tmp = num_tmp >> 1
    return ret

# re-arrange enemy infomation
F_mask = [0] * N
for i, F_row in enumerate(F): F_mask[i] += sum([(2 ** j) * item for j, item in enumerate(F_row)])

ans = - (10 ** 7) * N
for case in range(1, 2 ** 10):
    # decide joisino-onechan's status
    joisino = 0
    case_tmp = case
    for i in range(10):
        joisino += (case_tmp % 2) << i
        case_tmp = case_tmp >> 1
    # calc profit
    profit = 0
    for i, enemy in enumerate(F_mask): profit += P[i][bc10(joisino & enemy)]
    # update
    # print("#", joisino, profit)
    if ans < profit: ans = profit

print(ans)
Buggy code:
import numpy as np

N = int(input())
F = [list(map(int, input().strip().split())) for i in range(N)]
P = [list(map(int, input().strip().split())) for i in range(N)]
maxProfit = 0



for i in range(1,1024):
    openTime = list(map(int, list("{:0>10}".format(bin(i)[2:]))))
    thisProfit = 0
    for n in range(N):
        shopOpneTime = F[n]
        shopProfit = P[n]
        counter = 0
        for j in range(10):
            if((shopOpneTime[j])and(openTime[j])):
                 counter += 1
        thisProfit += shopProfit[counter]
    maxProfit = max(thisProfit, maxProfit)

print(maxProfit)


Fixed code:
import numpy as np

N = int(input())
F = [list(map(int, input().strip().split())) for i in range(N)]
P = [list(map(int, input().strip().split())) for i in range(N)]
maxProfit = -1000000000



for i in range(1,1024):
    openTime = list(map(int, list("{:0>10}".format(bin(i)[2:]))))
    thisProfit = 0
    for n in range(N):
        shopOpneTime = F[n]
        shopProfit = P[n]
        counter = 0
        for j in range(10):
            if((shopOpneTime[j])and(openTime[j])):
                 counter += 1
        thisProfit += shopProfit[counter]
    maxProfit = max(thisProfit, maxProfit)

print(maxProfit)
Buggy code:
from itertools import product
al=list(product([0,1],repeat=10))
n=int(input())
a=[list(map(int, input().split())) for i in range(n)]
p=[list(map(int, input().split())) for i in range(n)]
ans=0
for i in al:
    if sum(i)==0:continue
    q=0
    for j in range(n):
        count=0
        for k in range(10):
            if a[j][k]==1 and i[k]==1:
                count+=1
        q+=p[j][count]
    ans=max(ans,q)
print(ans)

Fixed code:
from itertools import product
al=list(product([0,1],repeat=10))
n=int(input())
a=[list(map(int, input().split())) for i in range(n)]
p=[list(map(int, input().split())) for i in range(n)]
ans=-100000000000
for i in al:
    if sum(i)==0:continue
    q=0
    for j in range(n):
        count=0
        for k in range(10):
            if a[j][k]==1 and i[k]==1:
                count+=1
        q+=p[j][count]
    ans=max(ans,q)
print(ans)
Buggy code:
f = lambda: list(map(int,input().split()))

n = int(input())
F = [f() for _ in range(n)]
P = [f() for _ in range(n)]

from itertools import product
mul = product((0, 1), repeat=10)

ans = -float('inf')
for m in mul:
    ben = 0
    for shop in range(n):
        op = sum(m[j] & F[shop][j] for j in range(10))
        ben += P[shop][op]
    ans = max(ans,ben)
print(ans)

Fixed code:
f = lambda: list(map(int,input().split()))

n = int(input())
F = [f() for _ in range(n)]
P = [f() for _ in range(n)]

from itertools import product
mul = product((0, 1), repeat=10)

ans = -float('inf')
for m in mul:
    if any(m):
        ben = 0
        for shop in range(n):
            op = sum(m[j] & F[shop][j] for j in range(10))
            ben += P[shop][op]
        ans = max(ans,ben)
print(ans)
Buggy code:
#080_C
n=int(input())
f=[list(map(int,input().split())) for _ in range(n)]
p=[list(map(int,input().split())) for _ in range(n)]
ans=0

for i in range(2**10):
    l=[]
    for j in range(10):
        if (i>>j)&1:
            l.append(1)
        else:
            l.append(0)
    res=0       
    for j in range(n):
        res+=p[j][sum([f[j][k]*l[k] for k in range(10)])]
    ans=max(ans,res)
    
print(ans)

Fixed code:
#080_C
n=int(input())
f=[list(map(int,input().split())) for _ in range(n)]
p=[list(map(int,input().split())) for _ in range(n)]
ans=-10**9

for i in range(1,2**10):
    l=[]
    for j in range(10):
        if (i>>j)&1:
            l.append(1)
        else:
            l.append(0)
    res=0       
    for j in range(n):
        res+=p[j][sum([f[j][k]*l[k] for k in range(10)])]
    ans=max(ans,res)
    
print(ans)
Buggy code:
N = int(input())
F = []
for i in range(N):
  F.append(list(map(str,input().split())))
P = []
for i in range(N):
  P.append(list(map(int,input().split())))

ans = -float('inf')
for i in range(1,2**10):
  sum = 0
  for idx, j in enumerate(F):
    bin_num = int("".join(j), 2)
    num = bin(i & bin_num)[2:].count('1')
    sum += P[idx][num]
    if (sum > ans):
      ans = sum
print(ans)

Fixed code:
N = int(input())
F = []
for i in range(N):
  F.append(list(map(str,input().split())))
P = []
for i in range(N):
  P.append(list(map(int,input().split())))

ans = -float('inf')
for i in range(1,2**10):
  sum = 0
  for idx, j in enumerate(F):
    bin_num = int("".join(j), 2)
    num = bin(i & bin_num)[2:].count('1')
    sum += P[idx][num]
  if (sum > ans):
    ans = sum
print(ans)
Buggy code:
import itertools
n = int(input())
f = [list(map(int, input().split())) for i in range(n)]
p = [list(map(int, input().split())) for i in range(n)]

ans = -float("inf")
for i in itertools.product((0,1), repeat=10):
  a = 0
  for j in range(n):
    c = 0
    for k in range(10):
      if i[k] == f[j][k]:
        c += 1
    a += p[j][c]
  ans = max(ans, a)
  
print(ans)

Fixed code:
import itertools
n = int(input())
f = [list(map(int, input().split())) for i in range(n)]
p = [list(map(int, input().split())) for i in range(n)]

ans = -float("inf")
for i in itertools.product((0,1), repeat=10):
  if list(i) == [0] * 10:
    continue
  a = 0
  for j in range(n):
    c = 0
    for k in range(10):
      if i[k] == f[j][k] == 1:
        c += 1
    a += p[j][c]
  ans = max(ans, a)
  
print(ans)
Buggy code:
from itertools import product
import numpy as np
N = int(input())
F = np.array([list(map(int, input().split())) for _ in range(N)])
P = np.array([list(map(int, input().split())) for _ in range(N)])
M = np.array([0]*1024)
for i, f in enumerate(product([0, 1], repeat=10)) :
    if f == [0]*10 : continue
    f = np.array(f)
    a = np.sum(F*f, axis=1)
    M[i] = sum([l[i] for l, i in zip(P, a)])
print(np.max(M))

Fixed code:
from itertools import product
import numpy as np
N = int(input())
F = np.array([list(map(int, input().split())) for _ in range(N)])
P = np.array([list(map(int, input().split())) for _ in range(N)])
M = np.array([0]*1023)
for i, f in enumerate(product([0, 1], repeat=10)) :
    if not any(f) : continue
    f = np.array(f)
    a = np.sum(F*f, axis=1)
    M[i-1] = sum([l[i] for l, i in zip(P, a)])
print(np.max(M))
Buggy code:
import numpy as np

n = int(input())
f = np.zeros((n, 10), dtype=np.int64)
p = np.zeros((n, 11), dtype=np.int64)

for i in range(n):
  tmp = list(map(int, input().split()))
  for j in range(10):
      f[i][j] = tmp[j]
for i in range(n):
  tmp = list(map(int, input().split()))
  for j in range(11):
    p[i][j] = tmp[j]

r = 0
for b in range(1, 1<<10):
  s = 0
  for i in range(n):
    c = 0
    for j in range(10):
      if (b >> j) & 1 == 1 and f[i][j]:
        c += 1
    s += p[i][c]
  if r < s:
    r = s

print(r)


Fixed code:
import numpy as np

n = int(input())
f = np.zeros((n, 10), dtype=np.int64)
p = np.zeros((n, 11), dtype=np.int64)

for i in range(n):
  tmp = list(map(int, input().split()))
  for j in range(10):
      f[i][j] = tmp[j]
for i in range(n):
  tmp = list(map(int, input().split()))
  for j in range(11):
    p[i][j] = tmp[j]

r = -1e18
for b in range(1, 1<<10):
  s = 0
  for i in range(n):
    c = 0
    for j in range(10):
      if (b >> j) & 1 == 1 and f[i][j]:
        c += 1
    s += p[i][c]
  if r < s:
    r = s

print(r)
Buggy code:
N = int(input())
F = [list(map(int, input().split())) for _ in range(N)]
P = [list(map(int, input().split())) for _ in range(N)]
ans = 0
for i in range(2 ** 10):
    sum = 0
    for j in range(N):
        cnt = 0
        for k in range(10):
            if i >> k & 1 and F[j][k] == 1:
                cnt += 1
        sum += P[j][cnt]
    ans = max(ans, sum)
print(ans)

Fixed code:
N = int(input())
F = [list(map(int, input().split())) for _ in range(N)]
P = [list(map(int, input().split())) for _ in range(N)]
ans = -9999999999
for i in range(1, 2 ** 10):
    s = 0
    for j in range(N):
        cnt = 0
        for k in range(10):
            if i >> k & 1 and F[j][k] == 1:
                cnt += 1
        s += P[j][cnt]
    ans = max(ans, s)
print(ans)
Buggy code:

N = int(input())

F = [list(map(int,input().split())) for _ in range(N)]
P = [list(map(int,input().split())) for _ in range(N)]

#%%
INF = 1<<60
ans = -INF
for st in range(1,1<<10):
    t = st
    state = [0]*10
    for i in range(10):
        state[i] = t%2
        t >>= 1
    
    cur = 0
    for k in range(N):
        tmp = 0
        for i in range(10):
            if F[k][i] == 1 and state[i] == 1:
                tmp += 1
        cur += P[k][tmp]
        ans = max(ans,cur)

print(cur)

Fixed code:

N = int(input())

F = [list(map(int,input().split())) for _ in range(N)]
P = [list(map(int,input().split())) for _ in range(N)]

#%%
INF = 1<<60
ans = -INF
for st in range(1,1<<10):
    t = st
    state = [0]*10
    for i in range(10):
        state[i] = t%2
        t >>= 1
    
    cur = 0
    for k in range(N):
        tmp = 0
        for i in range(10):
            if F[k][i] == 1 and state[i] == 1:
                tmp += 1
        cur += P[k][tmp]
    
    ans = max(ans,cur)

print(ans)
Buggy code:
n=int(input())
F=[int(input().replace(' ',''),2) for i in range(n)]
P=[list(map(int,input().split())) for i in range(n)]
ans=0
a=0

for i in range(1,2**10):
  a=0
  for f,p in zip(F,P):
    a+=p[bin(f&i).count('1')]
  ans=max(ans,a)
print(ans)



Fixed code:
n=int(input())
F=[int(input().replace(' ',''),2) for i in range(n)]
P=[list(map(int,input().split())) for i in range(n)]
ans=-10**10
 
for i in range(1,2**10):
  a=0
  for f,p in zip(F,P):
    a+=p[bin(f&i).count('1')]
  ans=max(ans,a)
print(ans)
Buggy code:
N = int(input())
F = [int(input().replace(' ', ''), 2) for i in range(N)]
P = [[int(j) for j in input().split()] for j in range(N)]

ans = -float('inf')

for i in range(1, 2**10):
    temp = 0
    for j in range(N):
        temp += P[j][bin(i&F[j]).count('1')]
        ans = max(ans, temp)

print(ans)

Fixed code:
N = int(input())
F = [int(input().replace(' ', ''), 2) for i in range(N)]
P = [[int(j) for j in input().split()] for j in range(N)]

ans = -float('inf')

for i in range(1, 2**10):
    temp = 0
    for j in range(N):
        temp += P[j][bin(i&F[j]).count('1')]
    ans = max(ans, temp)

print(ans)
Buggy code:
#080-C 
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
n=IL()
F=[int(input().replace(" ",""), 2) for _ in range(n)]
P=[IL() for i in range(n)]
ans=-pow(10,10)
for i in range(1,pow(2,10)):
    t=0
    for f,p in zip(F,P):
        t+=p[bin(f&i).count("1")]
    ans=max(ans,t)
print(ans)

Fixed code:
#080-C 
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return list(input())
n=I()
F=[int(input().replace(" ",""), 2) for _ in range(n)]
P=[IL() for i in range(n)]
ans=-pow(10,10)
for i in range(1,pow(2,10)):
    t=0
    for f,p in zip(F,P):
        t+=p[bin(f&i).count("1")]
    ans=max(ans,t)
print(ans)
Buggy code:
from itertools import product
n = int(input())
f = [list(map(int, input().split())) for _ in range(n)]
p = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for v in product([0, 1], repeat=10):
    if v.count(1) == 0:
        continue
    tmp = 0
    for i in range(n):
        c = 0
        for j in range(10):
            if v[j] == 1 and f[i][j] == 1:
                c += 1
        tmp += p[i][c]
    ans = max(ans, tmp)
print(ans)


Fixed code:
from itertools import product
n = int(input())
f = [list(map(int, input().split())) for _ in range(n)]
p = [list(map(int, input().split())) for _ in range(n)]
ans = -float('inf')
for v in product([0, 1], repeat=10):
    if v.count(1) == 0:
        continue
    tmp = 0
    for i in range(n):
        c = 0
        for j in range(10):
            if v[j] == 1 and f[i][j] == 1:
                c += 1
        tmp += p[i][c]
    ans = max(ans, tmp)
print(ans)
Buggy code:
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N = readint()
    F = [''.join(readstrs()) for _ in range(N)]
    P = [list(readnums()) for _ in range(N)]
    ans = -(10 ** 9)
    for j, f in enumerate(F):
        val = 0
        for i in range(1, 1024):
            c = bin(i & int(f, 2))[2:]
            v = sum(map(int, c))
            val += P[j][v]

        ans = max(ans, val)

    print(ans)


if __name__ == "__main__":
    main()


Fixed code:
import sys
input = sys.stdin.readline


def readstr():
    return input().strip()


def readint():
    return int(input())


def readnums():
    return map(int, input().split())


def readstrs():
    return input().split()


def main():
    N = readint()
    F = [''.join(readstrs()) for _ in range(N)]
    P = [list(readnums()) for _ in range(N)]
    ans = -(10 ** 9)
    for i in range(1, 1024):
        val = 0
        for j, f in enumerate(F):
            c = bin(i & int(f, 2))[2:]
            v = sum(map(int, c))
            val += P[j][v]

        ans = max(ans, val)

    print(ans)


if __name__ == "__main__":
    main()
Buggy code:
# encoding:utf-8
import copy
import numpy as np
import random

n = int(input())
F = []
for i in range(n):
    f = [int(i) for i in input().split()]
    F.append(f)



P = []
for i in range(n):
    P.append([int(i) for i in input().split()])

F = np.array(F)
P = np.array(P)


def cal_val(shop_num,open_time):
    same_time = int(np.dot(F[shop_num],open_time.T))
    # print(open_time)
    return P[shop_num,same_time+1]
#
# def to2digit(i):
#     open_time = np.zeros([10])
#     for count in range(10):
#         if i%2==1:
#             open_time[count] = 1
#         i = i//2
#     return open_time



values = []

for i in range(1,2**10):
    open_time = np.zeros([10])
    for j in range(10):
        if i%2==1:
            open_time[j] = 1
        i = i//2
    value = 0
    for shop_num in range(n):
        value += cal_val(shop_num,open_time)
    values.append(value)

print(max(values))


Fixed code:
# encoding:utf-8
import copy
import numpy as np
import random

n = int(input())
F = []
for i in range(n):
    f = [int(i) for i in input().split()]
    F.append(f)



P = []
for i in range(n):
    P.append([int(i) for i in input().split()])

F = np.array(F)
P = np.array(P)


def cal_val(shop_num,open_time):
    same_time = int(np.dot(F[shop_num],open_time.T))
    # print(open_time)
    return P[shop_num,same_time]
#
# def to2digit(i):
#     open_time = np.zeros([10])
#     for count in range(10):
#         if i%2==1:
#             open_time[count] = 1
#         i = i//2
#     return open_time



values = []
ans = -10**10
for i in range(1,2**10):
    open_time = np.zeros([10])
    for j in range(10):
        if i%2==1:
            open_time[j] = 1
        i = i//2
    value = 0
    for shop_num in range(n):
        value += cal_val(shop_num,open_time)
    values.append(value)
    ans = max(ans,value)


print(ans)
# print(max(values))
Buggy code:
n = int(input())
F = [[int(i) for i in input().split()] for i in range(n)]
P = [[int(i) for i in input().split()] for i in range(n)]

ans = -10 ** 7
for i in range(1, 2 ** 10):
    tmp = i
    A = []
    while tmp:
        A.append(tmp % 2)
        tmp //= 2
    while len(A) != 10:
        A.append(0)

    temp = 0
    for s in range(n):
        count = 0
        for t in range(10):
            if F[s][t] == 1 and A[t] == 1:
                count += 1
        temp += P[s][count]
        ans = max(ans, temp)
        
print(ans)

Fixed code:
n = int(input())
F = [[int(i) for i in input().split()] for i in range(n)]
P = [[int(i) for i in input().split()] for i in range(n)]

ans = -10 ** 10
for i in range(1, 2 ** 10):
    tmp = i
    A = []
    while tmp:
        A.append(tmp % 2)
        tmp //= 2
    while len(A) != 10:
        A.append(0)

    temp = 0
    for s in range(n):
        count = 0
        for t in range(10):
            if F[s][t] == 1 and A[t] == 1:
                count += 1
        temp += P[s][count]
    ans = max(ans, temp)
        
print(ans)
Buggy code:
N = int(input())
F = [list(map(int, input().split())) for i in range(N)]
P = [list(map(int, input().split())) for j in range(N)]  
max = -9999999999  
for i in range(1, 2**10):
    for j in range(N):
        count = 0
        for k in range(10):
            if ((i >> k)&1) == 1 and F[j][k] == 1:
                count += 1
        sum += P[j][count]
    max = max(max, sum)  
print(max)

Fixed code:
N = int(input())
F = [list(map(int, input().split())) for i in range(N)]
P = [list(map(int, input().split())) for j in range(N)]  
m = -9999999999  
for i in range(1, 2**10):
    s = 0
    for j in range(N):
        count = 0
        for k in range(10):
            if ((i >> k)&1) == 1 and F[j][k] == 1:
                count += 1
        s += P[j][count]
    m = max(m, s)  
print(m)
Buggy code:
# coding:utf-8
inp = input()
N = int(inp)

eigyo = []

b = []
Ci = []
for i in range(N):
    N_ = list(map(int, input().split()))
    eigyo.append(N_)
    Ci.append(sum(N_))

P = []
for i in range(N):
    P.append(list(map(int, input().split())))


ans = 0
a = list(map(lambda x: x*0, list(range(10))))
count = 0

def func():
    #score = 0
    global count
    count += 1
    #print(count, a)
    cc = 0
    for i in range(N):
        count_c = 0
        for j,element in enumerate(eigyo[N]):
            if element==a[j]:
                count_c += 1
        cc += P[i][count_c]

    global ans
    ans = max(ans, cc)
            
    #ans = max(ans, score)

def dfs(pos):
    if pos==10:
        func()
        return
    a[pos] = 0
    dfs(pos+1)
    a[pos] = 1
    dfs(pos+1)


dfs(0)
print(ans)


Fixed code:
# coding:utf-8
inp = input()
N = int(inp)

eigyo = []

b = []
Ci = []
for i in range(N):
    N_ = list(map(int, input().split()))
    eigyo.append(N_)
    Ci.append(sum(N_))

P = []
for i in range(N):
    P.append(list(map(int, input().split())))


ans = -(1<<30)
a = list(map(lambda x: x*0, list(range(10))))
count = 0

def func():
    #score = 0
    global count
    count += 1
    #print(count, a)
    cc = 0
    if count!=1:
        for i in range(N):
            count_c = 0
            for j,element in enumerate(eigyo[i]):
                if element==a[j] and a[j]==1:
                    count_c += 1
            cc += P[i][count_c]
        global ans
        ans = max(ans, cc)
            
    #ans = max(ans, score)

def dfs(pos):
    if pos==10:
        func()
        return
    a[pos] = 0
    dfs(pos+1)
    a[pos] = 1
    dfs(pos+1)


dfs(0)
print(ans)
Buggy code:
N = int(input())
F = [ list(map(int, input().split())) for _ in range(N)]
P = [ list(map(int, input().split())) for _ in range(N)]

res = -(1<<30)

for b in range(1<<10):
  cc = 0
  for i in range(N):
    c = 0
    for j in range(10):
      if (b>>j&1) & F[i][j]:
        c+=1
    cc += P[i][c]
  if res<cc:
    res = cc
    
print(res)

Fixed code:
N = int(input())
F = [ list(map(int, input().split())) for _ in range(N)]
P = [ list(map(int, input().split())) for _ in range(N)]

res = -(1<<30)

for b in range(1,1<<10):
  cc = 0
  for i in range(N):
    c = 0
    for j in range(10):
      if (b>>j&1) & F[i][j]:
        c+=1
    cc += P[i][c]
  if res<cc:
    res = cc
    
print(res)
Buggy code:
n=int(input())
f=[list(map(int,input().split()))for _ in range(n)]
p=[list(map(int,input().split()))for _ in range(n)]
ans=0
for bit in range(1,1<<10):
  a=0
  for i in range(n):
    b=0
    for j in range(10):
      if bit&1<<j:b+=f[i][j]
    a+=p[i][b]
  ans=max(a,ans)
print(ans)

Fixed code:
n=int(input())
f=[list(map(int,input().split()))for _ in range(n)]
p=[list(map(int,input().split()))for _ in range(n)]
ans=-10**10
for bit in range(1,1<<10):
  a=0
  for i in range(n):
    b=0
    for j in range(10):
      if bit&1<<j:b+=f[i][j]
    a+=p[i][b]
  ans=max(a,ans)
print(ans)