qyliang/CodeNanoFix huggingface dataset:
Buggy code:
D, G = map(int, input().split())
table = []
for i in range(D):
    p,c = map(int, input().split())
    table.append((i+1,p,c))
ans = 10**3
for i in range(1<<D):
    count = 0
    score = 0
    remain = []
    for j in range(D):
        d,p,c = table[j]
        if i & (1<<j):
            score += 100*(d)*p+c
            count += p
        else:
            remain.append((d,p,c))
    if score < G:
        remain.sort(reverse=True)
        d,p,c = remain[0]
        while score < G:
            score += 100*d
            count += 1
    ans = min(ans,count)
print(ans)

Fixed code:
D, G = map(int, input().split())
table = []
for i in range(D):
    p,c = map(int, input().split())
    table.append((i+1,p,c))
ans = 10**3
for i in range(1<<D):
    count = 0
    score = 0
    remain = []
    for j in range(D):
        d,p,c = table[j]
        if i & (1<<j):
            score += 100*(d)*p+c
            count += p
        else:
            remain.append((d,p,c))
    if score < G:
        remain.sort(reverse=True)
        d,p,c = remain[0]
        while score < G and p > 0:
            score += 100*d
            count += 1
            p -= 1
    if score >= G:
        ans = min(ans,count)
print(ans)
Buggy code:

d, g = map(int, input().strip().split())
points = [list(map(int, input().strip().split())) for _ in range(d)]

answer = float("inf")
for combination in range(2 ** d):
    score = 0
    solved = 0
    for difficuty in range(d):
        if (combination >> difficuty) & 1:
            score += points[difficuty][0] * 100 * (difficuty + 1) + points[difficuty][1]
            solved += points[difficuty][0]
    if score < g:
        for difficuty in range(d)[::-1]:
            if not (combination >> difficuty) & 1 and g - score < points[difficuty][0] * 100 * (difficuty + 1):
                solved += (g - score) // (100 * (difficuty + 1)) + 1
                break
        else:
            continue
    if answer > solved:
        answer = solved
print(answer)


Fixed code:
from math import ceil

d, g = map(int, input().strip().split())
points = [list(map(int, input().strip().split())) for _ in range(d)]

answer = float("inf")
for combination in range(2 ** d):
    score = 0
    solved = 0
    for difficuty in range(d):
        if (combination >> difficuty) & 1:
            score += points[difficuty][0] * 100 * (difficuty + 1) + points[difficuty][1]
            solved += points[difficuty][0]
    if score < g:
        for difficuty in range(d)[::-1]:
            if not (combination >> difficuty) & 1 and g - score < points[difficuty][0] * 100 * (difficuty + 1):
                solved += ceil((g - score) / (100 * (difficuty + 1)))
                break
        else:
            continue
    if answer > solved:
        answer = solved
