Problem: A programming competition site _AtCode_ provides algorithmic problems. Each problem is allocated a score based on its difficulty. Currently, for each integer i between 1 and D (inclusive), there are p_i problems with a score of 100i points. These p_1 + … + p_D problems are all of the problems available on AtCode.  A user of AtCode has a value called _total score_. The total score of a user is the sum of the following two elements:    * Base score: the sum of the scores of all problems solved by the user.   * Perfect bonuses: when a user solves all problems with a score of 100i points, he/she earns the perfect bonus of c_i points, aside from the base score (1 ≤ i ≤ D).  Takahashi, who is the new user of AtCode, has not solved any problem. His objective is to have a total score of G or more points. At least how many problems does he need to solve for this objective?

Submission attempts (in order):
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)

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)

Verdicts: Wrong Answer

Accepted