Problem:


Score : 300 points

Problem Statement

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?

Constraints

1 ≤ D ≤ 10

1 ≤ p_i ≤ 100

100 ≤ c_i ≤ 10^6

100 ≤ G

All values in input are integers.

c_i and G are all multiples of 100.

It is possible to have a total score of G or more points.

Input

Input is given from Standard Input in the following format:

D G
p_1 c_1
:
p_D c_D

Output

Print the minimum number of problems that needs to be solved in order to have a total score of G or more points. Note that this objective is always achievable (see Constraints).

Sample Input 1

2 700
3 500
5 800

Sample Output 1

3

In this case, there are three problems each with 100 points and five problems each with 200 points. The perfect bonus for solving all the 100-point problems is 500 points, and the perfect bonus for solving all the 200-point problems is 800 points. Takahashi's objective is to have a total score of 700 points or more.

One way to achieve this objective is to solve four 200-point problems and earn a base score of 800 points. However, if we solve three 100-point problems, we can earn the perfect bonus of 500 points in addition to the base score of 300 points, for a total score of 800 points, and we can achieve the objective with fewer problems.

Sample Input 2

2 2000
3 500
5 800

Sample Output 2

7

This case is similar to Sample Input 1, but the Takahashi's objective this time is 2000 points or more. In this case, we inevitably need to solve all five 200-point problems, and by solving two 100-point problems additionally we have the total score of 2000 points.

Sample Input 3

2 400
3 500
5 800

Sample Output 3

2

This case is again similar to Sample Input 1, but the Takahashi's objective this time is 400 points or more. In this case, we only need to solve two 200-point problems to achieve the objective.

Sample Input 4

5 25000
20 1000
40 1000
50 1000
30 1000
1 1000

Sample Output 4

66

There is only one 500-point problem, but the perfect bonus can be earned even in such a case. 



Sample input:
2 700
3 500
5 800


Sample output:
3

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 標準入力を取得
D, G = list(map(int, input().split()))
p, c = [], []
for i in range(D):
    p_i, c_i = list(map(int, input().split()))
    p.append(p_i)
    c.append(c_i)

# 求解処理
S = {i: [p[i - 1], 100 * i + c[i - 1]] for i in range(1, D + 1)}
score = sum([100 * i * p[i - 1] + c[i - 1] for i in range(1, D + 1)])
while True:
    number, _ = min(S.items(), key=lambda s: s[1][1])
    score -= S[number][1]
    if score < G:
        break
    S[number][0] -= 1
    S[number][1] = 100 * number
    if S[number][0] == 0:
        del S[number]

ans = sum([value[0] for value in S.values()])

# 結果出力
print(ans)

Submission status: Wrong Answer

Solution code:
D,G=map(int,input().split())
pc=[list(map(int,input().split())) for _ in range(D)]
ans=1000

def solve(bit):
  if bit >= D:
    return 1000
  p_sum=0
  num=0
  
  for i in range(D):
    if bit & (1<<i):
      p_sum += pc[i][1] + pc[i][0] * 100*(i+1)
      num += pc[i][0]
  if p_sum >= G:
    return min(num,solve(i+1))
  else:
    for i in reversed(range(D)):
      if bit & 1<<i:
        continue
      for j in range(pc[i][0]):
        if p_sum >= G:
          break
        p_sum += 100*(i+1)
        num += 1
      break
    return min(num,solve(i+1))

print(solve(1))

Submission status: Wrong Answer

