Buggy python submission (verdict: Runtime Error):
D, G = map(int, input().split())
Ci = [list(map(int, input().split())) for _ in range(D)]


MAX_BIT = (1 << D)
# 各ビットが1のとき全部解く
def calc(patternBit):
    if patternBit >= MAX_BIT:
        return None
    p = patternBit
    score = 0
    ans1 = 0
    use_c = None
    for i, c in enumerate(Ci):
        s = (i + 1) * 100 #1問のスコア
        if p % 2 > 0:
            score += s * c[0] + c[1]
            ans1 += c[0]
        else:
            use_c = c + [s]
        p = p // 2
    if score < G:
        if use_c == None:
            return calc(patternBit + 1)
        remain = G - score
        add_count = remain // use_c[2]
        if remain % use_c[2] > 0:
            add_count += 1
        if add_count > use_c[0]:
            return calc(patternBit + 1)
        ans1 += add_count
    ans2 = calc(patternBit + 1)
    if ans2 != None:
        return min(ans1, ans2)
    return ans1
    
print(calc(0))    


Fixed submission:
D, G = map(int, input().split())
Ci = [list(map(int, input().split())) for _ in range(D)]


MAX_BIT = (1 << D)
minimum = 1000000000
# 各ビットが1のとき全部解く
for patternBit in range(MAX_BIT):
    if patternBit >= MAX_BIT:
        continue
    p = patternBit
    score = 0
    ans1 = 0
    use_c = None
    for i, c in enumerate(Ci):
        s = (i + 1) * 100 #1問のスコア
        if p % 2 > 0:
            score += s * c[0] + c[1]
            ans1 += c[0]
        else:
            use_c = c + [s]
        p = p // 2
    if score < G:
        remain = G - score
        add_count = remain // use_c[2]
        if remain % use_c[2] > 0:
            add_count += 1
        if add_count > use_c[0]:
            continue
        ans1 += add_count
    minimum = min(minimum, ans1)
    
print(minimum)

Buggy python submission (verdict: Runtime Error):
D, G = map(int, input().split())
Ci = [list(map(int, input().split())) for _ in range(D)]


MAX_BIT = (1 << D)
# 各ビットが1のとき全部解く
def calc(patternBit):
    if patternBit >= MAX_BIT:
        return None
    p = patternBit
    score = 0
    ans1 = 0
    use_c = None
    for i, c in enumerate(Ci):
        s = (i + 1) * 100 #1問のスコア
        if p % 2 > 0:
            score += s * c[0] + c[1]
            ans1 += c[0]
        else:
            use_c = c + [s]
        p = p // 2
    if score < G:
        remain = G - score
        add_count = remain // use_c[2]
        if remain % use_c[2] > 0:
            add_count += 1
        if add_count > use_c[0]:
            return calc(patternBit + 1)
        ans1 += add_count
    ans2 = calc(patternBit + 1)
    if ans2 != None:
        return min(ans1, ans2)
    return ans1
    
print(calc(0))    

Fixed submission:
D, G = map(int, input().split())
Ci = [list(map(int, input().split())) for _ in range(D)]


MAX_BIT = (1 << D)
minimum = 1000000000
# 各ビットが1のとき全部解く
for patternBit in range(MAX_BIT):
    if patternBit >= MAX_BIT:
        continue
    p = patternBit
    score = 0
    ans1 = 0
    use_c = None
    for i, c in enumerate(Ci):
        s = (i + 1) * 100 #1問のスコア
        if p % 2 > 0:
            score += s * c[0] + c[1]
            ans1 += c[0]
        else:
            use_c = c + [s]
        p = p // 2
    if score < G:
        remain = G - score
        add_count = remain // use_c[2]
        if remain % use_c[2] > 0:
            add_count += 1
        if add_count > use_c[0]:
            continue
        ans1 += add_count
    minimum = min(minimum, ans1)
    
print(minimum)