print(answer)
Buggy code:
D, G = map(int, input().split())
p = [list(map(int, input().split())) for _ in range(D)]
visited = [0] * D
def dfs(s, c):
  temp = 10 ** 3
  for i in range(D):
    if visited[i] == 0:
      visited[i] = 1
      if s >= p[i][0] * (i + 1) * 100 + p[i][1]:
        temp = min(temp, dfs(s - p[i][0] * (i + 1) * 100 - p[i][1], c + p[i][0]))
      else:
        temp = min(temp, -(-max(s, 0) // ((i + 1) * 100)) + c)
      visited[i] = 0
  #print(s, c, temp)
  return temp
print(dfs(G, 0))

Fixed code:
D, G = map(int, input().split())
p = [list(map(int, input().split())) for _ in range(D)]
visited = [0] * D
def dfs(s, c):
  temp = 10 ** 3
  for i in range(D):
    if visited[i] == 0:
      visited[i] = 1
      if s >= p[i][0] * (i + 1) * 100 + p[i][1]:
        temp = min(temp, dfs(s - p[i][0] * (i + 1) * 100 - p[i][1], c + p[i][0]))
      else:
        temp = min(temp, -(-s // ((i + 1) * 100)) + c, p[i][0] + c)
      visited[i] = 0
  return temp
print(dfs(G, 0))
Buggy code:
D, G = map(int,input().split())
p,c = {},{}
for i in range(1,D+1):
  pi,ci = map(int,input().split())
  p[i] = pi
  c[i] = ci
ans = sum(p.values())

for i in range(2**D):
  cmp = {i:False for i in range(1,D+1)}
  score = 0
  ans_tmp = 0
  for j in range(D):
    if (i >> j) & 1:
      cmp[j+1] = True
      score += (j+1)*100*p[j+1]+c[j+1]
      ans_tmp += p[j+1]
  if score < G:
    keys = [k for k,v in cmp.items() if v == False]
    ans_tmp += (G-score) // (max(keys)*100) 
    if (G-score) % (max(keys)*100) != 0:
      ans_tmp += 1 
        
  ans = min(ans_tmp, ans)
print(ans)

Fixed code:
D, G = map(int,input().split())
p,c = {},{}
for i in range(1,D+1):
  pi,ci = map(int,input().split())
  p[i] = pi
  c[i] = ci
ans = sum(p.values())

for i in range(2**D):
  cmp = {i:False for i in range(1,D+1)}
  score = 0
  ans_tmp = 0
  for j in range(D):
    if (i >> j) & 1:
      cmp[j+1] = True
      score += (j+1)*100*p[j+1]+c[j+1]
      ans_tmp += p[j+1]
  keys = [k for k,v in cmp.items() if v == False]
  if G > score and len(keys) > 0:
    if (G-score) // (max(keys)*100) <= p[max(keys)]:
      ans_tmp += (G-score) // (max(keys)*100)
      if (G-score) % (max(keys)*100) != 0:
        ans_tmp += 1 
    else:
      ans_tmp = sum(p.values())
  ans = min(ans, ans_tmp)
        
print(ans)
Buggy code:
D, G = map(int, input().split())
S = [[0] for i in range(D + 1)]
B = [[0] for i in range(D + 1)]
sumP = 0
for i in range(D):
  p, c = map(int, input().split())
  S[i + 1] += [0] * (len(S[i]) + p - 1)
  B[i + 1] += [100 * (x + 1) for x in range(p)]
  B[i + 1][-1] += c
for i in range(1, D + 1):
  for j in range(1, len(S[i])):
    for k in range(max(j - len(S[i - 1]) + 1, 0), min(len(B[i]), j + 1)):
      S[i][j] = max(B[i][k] + S[i - 1][j - k], S[i][j])
for i, s in enumerate(S[D]):
  if s >= G:
    print(i)
    break

Fixed code:
D, G = map(int, input().split())
S = [[0] for i in range(D + 1)]
B = [[0] for i in range(D + 1)]
sumP = 0
for i in range(D):
  p, c = map(int, input().split())
  S[i + 1] += [0] * (len(S[i]) + p - 1)
  B[i + 1] += [100 * (i + 1) * (x + 1) for x in range(p)]
  B[i + 1][-1] += c
for i in range(1, D + 1):
  for j in range(1, len(S[i])):
    for k in range(max(j - len(S[i - 1]) + 1, 0), min(len(B[i]), j + 1)):
      S[i][j] = max(B[i][k] + S[i - 1][j - k], S[i][j])
for i, s in enumerate(S[D]):
  if s >= G:
    print(i)
    break
Buggy code:
D, G = map(int, input().split()) 
S = [[int(x) for x in input().split()]for i in range(D)]
Minimum_can = []
for i in range(2**D-1):
    binary = str(format(i,'b'))
    binary_zero = binary.zfill(D)
    SUM = 0
    Number = 0
    for j in range(D):
        if binary_zero[j]=='1':
            SUM += S[j][0]*100*(j+1)+S[j][1]
            Number += S[j][0]
    if SUM == G: Minimum_can.append(Number)        
    elif SUM < G:
        Biggest_0_number = 0
        for k in range(D):
            if binary_zero[D-k-1]=='0':
                Biggest_0_number = D-k-1
                break
        for k in range(S[Biggest_0_number][0]):
            if SUM+100*(Biggest_0_number+1)*(k+1) >= G:
                Minimum_can.append(Number+k+1)
                break 
print(min(Minimum_can))


Fixed code:
D, G = map(int, input().split()) 
S = [[int(x) for x in input().split()]for i in range(D)]
Minimum_can = []
for i in range(2**D):
    binary = str(format(i,'b'))
    binary_zero = binary.zfill(D)
    SUM = 0
    Number = 0
    for j in range(D):
        if binary_zero[j]=='1':
            SUM += S[j][0]*100*(j+1)+S[j][1]
            Number += S[j][0]
    if SUM >= G: Minimum_can.append(Number)        
    elif SUM < G:
        Biggest_0_number = 0
        for k in range(D):
            if binary_zero[D-k-1]=='0':
                Biggest_0_number = D-k-1
                break
        for k in range(S[Biggest_0_number][0]):
            if SUM+100*(Biggest_0_number+1)*(k+1) >= G:
                Minimum_can.append(Number+k+1)
                break 
print(min(Minimum_can))
Buggy code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

D, G = map(int, readline().split())
problems = []
for i in range(1, D+1):
    p, c = map(int, readline().split())
    score = 100 * i
    problems.append({
        "score": score,
        "number": p,
        "bonus": c,
        "sum": score * p + c
    })

keta = len(problems)
answer = float("inf")
for i in range(0, 2 ** D):
    bits = list(str(format(i, "0{}b".format(keta))))
    sum_number = 0
    sum_score = 0
    half_index = None
    for j, is_full in enumerate(bits):
        if is_full == "1":
            sum_number += problems[j]["number"]
            sum_score += problems[j]["sum"]
        else:
            half_index = j
    if half_index is None:
        continue
    for _ in range(problems[half_index]["number"]):
        if sum_score >= G:
            break
        sum_score += problems[half_index]["score"]
        sum_number += 1
    if sum_score >= G:
        answer = min(answer, sum_number)
        break

print(answer)

Fixed code:
import sys
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)

D, G = map(int, readline().split())
problems = []
for i in range(1, D+1):
    p, c = map(int, readline().split())
    score = 100 * i
    problems.append({
        "score": score,
        "number": p,
        "bonus": c,
        "sum": score * p + c
    })

keta = len(problems)
answer = float("inf")
for i in range(0, 2 ** D):
    bits = list(str(format(i, "0{}b".format(keta))))
    sum_number = 0
    sum_score = 0
    half_index = None
    for j, is_full in enumerate(bits):
        if is_full == "1":
            sum_number += problems[j]["number"]
            sum_score += problems[j]["sum"]
        else:
            half_index = j
    if half_index is None:
        if sum_score >= G:
            answer = min(answer, sum_number)
        continue
    for _ in range(problems[half_index]["number"]):
        if sum_score >= G:
            break
        sum_score += problems[half_index]["score"]
        sum_number += 1
    if sum_score >= G:
        answer = min(answer, sum_number)

print(answer)
Buggy code:
x = [list(map(int, input().split())) for i in range(d)]
ans2=float('inf')

for i in range(2**d):
    v=[0]*d
    ans=0
    ans1=0
    for j in range(d):
        if (i>>j)&1==1:
            ans+=(x[j][0]*100*(j+1))+x[j][1]
            ans1+=x[j][0]
            v[j]=1


    if ans<g:
        for k in range(d):
            if v[d-k-1]==0:
                if g-ans<=(x[d-k-1][0]-1)*100*(d-k):
                    w=-(-(g-ans)//(100*(d-k)))

                    ans2=min(ans2,ans1+w)
                else:
                    break
    else:
        ans2=min(ans2,ans1)
print(ans2)

Fixed code:
d,g= map(int, input().split())
x = [list(map(int, input().split())) for i in range(d)]
ans2=float('inf')

for i in range(2**d):
    v=[0]*d
    ans=0
    ans1=0
    for j in range(d):
        if (i>>j)&1==1:
            ans+=(x[j][0]*100*(j+1))+x[j][1]
            ans1+=x[j][0]
            v[j]=1


    if ans<g:
        for k in range(d):
            if v[d-k-1]==0:
                if g-ans<=(x[d-k-1][0]-1)*100*(d-k):
                    w=-(-(g-ans)//(100*(d-k)))

                    ans2=min(ans2,ans1+w)
                else:
                    break
    else:
        ans2=min(ans2,ans1)
print(ans2)
Buggy code:
import numpy as np
d, g = map(int, input().split())
p = []
c = []
for _ in range(d):
    _p, _c = map(int, input().split())
    p.append(_p)
    c.append(_c)

s = np.arange(1, d + 1) * 100
p = np.array(p)

ans_list = []

bool_list = [False] * d

state_list = []

def dfs(i, n, bool_list):
    bool_list = bool_list.copy()
    if i == n:
        state_list.append(bool_list)
    else:
        dfs(i + 1, n, bool_list)
        bool_list[i] = True
        dfs(i + 1, n, bool_list)

dfs(0, d, bool_list)

for state in state_list:
    if np.dot(s * p, state) + np.dot(c, state) >= g:
        ans_list.append(np.dot(p, state))
    else:
        score = max(s * np.array([not i for i in state]))
        for j in range(1, p[score%100]):
            if np.dot(s * p, state) + np.dot(c, state) + score * j >= g:
                ans_list.append(np.dot(p, state) + j)

print(min(ans_list))

Fixed code:
import numpy as np
d, g = map(int, input().split())
p = []
c = []
for _ in range(d):
    _p, _c = map(int, input().split())
    p.append(_p)
    c.append(_c)

s = np.arange(1, d + 1) * 100
p = np.array(p)

ans_list = []

bool_list = [False] * d

state_list = []

def dfs(i, n, bool_list):
    bool_list = bool_list.copy()
    if i == n:
        state_list.append(bool_list)
    else:
        dfs(i + 1, n, bool_list)
        bool_list[i] = True
        dfs(i + 1, n, bool_list)

dfs(0, d, bool_list)

for state in state_list:
    if np.dot(s * p, state) + np.dot(c, state) >= g:
        ans_list.append(np.dot(p, state))
    else:
        score = max(s * np.array([not i for i in state]))
        for j in range(1, p[score//100 - 1] + 1):
            if np.dot(s * p, state) + np.dot(c, state) + score * j >= g:
                ans_list.append(np.dot(p, state) + j)

print(min(ans_list))
Buggy code:
import sys

def main():
    sum=0
    ansc=0
    D,G = map(int,input().split())

    lis=[]
import sys

def main():
    sum=0
    ansc=0
    D,G = map(int,input().split())

    lis=[]
    for x in range(D):
        P,C = map(int,input().split())
        lis.append([P,C])

    op_cnt = D

    for i in range(2 ** op_cnt):
        for j in range(op_cnt):
            if((i>>j) & 1 and i!=0):
                for k in range(1, lis[j][0]+1):
                    sum+=(100*(j+1))
                    ansc+=1
                    if(sum>=G):
                        break
                    if(k==lis[j][0]):
                        sum+=lis[j][1]
            if(sum<G):
                for lef in reversed(range(0, op_cnt-1)):
                    if((i>>lef) & 0):
                        for l in range(1,lis[lef][0]):
                            sum+=(100*(l+1))
                            ansc+=1


        print(sum,bin(i),ansc)


        ansc=0
        sum=0

main()

Fixed code:
import sys

def main():
    sum=0
    ans=0
    ansc=0
    D,G = map(int,input().split())

    lis=[]
    for x in range(D):
        P,C = map(int,input().split())
        lis.append([P,C])

    op_cnt = D

    for i in range(2 ** op_cnt):
        for j in range(op_cnt):
            if((i>>j) & 1 and i!=0):
                for k in range(1, lis[j][0]+1):
                    sum+=(100*(j+1))
                    ansc+=1
                    if(k==lis[j][0]):
                        sum+=lis[j][1]
                    if(sum>=G):
                        break


        if(sum<G):
            for lef in reversed(range(0, op_cnt)):
                if(~(i>>lef) & 1 and lis[lef][0] != 1):
                    for l in range(1,lis[lef][0]+1):
                        if(sum>=G):
                            break
                        sum+=(100*(lef+1))
                        ansc+=1


        if(ans>=ansc or ans==0):
            ans=ansc

        ansc=0
        sum=0

    print(ans)
main()
Buggy code:
D,G=list(map(int,input().split()))
pc = [[int(i) for i in input().split()] for m in range(2)]

#print(pc)
minn=10000
flug=[]
def func(D,G,pc,flug,i=0,summ=0,num=0):
    global minn
    if i==D:
        #print(flug,summ,num)
        if summ>=G:
            minn=min(minn,num)
            return 0
        else:
            for j,bit in enumerate(reversed(flug)):
                if bit==0:
                    for k in range(pc[D-1-j][0]):
                        summ+=(D-j)*100
                        if summ>=G:
                            num+=(k+1)
                            minn=min(minn,num)
        return 0

    return func(D,G,pc,flug+[1],i+1,summ+pc[i][0]*100*(i+1)+pc[i][1],num+pc[i][0]) + func(D,G,pc,flug+[0],i+1,summ,num)


func(D,G,pc,flug)
print(minn)

Fixed code:
D,G=list(map(int,input().split()))
pc = [[int(i) for i in input().split()] for m in range(D)]

#print(pc)
minn=10000
flug=[]
def func(D,G,pc,flug,i=0,summ=0,num=0):
    global minn
    if i==D:
        #print(flug,summ,num)
        if summ>=G:
            minn=min(minn,num)
            return 0
        else:
            for j,bit in enumerate(reversed(flug)):
                if bit==0:
                    for k in range(pc[D-1-j][0]):
                        summ+=(D-j)*100
                        num+=1
                        if summ>=G:
                            minn=min(minn,num)
        return 0

    return func(D,G,pc,flug+[1],i+1,summ+pc[i][0]*100*(i+1)+pc[i][1],num+pc[i][0]) + func(D,G,pc,flug+[0],i+1,summ,num)


func(D,G,pc,flug)
print(minn)
Buggy code:
d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]
ans = float('Inf')

for i in range(2 ** d):
    count = 0
    sum = 0
    nokori = set(range(1, d + 1))
    
    for j in range(d):
        if ((i >> j) & 1):
            sum += pc[j][0] * (i + 1) * 100 + pc[j][1]
            count += pc[j][0]
            nokori.discard(j + 1)
            
    if sum < g:
        use = max(nokori)
        n = min(pc[use - 1][0], (g - sum) // (use * 100) )
        count += n
        sum += n * use * 100
        
    if sum >= g:
        ans = min(ans, count)
print(ans)

Fixed code:
d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]
ans = float('Inf')

for i in range(2 ** d):
    count = 0
    sum = 0
    nokori = set(range(1, d + 1))
    
    for j in range(d):
        if ((i >> j) & 1):
            sum += pc[j][0] * (j + 1) * 100 + pc[j][1]
            count += pc[j][0]
            nokori.discard(j + 1)
            
    if sum < g:
        use = max(nokori)
        n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
        count += n
        sum += n * use * 100
        
    if sum >= g:
        ans = min(ans, count)
print(ans)
Buggy code:
d,g = map(int,input().split())
ary = [list(map(int,input().split())) for _ in range(d)]
s = set(i for i in range(d))
ans = float("Inf")
for i in range(2**d):
    a = []
    total,count = 0,0
    for j in range(d):
        if i >> j & 1:
            a.append(j)
    for x in a:
        total += 100*(x+1)*ary[x][0]+ary[x][1]
        count += ary[x][0]
    for y in sorted(s - set(a),reverse=True):
        if total + 100*(y+1)*(ary[y][0]-1) >= g:
            count += -(-(g-total) // (100*(y+1)))
            ans = min(ans,count)
            break
        total += 100*(y+1)*(ary[y][0]-1)
        count += ary[y][0]-1
    if total >= g:
        ans = min(ans,count)
print(ans)

Fixed code:
d,g = map(int,input().split())
ary = [list(map(int,input().split())) for _ in range(d)]
s = set(i for i in range(d))
ans = float("Inf")
for i in range(2**d):
    a = []
    total,count = 0,0
    for j in range(d):
        if i >> j & 1:
            a.append(j)
    for x in a:
        total += 100*(x+1)*ary[x][0]+ary[x][1]
        count += ary[x][0]
    if total >= g:
        ans = min(ans,count)
        continue
    for y in sorted(s - set(a),reverse=True):
        if total + 100*(y+1)*(ary[y][0]-1) >= g:
            count += -(-(g-total) // (100*(y+1)))
            ans = min(ans,count)
            break
        total += 100*(y+1)*(ary[y][0]-1)
        count += ary[y][0]-1
    if total >= g:
        ans = min(ans,count)
print(ans)
Buggy code:
d,g = map(int,input().split())
probs = []
ans = float('inf')
for i in range(d):
    p,c =map(int,input().split())
    probs.append(((i+1)*100,p,c))

for i in range(2**d):
    count = 0
    score = 0
    yet = []
    for j in range(d):
        if ((i >>j) & 1):
            count +=probs[j][1]
            score +=probs[j][2] +probs[j][0]*probs[j][1]
        else:
            yet.append((probs[j][0],probs[j][1]-1))
    if ans <= count:
        continue
    elif score>=g:
        ans = count
        continue
    yet.sort(reverse=True)
    if score+sum([x*y for x,y in yet]) <g:
        continue
    for point,num in yet:
        solve = min((g - score-0.1)//point +1,num)
        count += solve
        score += solve*point
        if count >= ans:
            break
        if score >=g:
            ans = count
print(ans)
    
    
            
    

Fixed code:
d,g = map(int,input().split())
probs = []
ans = float('inf')
for i in range(d):
    p,c =map(int,input().split())
    probs.append(((i+1)*100,p,c))

for i in range(2**d):
    count = 0
    score = 0
    yet = []
    for j in range(d):
        if ((i >>j) & 1):
            count +=probs[j][1]
            score +=probs[j][2] +probs[j][0]*probs[j][1]
        else:
            yet.append((probs[j][0],probs[j][1]-1))
    if ans <= count:
        continue
    elif score>=g:
        ans = count
        continue
    yet.sort(reverse=True)
    if score+sum([x*y for x,y in yet]) <g:
        continue
    for point,num in yet:
        solve = min((g - score-0.1)//point +1,num)
        count += solve
        score += solve*point
        if count >= ans:
            break
        if score >=g:
            ans = count
            break
    
print(int(ans))
Buggy code:
import math, sys
sys.setrecursionlimit(10**6)
d,g = map(int, input().split())
data = []
ans = 100000
for i in range(1,d+1):
    p, c = map(int, input().split())
    data.append([i*100 , p , c])
def dfs(li):
    if len(li) == d:
        if not (True in li):
            return 
        global ans
        total = 0
        candidate = 0
        for i in range(d):
            if li[i]:
                total += data[i][0] * data[i][1] + data[i][2]
                candidate += data[i][1]
        if total >= g:
            ans = min(ans, candidate)
        else:
            max_point = max([data[i] for i in range(d) if not li[i]])
            if max_point[0] * (max_point[1] - 1) + total >= g:
                candidate += math.ceil((g - total) / max_point[0])
                ans = min(ans, candidate)
    else:
        dfs(li + [False])
        dfs(li + [True])
dfs([])
print(ans)

Fixed code:
import math, sys
sys.setrecursionlimit(10**7)
d,g = map(int, input().split())
data = []
ans = 10000000
for i in range(1,d+1):
    p, c = map(int, input().split())
    data.append([i*100 , p , c])
def dfs(li):
    if len(li) == d:
        global ans
        total = 0
        candidate = 0
        for i in range(d):
            if li[i]:
                total += data[i][0] * data[i][1] + data[i][2]
                candidate += data[i][1]
        if total >= g:
            ans = min(ans, candidate)
        else:
            max_point = max([data[i] for i in range(d) if not li[i]])
            if max_point[0] * (max_point[1] - 1) + total >= g:
                candidate += math.ceil((g - total) / max_point[0])
                ans = min(ans, candidate)
    else:
        dfs(li + [False])
        dfs(li + [True])
dfs([])
print(ans)
Buggy code:
import numpy as np

D, G = map(int, input().split())

PC = []
ans = 10 ** 9

for _ in range(D):
    PC.append(list(map(int, input().split())))

PC = np.array(PC)

for i in range(2 ** D):
    score = 0
    count = 0

    for j in range(D):
        if (i >> j) & 1:

          	score += (j+1) * 100 * PC[j,0] + PC[j,1]
            count += PC[j,0]

    if score >= G:
        ans = min(ans, count)

    if score < G:
      for k in range(D):
            sub_score = 0
            sub_count = 0

            if ~(i >> k) & 1:
                for _ in range(PC[k,0] - 1):
                    sub_score += (k+1) * 100
                    sub_count += 1
                    if sub_score >= (G - score):
                        ans = min(ans, count+sub_count)
                        break


print(ans)

Fixed code:
import numpy as np

D, G = map(int, input().split())

PC = []
ans = 10 ** 9

for _ in range(D):
    PC.append(list(map(int, input().split())))

PC = np.array(PC)

for i in range(2 ** D):
    score = 0
    count = 0

    for j in range(D):
        if (i >> j) & 1:
            score += (j+1) * 100 * PC[j,0] + PC[j,1]
            count += PC[j,0]

    if score >= G:
        ans = min(ans, count)

    if score < G:
      for k in range(D):
            sub_score = 0
            sub_count = 0

            if ~(i >> k) & 1:
                for _ in range(PC[k,0] - 1):
                    sub_score += (k+1) * 100
                    sub_count += 1
                    if sub_score >= (G - score):
                        ans = min(ans, count+sub_count)
                        break

print(ans)