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):
D, G = [int(i) for i in input().split()]

p = []
c = []
for i in range(D):
    tmp = [int(i) for i in input().split()]
    p.append(int(tmp[0]))
    c.append(int(tmp[1]))

def AccuracyQestionNum(acc_list, count):
    counter = count
    for i in range(len(acc_list)):
        if acc_list[i] == 1:
            counter += p[i]
    return counter

def MaxScoreIndex(acc_list):
    for i in reversed(range(len(acc_list))):
        if acc_list[i] == 0:
            return i
        
def FinalQestionNum(acc_list, score):
    remain_point = G - score
    counter = 0
    max_score_index = MaxScoreIndex(acc_list)
    for i in range(p[max_score_index]):
        remain_point -= (max_score_index+1) * 100
        counter += 1
        if remain_point <= 0:
            break

    if counter == p[max_score_index]:
        return None
    else:
        return counter
        
def ScoreCalculation(acc_list):
    score = 0
    for i in range(len(acc_list)):
        if acc_list[i] == 1:
            score += (i+1) * 100 * p[i]
            score += c[i]
    return score

def DFSQestion(acc_list):
    
    if len(acc_list) == D:
        score = ScoreCalculation(acc_list)
        if score >= G:
            question_num = AccuracyQestionNum(acc_list, 0)
            print(acc_list, 0)
        else:
            count = FinalQestionNum(acc_list, score)
            if count == None:
                return None
            else:
                question_num = AccuracyQestionNum(acc_list, count)
        return question_num
    else:
        question_num1 = DFSQestion(acc_list + [0])
        question_num2 = DFSQestion(acc_list + [1])
        if question_num1 == None:
            return question_num2
        if question_num2 == None:
            return question_num1
        if question_num1 >= question_num2:
            return question_num2
        else:
            return question_num1
        
question_num = DFSQestion([])

print(question_num)





D, G = [int(i) for i in input().split()]

p = []
c = []
for i in range(D):
    tmp = [int(i) for i in input().split()]
    p.append(int(tmp[0]))
    c.append(int(tmp[1]))

def AccuracyQestionNum(acc_list, count):
    counter = count
    for i in range(len(acc_list)):
        if acc_list[i] == 1:
            counter += p[i]
    return counter

def MaxScoreIndex(acc_list):
    for i in reversed(range(len(acc_list))):
        if acc_list[i] == 0:
            return i
        
def FinalQestionNum(acc_list, score):
    remain_point = G - score
    counter = 0
    max_score_index = MaxScoreIndex(acc_list)
    for i in range(p[max_score_index]):
        remain_point -= (max_score_index+1) * 100
        counter += 1
        if remain_point <= 0:
            break

    if counter == p[max_score_index]:
        return None
    else:
        return counter
        
def ScoreCalculation(acc_list):
    score = 0
    for i in range(len(acc_list)):
        if acc_list[i] == 1:
            score += (i+1) * 100 * p[i]
            score += c[i]
    return score

def DFSQestion(acc_list):
    
    if len(acc_list) == D:
        score = ScoreCalculation(acc_list)
        if score >= G:
            question_num = AccuracyQestionNum(acc_list, 0)
        else:
            count = FinalQestionNum(acc_list, score)
            if count == None:
                return None
            else:
                question_num = AccuracyQestionNum(acc_list, count)
        return question_num
    else:
        question_num1 = DFSQestion(acc_list + [0])
        question_num2 = DFSQestion(acc_list + [1])
        if question_num1 == None:
            return question_num2
        if question_num2 == None:
            return question_num1
        if question_num1 >= question_num2:
            return question_num2
        else:
            return question_num1
        
question_num = DFSQestion([])

print(question_num)





Verdicts: Wrong Answer

Accepted