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 math
import copy
import sys
import fractions
import numpy as np
from functools import reduce

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum

def getInputListInt():
    outputoData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData

def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList

def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList

# ===CODE===

d, g = map(int, input().split())
data = getSomeInputListInt(d)
basecost = 100

ans = 0

for i in range(d):
    data[i].insert(0, i+1)
    data[i].append(0)

flg = True

while(flg):

    for i in range(len(data)):
        if basecost * data[i][0] * data[i][1] + data[i][2] <= g:
            data[i][3] = basecost * data[i][0] + data[i][2]/data[i][1]
        else:
            data[i][3] = basecost * data[i][0]

    data = sorted(data, key=lambda x:x[3], reverse=True)

    flg2 = True
    while(flg2):
        g -= data[0][0]*basecost
        data[0][1] -= 1
        ans += 1

        if data[0][1] == 0:
            g -= data[0][2]
            flg2 = False
            del data[0]

        if g <= 0 :
            flg2 = False
            flg = False

print(ans)

import math
import copy
import sys
import fractions
import numpy as np
from functools import reduce


# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputoData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

basecost = 100


def dfs(i, total, cnt, nokori):
    global ans
    if i == d:
        if total < g:
            use = max(nokori)
            n = min(data[use - 1][0], -(-(g - total) // (use * basecost)))
            cnt += n
            total += n * use * basecost + data[use - 1][1]
        if total >= g:
            ans = min(ans, cnt)
    else:
        dfs(i + 1, total, cnt, nokori)
        dfs(i + 1, total + (i + 1) * data[i][0] * basecost + data[i][1], cnt + data[i][0], nokori - {i+1})


d, g = map(int, input().split())
data = getSomeInputListInt(d)

ans = sys.maxsize

dfs(0, 0, 0, set(range(1, d + 1)))
print(ans)


Verdicts: Wrong Answer

Accepted