Solution code:
d,g=[int(_) for _ in input().split()]
l=[0]+[list(map(int,input().split())) for _ in  range(d)]
print(l)
def f(i,g):
	if i==0:return 10**9
	c=min(g//(100*i),l[i][0])
	s=100*i*c
	if c==l[i][0]:s+=l[i][1]
	if s<g:
		c+=f(i-1,g-s)
	return min(c,f(i-1,g))
print(f(d,g))

Submission status: Wrong Answer

Solution code:
def main():
	D,G = map(int,input().split())
	ListPC = [list(map(int,input().split())) for d in range(D)]
	ans = sum([i[0] for i in ListPC])

	for i in range(2**D):
		TempPoint,num,restmax = 0,0,-1  # 点数,正解数,解いてない最高点数idx
		for j in range(D):  # 全埋め問題加算
			if i>>j & 1:
				TempPoint += 100*(j+1)*ListPC[j][0]+ListPC[j][1]
				num += ListPC[j][0]
			else:
				restmax = max(j,restmax)
		if TempPoint >= G: # 合格なら更新
			ans = min(num,ans)
		elif G - TempPoint // ((restmax + 1) * 100) <= ListPC[restmax][0]: # 最高問題解いて合格なら更新
			ans = min(num + (G - TempPoint - 1) // ((restmax + 1) * 100) + 1, ans)
		print(ans)

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

Solution code:
from itertools import permutations

def cal():
    d, g = map(int, input().split())
    a = list(permutations([[i+1]+list(map(int, input().split())) for i in range(d)]))
    ans = float('inf')

    for i in a:
        val, count = g, 0
        for j, k in enumerate(i):
            num = 100*k[0]*k[1]
            if num+k[2] >= val:
                count += val//(100*k[0])
                break
            else:
                count += k[1]
                val -= num+k[2]
        ans = min(ans, count)
    print(ans)

cal()

Submission status: Wrong Answer

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    D, G = LI()
    pc = [LI() for _ in range(D)]

    # コンプリートする問題を全パターン試す
    # 足りない分があれば解いてない最高点数の問題で埋める
    ans = sum([i[0] for i in pc])
    for i in range(2 ** D):
        score = 0
        num = 0
        not_completed_max = -1
        for j in range(D):
            if i >> j & 1:
                score += pc[j][0] * (j + 1) * 100  + pc[j][1]
                num += pc[j][0]
            else:
                not_completed_max = max(j, not_completed_max)
        if score >= G:
            ans = min(num, ans)
        elif (G - score) // ((not_completed_max + 1) * 100) <= pc[not_completed_max][0]:
            ans = min(num + (G - score) // ((not_completed_max + 1) * 100), ans)

    print(ans)

if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

Solution code:
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    D, G = LI()
    pc = [LI() for _ in range(D)]

    # コンプリートする問題を全パターン試す
    # 足りない分があれば解いてない最高点数の問題で埋める
    ans = sum([i[0] for i in pc])
    for i in range(2 ** D):
        score = 0
        num = 0
        not_completed_max = -1
        for j in range(D):
            if i >> j & 1:
                score += pc[j][0] * (j + 1) * 100  + pc[j][1]
                num += pc[j][0]
            else:
                not_completed_max = max(j, not_completed_max)
        if score >= G:
            ans = min(num, ans)
        elif (G - score) // ((not_completed_max + 1) * 100) < pc[not_completed_max][0]:
            ans = min(num + (G - score) // ((not_completed_max + 1) * 100), ans)

    print(ans)

if __name__ == '__main__':
    resolve()

Submission status: Wrong Answer

Solution code:
d,g=map(int,input().split())
pc=[list(map(int,input().split())) for _ in range(d)]
ans=float('inf')
for i in range(d**2):
  al=[]
  notal=[]
  anstmp=0
  score=0
  for j in range(d):
    if (i>>j)&1:al.append(j)
    else:notal.append(j)
  for j in al:
    score+=(j+1)*100*pc[j][0]
    score+=pc[j][1]
    anstmp+=pc[j][0]
  while notal and score<g:
    j=notal.pop()
    k=(g-score+(j+1)*100-1)//((j+1)*100)
    k=min(k,pc[j][0]-1)
    score+=(j+1)*100*k
    anstmp+=k
  #print(al,anstmp,score)
  if score>=g:ans=min(ans,anstmp)
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
from itertools import product

ans = 10**9

D, G=map(int, input().split()) 
problem=[list(map(int,list(input().split()))) for i in range(D)]

for p in product([True, False], repeat=D):
    
    point = 0
    num = 0
    
    for i in range(D):
        if p[i]:
            point += (i+1) * 100 * problem[i][0] + problem[i][1]
            num += problem[i][0]
            
    if point >= G:
        ans = min(ans, num)
    
    for i in reversed(range(D)):
        if p[i] == False:
            if point >= G:
                ans = min(ans, num)
                break
            for j in range(problem[i][0]):
                point += (i+1) * 100
                num += 1
                if point >= G:
                    break
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
from itertools import product

ans = 10**9

D, G=map(int, input().split()) 
problem=[list(map(int,list(input().split()))) for i in range(D)]

for p in product([True, False], repeat=D):
    
    point = 0
    num = 0
    
    for i in range(D):
        if p[i]:
            point += (i+1) * 100 * problem[i][0] + problem[i][1]
            num += problem[i][0]
    
    for i in reversed(range(D)):
        if p[i] == False:
            if point >= G:
                ans = min(ans, num)
                break
            for j in range(problem[i][0]):
                point += (i+1) * 100
                num += 1
                if point >= G:
                    break
print(ans)

Submission status: Wrong Answer

Solution code:
d,g = map(int,input().split())
prob = []
for i in range(d):
  p,c = map(int,input().split())
  prob.append([p,c,p*(i+1)*100+c])
  
mindays = 10**9
for i in range(2**d):
  point = 0
  days = 0
  one = []
  for j in range(d):
    if ((i>>j)&1)==0:
      point += prob[j][2]
      days += prob[j][0]
    else:
      one.append(j+1)
  if point>=g:
    mindays = min(mindays,days)
  elif point<g:
    for k in range(len(one)):
        day =days
        tmp = (g-point)//(one[k]*100)
        if tmp<=prob[one[-1]-1][0]:
          day += tmp
          mindays = min(mindays,day)
print(mindays)

Submission status: Wrong Answer

Solution code:
d,g = map(int,input().split())
prob = []
for i in range(d):
  p,c = map(int,input().split())
  prob.append([p,c,p*(i+1)*100+c])
  
mindays = 10**9
for i in range(2**d):
  point = 0
  days = 0
  one = []
  for j in range(d):
    if ((i>>j)&1)==0:
      point += prob[j][2]
      days += prob[j][0]
    else:
      one.append(j+1)
  if point>=g:
    mindays = min(mindays,days)
  elif point<g:
    tmp = (g-point)//(one[-1]*100)
    if tmp<=prob[one[-1]-1][0]:
      days += tmp
      mindays = min(mindays,days)
print(mindays)

Submission status: Wrong Answer

Solution code:
d,g = map(int,input().split())
prob = []
for i in range(d):
  p,c = map(int,input().split())
  prob.append([p,c,p*(i+1)*100+c])
  
mindays = 10**9
for i in range(2**d):
  point = 0
  days = 0
  one = []
  for j in range(d):
    if ((i>>j)&1)==0:
      point += prob[j][2]
      days += prob[j][0]
    else:
      one.append(j+1)
  if point>=g:
    mindays = min(mindays,days)
  elif point<g:
    tmp = (g-point)//(one[-1]*100)
    if tmp<=prob[one[-1]-1][0]:
      days += tmp
      mindays = min(mindays,days)
    else:
      print(mindays)
      exit()
  
print(mindays)

Submission status: Wrong Answer

Solution code:
d,g = map(int,input().split())
prob = []
for i in range(d):
  p,c = map(int,input().split())
  prob.append([p,c,p*(i+1)*100+c])
  
mindays = 10**9
for i in range(2**d):
  point = 0
  days = 0
  one = []
  for j in range(d):
    if ((i>>j)&1)==0:
      point += prob[j][2]
      days += prob[j][0]
    else:
      one.append(j+1)
  if point<g:
    tmp = (g-point)//(one[-1]*100)
    if tmp<=prob[one[-1]-1][0]:
      days += tmp
  mindays = min(mindays,days)
print(mindays)

Submission status: Wrong Answer

Solution code:
d,g = map(int,input().split())
prob = []
for i in range(d):
  p,c = map(int,input().split())
  prob.append([p,c,p*(i+1)*100+c])
  
mindays = 10**9
for i in range(2**d):
  point = 0
  days = 0
  one = []
  for j in range(d):
    if ((i>>j)&1)==0:
      point += prob[j][2]
      days += prob[j][0]
    else:
      one.append(j+1)
  if point<g:
    tmp = (g-point)//(one[-1]*100)
    if tmp<=prob[one[-1]-1][0]:
      days += tmp
    else:
      print(mindays)
      exit()
  mindays = min(mindays,days)
print(mindays)

Submission status: Wrong Answer

Solution code:
d,g = map(int,input().split())
p,c = [],[]
ans = float('inf')
for i in range(d):
    x,y = map(int,input().split())
    p.append(x)
    c.append(y)
for i in range((1<<d)):
    tmp,cnt = 0,0
    for j in range(d):
        if i&(1<<j):
            tmp = tmp + 100*(j+1)*p[j]+c[j]
            cnt += p[j]
    if tmp>=g:
        if cnt<ans: print(cnt);ans=cnt
    else:
        for j in range(d-1,-1,-1):
            if i&(1<<j): continue
            for k in range(p[j]):
                if tmp>=g: break
                tmp = tmp + 100*(j+1)
                cnt+=1
        if cnt<ans: ans = cnt
print(ans)

Submission status: Wrong Answer

Solution code:
from itertools import combinations
D,G = map(int,input().split())
i_Problem = [0] * D 
i_completepoint = [0] * D
for i in range(D):
    p,c = map(int,input().split())
    i_Problem[i] = p
    i_completepoint[i] = c

problems = [i for i in range(D)]
ans = float('inf')
for i in range(D+1):
    for group_to_complete in combinations(problems,i):
        points = 0
        problems_done = 0
        for group in group_to_complete:
            points += i_Problem[group]*(group+1)*100 + i_completepoint[group]
            problems_done += i_Problem[group]

        total_problem = sum(i_Problem)
        next_point = [0] * (total_problem-problems_done)
        next_ind = 0
        for j in range(D-1,-1,-1):
            if j not in group_to_complete:
                for _ in range(i_Problem[j]):
                    next_point[next_ind] = (j+1)*100
                    next_ind += 1
        assert next_ind == total_problem-problems_done

        k = 0
        while points < G:
            points += next_point[k]
            k += 1
            problems_done += 1
            if (k+1<len(next_point) and next_point[k] != next_point[k+1]) or k+1 == len(next_point):
                points += i_completepoint[next_point[k]//100-1]
        ans = min(ans,problems_done)
print(ans)

Submission status: Wrong Answer

Solution code:
from itertools import combinations
D,G = map(int,input().split())
i_Problem = [0] * D 
i_completepoint = [0] * D
for i in range(D):
    p,c = map(int,input().split())
    i_Problem[i] = p
    i_completepoint[i] = c

problems = [i for i in range(D)]
ans = float('inf')
for i in range(D+1):
    for group_to_complete in combinations(problems,i):
        points = 0
        problems_done = 0
        for group in group_to_complete:
            points += i_Problem[group]*(group+1)*100 + i_completepoint[group]
            problems_done += i_Problem[group]

        total_problem = sum(i_Problem)
        next_point = [0] * (total_problem-problems_done)
        next_ind = 0
        for j in range(D-1,-1,-1):
            if j not in group_to_complete:
                for _ in range(i_Problem[j]):
                    next_point[next_ind] = (j+1)*100
                    next_ind += 1
        assert next_ind == total_problem-problems_done

        k = 0
        while points < G:
            points += next_point[k]
            k += 1
            problems_done += 1
            if k+1<len(next_point) and next_point[k] != next_point[k+1] or k+1 == len(next_point):
                points += i_completepoint[next_point[k]//100-1]
        ans = min(ans,problems_done)
print(ans)

Submission status: Wrong Answer

Solution code:
def main():
  ans = 1000
  d,g  = map(int,input().split())
  pc = [list(map(int,input().split())) for i in range(d)]
  pc.reverse()
  #print(pc)
  for i in range(1, 2 ** d):
    score = 0
    count = 0
    for j in range(d):
      if i & (1<<j):
        score += pc[j][0] * (d-j) * 100 + pc[j][1]
        count += pc[j][0]
    if score >= g:
      if ans > count:
        ans = count
      #print(bin(i),count,score)
      continue
    for j in range(d):
      if not(i &(1<<j)):
        #print("nokori"+str(j))
        c = 0
        for k in range(1,pc[j][0]):
          score += (d-j) * 100
          count += 1
          c += 1
          if score >= g:
            if ans > count:
              ans = count
            #print(bin(i),j,c,count,score)
            break
        break
  print(ans)

if __name__ == '__main__':
  ans = 0
  main()

Submission status: Wrong Answer

Solution code:
def dsf(i,sum,count,nokori):
    global ans
    # 階層が最下層になった時
    if i == d:
        #sumは絶対答えではない
        if sum < g:
            use = max(nokori)
            n = min(pc[use - 1][0],((g - sum) // (100 * use)))
            count += n
            sum += n * use * 100


        # sumは答えになる可能性あり
        if sum >= g:
            ans = min(ans,count)
    else:
        #問題を解かないパターン
        dsf(i+1,sum,count,nokori)
        #問題を解くパターン(階層、合計+最大のボーナス、現在の合計の数+最大の数、残りの問題を管理)
        dsf(i + 1,sum + pc[i][0] * (i + 1) * 100 + pc[i][1],count + pc[i][0],nokori - {i + 1})
# 解く問題ととかない問題
d,g = map(int,input().split())
pc = [list(map(int,input().split())) for i in range(d)]
ans = float('inf')

#階層、合計、現在の合計の数、残りの問題を管理
dsf(0,0,0,set(range(1,d + 1)))
print(ans)

Submission status: Wrong Answer

Solution code:
def dsf(i,sum,count,nokori):
    global ans
    # 階層が最下層になった時
    if i == d:
        #sumは絶対答えではない
        if g > sum:
            use = max(nokori)
            n = min(pc[use-1][0],((g - sum) // (100 * use)))
            sum = sum + n * use * 100
            count = count + n

        # sumは答えになる可能性あり
        if g <= sum:
            ans = min(ans,count)
    else:
        #問題を解かないパターン
        dsf(i+1,sum,count,nokori)
        #問題を解くパターン(階層、合計+最大のボーナス、現在の合計の数+最大の数、残りの問題を管理)
        dsf(i + 1,sum + pc[i][0] * (i + 1) * 100 + pc[i][1],count + pc[i][0],nokori - {i + 1})
# 解く問題ととかない問題
d,g = map(int,input().split())
pc = [list(map(int,input().split())) for i in range(d)]
ans = float('inf')

#階層、合計、現在の合計の数、残りの問題を管理
dsf(0,0,0,set(range(1,d + 1)))
print(ans)

Submission status: Wrong Answer

Solution code:
from math import ceil

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

ans = float("inf")
for bit in range(1 << D):
    cnt = 0
    sum = 0
    remain = set(range(1,D+1))

    for i in range(D):
        if bit & (1 << i):
            cnt += pc[i][0]
            sum += pc[i][0]*(i+1)*100 + pc[i][1]
            remain.discard(i+1)

    if sum < G:
        use = max(remain)
        if int((G-sum)%(use*100)) == 0:
            n = min(pc[use-1][0], (G - sum)/(use*100))
        else:
            n = min(pc[use-1][0], (G - sum)//(use*100)+1) 
        cnt += n
        sum += n*use*100

    if sum >= G:
        ans = min(ans,cnt)

print(ans)

Submission status: Wrong Answer

Solution code:
from math import ceil

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

ans = float("inf")
for bit in range(1 << D):
    cnt = 0
    sum = 0
    remain = set(range(1,D+1))

    for i in range(D):
        if bit & (1 << i):
            cnt += pc[i][0]
            sum += pc[i][0]*(i+1)*100 + pc[i][1]
            remain.discard(i+1)

    if sum < G:
        use = max(remain)
        if (G-sum)%(use*100) == 0:
            n = min(pc[use-1][0], (G - sum)/(use*100))
        else:
            n = min(pc[use-1][0], (G - sum)//(use*100)+1) 
        cnt += n
        sum += n*use*100

    if sum >= G:
        ans = min(ans,cnt)

print(ans)

Submission status: Wrong Answer

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

ans = float("inf")
for bit in range(1 << D):
    cnt = 0
    sum = 0
    remain = set(range(1,D+1))

    for i in range(D):
        if bit & (1 << i):
            cnt += pc[i][0]
            sum += pc[i][0]*(i+1)*100 + pc[i][1]
            remain.discard(i+1)

    if sum < G:
        use = max(remain)
        if use == 0:
            n = 0
        elif (G - sum)%(use%100) == 0:
            n = min(pc[use-1][0], (G - sum)//(use*100))
        else:
            n = min(pc[use-1][0], (G - sum)//(use*100)+1)
        cnt += n
        sum += n*use*100

    if sum >= G:
        ans = min(ans,cnt)

print(ans)

Submission status: Wrong Answer

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

ans = float("inf")
for bit in range(1 << D):
    cnt = 0
    sum = 0
    remain = set(range(1,D+1))

    for i in range(D):
        if bit & (1 << i):
            cnt += pc[i][0]
            sum += pc[i][0]*(i+1)*100 + pc[i][1]
            remain.discard(i+1)

    if sum < G:
        use = max(remain)
        if (G - sum)%(use%100) == 0:
            n = min(pc[use-1][0], (G - sum)//(use*100))
        else:
            n = min(pc[use-1][0], (G - sum)//(use*100)+1)
        cnt += n
        sum += n*use*100

    if sum >= G:
        ans = min(ans,cnt)

print(ans)

Submission status: Wrong Answer

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

ans = float("inf")
for bit in range(1 << D):
    cnt = 0
    sum = 0
    remain = set(range(1,D+1))

    for i in range(D):
        if bit & (1 << i):
            cnt += pc[i][0]
            sum += pc[i][0]*(i+1)*100 + pc[i][1]
            remain.discard(i+1)

    if sum < G:
        use = max(remain)
        n = min(pc[use-1][0], (G - sum)//(use*100)+1)
        cnt += n
        sum += n*use*100

    if sum >= G:
        ans = min(ans,cnt)

print(ans)

Submission status: Wrong Answer

Solution code:
D, G = map(int, input().split())

pc = []
for i in range(D):
    pc.append(list(map(int, input().split())))

pc.sort(key=lambda x: x[0])

ans = 0
for p, c in pc:
    if (p * 100) < G:
        ans += p
        if (p * 100) + c < G:
            G -= (p * 100) + c
        else:
            break
    else:
        ans += (((p * 100) - G) // 100)
        break
print(ans)

Submission status: Wrong Answer

Solution code:
D, G = map(int, input().split())
p = [0] * D
c = [0] * D
for i in range(D):
    p[i], c[i] = map(int, input().split())

ans = 1001
import math
for i in range(2*D):
    pp = 0
    t = 0
    b = format(i, "0" + str(D) + "b")
    for j in range(D):
        pp += (100 * (j + 1) * p[j] + c[j]) * int(b[j])
        t += p[j] * int(b[j])
    if pp >= G:
        ans = min(ans, t)
        continue
    for k in range(D-1, -1, -1):
        if b[k] == "0":
            a = math.ceil((G - pp)//100/(k+1))
            if a < p[k]:
                t += a
                ans = min(ans, t)
                break
            else:
                t += p[k]-1
                pp += 100*(p[k] - 1)

print(ans)

Submission status: Wrong Answer

Solution code:
D, G = map(int, input().split())
p = [0] * D
c = [0] * D
for i in range(D):
    p[i], c[i] = map(int, input().split())

ans = 1001
import math
for i in range(2*D):
    pp = 0
    t = 0
    b = format(i, "0" + str(D) + "b")
    for j in range(D):
        pp += (100 * (j + 1) * p[j] + c[j]) * int(b[j])
        t += p[j] * int(b[j])
    if pp >= G:
        ans = min(ans, t)
        continue
    for k in range(D-1, -1, -1):
        if b[k] == "0":
            a = math.ceil((G - pp)//100/(k+1))
            if a < p[k]:
                t += a
                ans = min(ans, t)
                break
            else:
                t += p[k]-1

print(ans)

Submission status: Wrong Answer

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

ans = float("inf")
for bit in range(1 << D):
    cnt = 0
    sum = 0
    remain = set(range(1,D+1))

    for i in range(D):
        if bit & (1 << i):
            cnt += pc[i][0]
            sum += pc[i][0]*(i+1)*100 + pc[i][1]
            remain.discard(i+1)

    if sum < G:
        use = max(remain)
        n = min(pc[use-1][0], (G - sum)//(use*100))
        cnt += n
        sum += n*use*100

    if sum >= G:
        ans = min(ans,cnt)

print(ans)

Submission status: Wrong Answer

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

ans = float("inf")
for bit in range(1 << D):
    cnt = 0
    sum = 0
    remain = set(range(1,D+1))

    for i in range(D):
        if bit & (1 << i):
            cnt += pc[i][0]
            sum += pc[i][0]*(i+1)*100 + pc[i][1]
            remain.discard(i+1)

    if sum < G:
        use = max(remain)
        n = min(pc[use-1][0],(G - sum)//(use*100))
        cnt += n
        sum += n*use*100
    if sum >= G:
        ans = min(ans,cnt)

print(ans)

Submission status: Wrong Answer

Solution code:
D,G=map(int,input().split())
pc=[list(map(int,input().split())) for i in range(D)]
print(pc)
ans=G // 100

for i in range(2**D):
    score=0
    b=0
    cnt=0
    for j in range(D):
        if ((i>>j)&1):
            score+=100*(j+1)*pc[j][0]+pc[j][1]
            cnt+=pc[j][0]
        else:
            b=j
    for k in range(pc[b][0]):
        if score>=G and cnt<ans:
            ans=cnt
        score+=(b+1)*100
        cnt+=1
print(ans)

Submission status: Wrong Answer

Solution code:
D,G=map(int,input().split())
pc=[list(map(int,input().split())) for i in range(D)]
print(pc)
ans=G // 100

for i in range(2**D):
    score=0
    b=0
    cnt=0
    for j in range(D):
        if ((i>>j)&1):
            score+=100*(j+1)*pc[j][0]+pc[j][1]
            cnt+=pc[j][0]
        else:
            b=j
    for k in range(pc[b][0]):
        print(ans)
        if score>=G and cnt<ans:
            ans=cnt
        score+=(b+1)*100
        cnt+=1
print(ans)

Submission status: Wrong Answer

Solution code:
d,g = map(int, input().split())
pc = list(list(map(int,input().split())) for _ in range(d))
ans = float("inf")
          
for i in range(1<<d):
    count = 0
    sum = 0
    nokori = set(range(1, d+1))
    
    # ボーナスをもらえる解答のみでスコアを計算
    for j in range(d):
        if i & 1<<j:
            sum += pc[j][0]*(j+1)*100+pc[j][1] # 基本＋ボーナス
            count += pc[j][0] # p_n問解いた
            nokori.discard(j+1)
            
    # スコアがG点に届かない場合
    if sum < g:
        use = max(nokori)
        n = min(pc[use-1][0], (g-sum)//(use*100))
        count += n
        sum += n*use*100
        
    # スコアがG点に届いた場合
    if sum >= g:
        ans = min(ans, count)
print(ans)

Submission status: Wrong Answer

Solution code:
d,g = map(int, input().split())
pc = list(list(map(int,input().split())) for _ in range(d))
ans = float("inf")
          
for i in range(1<<d):
    count = 0
    sum = 0
    nokori = set(range(1, d+1))
    
    # ボーナスをもらえる解答のみでスコアを計算
    for j in range(d):
        if i & 1<<j:
            sum += pc[j][0]*(j+1)*100+pc[j][1]
            count += pc[j][0]
            nokori.discard(j+1)
            
    # スコアがG点に届かない場合
    if sum < g:
        use = max(nokori)
        n = min(pc[use-1][0], (g-sum)//(use*100))
        count += n
        sum += n*use*100
        
    # スコアがG点に届いた場合
    if sum >= g:
        ans = min(ans, count)
print(ans)

Submission status: Wrong Answer

Solution code:
d,g = map(int, input().split())
pc = list(list(map(int,input().split())) for _ in range(d))
ans = float("inf")
for i in range(1<<d):
    count = 0
    sum = 0
    nokori = set(range(1, d+1))
    
    # ボーナスをもらえる解答のみでスコアを計算
    for j in range(d):
        if j & 1<<i:
            sum += pc[i][0]*(i+1)*100+pc[i][1]
            count += pc[i][0]
            nokori.discard(i+1)
            
    # スコアがG点に届かない場合
    if sum < g:
        use = max(nokori)
        n = min(pc[use-1][0], -(-(g-sum)//(use*100)))
        count += n
        sum += n*use*100
        
    # スコアがG点に届いた場合
    if sum >= g:
        ans = min(ans, count)
print(ans)

Submission status: Wrong Answer

Solution code:
d,g = map(int, input().split())
pc = list(list(map(int,input().split())) for _ in range(d))
ans = float("inf")
for i in range(1<<d):
    count = 0
    sum = 0
    nokori = set(range(1, d+1))
    
    # ボーナスをもらえる解答のみでスコアを計算
    for j in range(d):
        if j & 1<<i:
            sum += pc[i][0]*(i+1)*100+pc[i][1]
            count += pc[i][0]
            nokori.discard(i+1)
            
    # スコアがG点に届かない場合
    if sum < g:
        use = max(nokori)
        n = min(pc[use-1][0], (g-sum)//(use*100))
        count += n
        sum += n*use*100
        
    # スコアがG点に届いた場合
    if sum >= g:
        ans = min(ans, count)
print(ans)

Submission status: Wrong Answer

Solution code:
#スコアg以上にしたい
import math
d,g = list(map(int, input().split()))
pca = []
for i in range(1,d+1):
    p,c = list(map(int, input().split()))
    pca.append((p,c,100*i*p+c,100*i))
    

ls = [0]*d
param_list = [0]*2**d
for i in range(2**d):
    l = [False]*d
    for id_r, row in enumerate(ls):
        if i & (2 ** id_r) >0:
            l[id_r] = True
    param_list[i] = l 

ans = 10**8
for an in param_list:
    pcs = pca.copy()
    score = 0
    num = 0
    for i in range(d-1,-1,-1):
        if an[i]:
            score += pcs[i][2]
            num += pcs[i][0]

    if score >= g:
        ans = min(ans,num)
    else:
        for test in range(d-1,-1,-1):
            if not an[test]:
                k =  math.floor((g-score)/pcs[test][3])
                if k <= pcs[test][0]:
                    num += k
                    ans = min(ans,num)
    
        
print(ans)

Submission status: Wrong Answer

Solution code:
#スコアg以上にしたい
import math
d,g = list(map(int, input().split()))
pca = []
for i in range(1,d+1):
    p,c = list(map(int, input().split()))
    pca.append((p,c,100*i*p+c,100*i))
    

ls = [0]*d
param_list = [0]*2**d
for i in range(2**d):
    l = [False]*d
    for id_r, row in enumerate(ls):
        if i & (2 ** id_r) >0:
            l[id_r] = True
    param_list[i] = l 

ans = 10**8
for an in param_list:
    pcs = pca.copy()
    score = 0
    num = 0
    for i in range(d-1,-1,-1):
        if an[i]:
            score += pcs[i][2]
            num += pcs[i][0]
            pcs.pop(i)

    if score >= g:
        ans = min(ans,num)
    elif len(pcs) > 0 and g > score:
        k =  math.floor((g-score)/pcs[-1][3])
        if k <= pcs[-1][0]:
            num += k
            ans = min(ans,num)
    
        
print(ans)