problem_id
stringlengths
6
6
user_id
stringlengths
10
10
time_limit
float64
1k
8k
memory_limit
float64
262k
1.05M
problem_description
stringlengths
48
1.55k
codes
stringlengths
35
98.9k
status
stringlengths
28
1.7k
submission_ids
stringlengths
28
1.41k
memories
stringlengths
13
808
cpu_times
stringlengths
11
610
code_sizes
stringlengths
7
505
p03103
u235210692
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m=[int(i) for i in input().split()]\n\nmise={}\nfor i in range(n):\n a,b=[int(j) for j in input().split()]\n if a in mise:\n mise[a]+=b\n else:\n mise[a]=b\nnedan=list(mise.keys())\nnedan.sort()\ni=0\nans=0\nwhile m:\n honnsuu=mise[nedan[i]]\n kauno=min(honnsuu,m)\n ans+=kauno*nedan[...
['Wrong Answer', 'Accepted']
['s852709072', 's053461843']
[22492.0, 17884.0]
[463.0, 432.0]
[367, 339]
p03103
u236536206
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m=map(int,input().split())\ndrink=[list(map(int,input().split())) for i in range(n)]\n#print(drink)\n\ndrink.sort()\n#print(drink)\nmoney=0\nnumber=0\nfor i in range(n):\n if number+drink[i][0]=<m:\n money+=drink[i][0]*drink[i][1]\n number+=drink[i][1]\n elif m<number+drink[i][0]:\n money...
['Runtime Error', 'Accepted']
['s571008751', 's160925206']
[8916.0, 27320.0]
[26.0, 351.0]
[413, 413]
p03103
u238084414
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\nAB = {}\nfor i in range(N):\n a, b = map(int, input().split())\n AB[a] = b\nans = 0\nfor ab in AB:\n if M >= AB[ab]:\n ans += ab * AB[ab]\n M -= AB[ab]\n else:\n ans += ab * M\n break\nprint(ans)', 'N, M = map(int, input().split())\nAB = []\nfor i in range(N):\n a, b...
['Wrong Answer', 'Accepted']
['s694626950', 's951774753']
[17884.0, 21992.0]
[333.0, 401.0]
[232, 296]
p03103
u247554097
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['\nn, m = map(int, input().split())\nh = dict()\nfor _ in range(n):\n k, v = map(int, input().split())\n h[k] = v\nh = sorted(h.items(), key=lambda x: x[0])\n\n\nans = 0\nfor k, v in h:\n while v > 0:\n if m <= 0:\n exit()\n else:\n v -= 1\n ans += k\n ...
['Wrong Answer', 'Accepted']
['s348333133', 's789785024']
[24152.0, 24144.0]
[404.0, 415.0]
[340, 456]
p03103
u248967559
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
["class Shop():\n def __init__(self, a, b):\n self.a = a\n self.b = b\n\nN, M = [ int(x) for x in input().split(' ')]\nshops = []\nfor i in range(N):\n a, b = [int(x) for x in input().split(' ')]\n shops.append(Shop(a, b))\n\nshops.sort(key=lambda x: x.a)\n\ncost = 0\nbought = 0\nfor i in range(N...
['Wrong Answer', 'Accepted']
['s381475782', 's763708398']
[28308.0, 28308.0]
[786.0, 549.0]
[585, 542]
p03103
u255943004
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M = map(int,input().split())\nAB = []\nfor _ in range(N):\n AB.append([int(i) for i in input().split()])\nAB_sort = sorted(AB,key=lambda x : x[0])\nmoney = 0\nfor ab in AB_sort:\n if M >= ab[0]:\n money += ab[0] * ab[1]\n M -= ab[1]\n else:\n money += M * ab[1]\n break\nprint(mo...
['Wrong Answer', 'Accepted']
['s816341828', 's200376876']
[23520.0, 23520.0]
[397.0, 406.0]
[309, 310]
p03103
u261646994
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['import re\nimport numpy as np\n\nnp.seterr(over=\'raise\')\n\nN, M = [int(item) for item in re.split(r"\\s", input())]\n\nAB = []\nfor _ in range(N):\n AB.append([int(item) for item in re.split(r"\\s", input())])\n\nAB = np.array(AB)\nA = AB[:, 0]\nB = AB[:, 1]\n\nprint(AB)\n\nsorted_B = B[np.argsort(A)]\nsorted_A...
['Wrong Answer', 'Accepted']
['s429018551', 's795018487']
[31616.0, 31668.0]
[715.0, 715.0]
[542, 546]
p03103
u263830634
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['import sys\n\nN, M = map(int, input().split())\nlst = []\nfor i in range(N):\n lst += [list(map(int, input().split()))]\nlst.sort() \nprint (lst)\ncount = M\nyen = 0\n\nfor i in range(N):\n yen += lst[i][0] * min(count, lst[i][1]) \n count -= min(count, lst[i][1])\n# print (count)\n if count <= 0:\...
['Wrong Answer', 'Accepted']
['s041701988', 's526079569']
[33776.0, 18052.0]
[638.0, 253.0]
[341, 369]
p03103
u267683315
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M = map(int,input().split())\ndrink_dict = {}\nfor i in range(N):\n A,B = map(int,input().split())\n if A not in drink_dict:\n \tdrink_dict[A] = B\n else:\n drink_dict[A] += B \ntotal_number = 0\ntotal_price = 0\nfor price,number in drink_dict.items():\n if total_number + number >= M:\n print(total_price...
['Wrong Answer', 'Accepted']
['s432007099', 's637659873']
[17880.0, 22992.0]
[402.0, 432.0]
[397, 421]
p03103
u271469978
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['import numpy as np\nimport pandas as pd\n\nn, m = map(int, input().split())\nlines = sys.stdin.readlines()\nlines = [list(map(float, line.strip().split())) for line in lines]\ndf = pd.DataFrame(lines,\n columns = ["price", "stock"],\n dtype = float\n )\ndf = df.sort_...
['Runtime Error', 'Accepted']
['s904739778', 's245206774']
[21924.0, 42584.0]
[349.0, 505.0]
[566, 355]
p03103
u277353449
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m=map(int,input().split())\na=[]\nfor i in range(0,n):\n b,c=map(int,input().split())\n a.append([b,c])\na.sort()\nnumber=0\nfor i in range(0,len(a)):\n while number<m:\n number=number+a[i][1]\n l=i\nprint(l)\nanswer=0\nkosu=0\nfor k in range(0,l+1):\n answer=answer+a[k][0]*a[k][1]\n ko...
['Runtime Error', 'Runtime Error', 'Accepted']
['s579701490', 's683096290', 's238963842']
[20064.0, 3064.0, 20064.0]
[442.0, 17.0, 480.0]
[378, 333, 348]
p03103
u282228874
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M = map(int,input().split())\nAB = sorted([list(map(int,input().split())) for i in range(N)])\nres = 0\nfor a,b in range(N):\n M -= b\n res += a*b\n if M < 0:\n res += a*M\n break\nprint(res)', 'N,M = map(int,input().split())\nAB = sorted([list(map(int,input().split())) for i in range(N)])\nr...
['Runtime Error', 'Accepted']
['s455249796', 's234500250']
[28652.0, 28652.0]
[455.0, 508.0]
[207, 201]
p03103
u297756089
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m=map(int,input().split())\nsets = {}\ncosts_li=[]\nlimit_li=[]\nbought=0\npay=0\nfor i in range (1,n+1):\n cost,limit=map(int,input().split())\n limit_li.append(cost)\n costs_li.append(cost)\n sets[str(cost)]=limit\ncosts_li.sort()\nfor j in range(0,n+1):\n if bought<m:\n pay=pay+costs_li[j]*...
['Wrong Answer', 'Accepted']
['s306383464', 's882073649']
[25980.0, 27884.0]
[593.0, 481.0]
[511, 334]
p03103
u300579805
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['for i in range(N):\n A[i],B[i] = map(int, input().split()) \n\nC = dict(zip(A,B))\n\nc_sorted = sorted(C.items(), key=lambda x:x[0])\n\nans = 0\ncnt = 0\n\nfor k,v in dict(c_sorted).items():\n cnt += v\n if (cnt < M):\n ans += k*v\n else:\n ans += (M-cnt+v) * k\n break\nprint(ans) ',...
['Runtime Error', 'Accepted']
['s235873893', 's299530999']
[3064.0, 16964.0]
[17.0, 462.0]
[299, 186]
p03103
u304593245
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['import numpy as np\n\ndef solve():\n cnt = 0\n money = 0\n for i in range(N):\n if cnt >= M:\n break\n if cnt + AB[i][1] >= M:\n money += AB[i][0] * (M - cnt)\n cnt = M \n else:\n money += AB[i][0]*AB[i][1]\n cnt = AB[i][1]\n pr...
['Wrong Answer', 'Accepted']
['s493535010', 's740525847']
[46596.0, 46420.0]
[366.0, 374.0]
[523, 525]
p03103
u305965165
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = (int(i) for i in input().split()) \ne = [[int(i) for i in input().split()] for i in range(N)]\n\nresult = 0\nfor x in e:\n if M > x[1]:\n M -= x[1]\n result += x[0] * x[1]\n else:\n result += x[0] * M\n break\n\nprint(result)\n', 'N, M = (int(i) for i in input().split()) \ne...
['Wrong Answer', 'Accepted']
['s127336301', 's946446574']
[21164.0, 22376.0]
[324.0, 454.0]
[256, 266]
p03103
u315703650
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M = list(map(int,input().split()))\nab = [list(map(int,input().split())) for _ in range(N)]\n\nprint(ab)\nab.sort(key=lambda ab:(ab[0]))\nprint(ab)\ns = 0\ncnt = 0\nfor i in range(M):\n s += ab[cnt][0]\n if ab[cnt][1]>1:\n ab[cnt][1] -= 1\n else:\n cnt += 1\nprint(s)\n', 'N,M = list(map(int,i...
['Wrong Answer', 'Accepted']
['s337519581', 's617431715']
[38040.0, 29028.0]
[561.0, 455.0]
[279, 259]
p03103
u323125813
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['from pprint import pprint\ndef main():\n N,M = map(int,input().split())\n store_l = []\n for i in range(N):\n store_l.append(tuple(map(int,input().split())))\n\n store_l = sorted(store_l,key=lambda x:x[0])\n pprint(store_l)\n ans = 0\n buynum = 0\n for price,maxnum in store_l:\n ...
['Wrong Answer', 'Accepted']
['s902761325', 's684274060']
[29296.0, 18864.0]
[1660.0, 356.0]
[509, 463]
p03103
u325956328
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['import heapq\n\nN, M = map(int, input().split())\nL = []\nfor i in range(N):\n a, b = map(int, input().split())\n L.append((a, b))\n\nheapq.heapify(L)\n\nprint(L)\ndrink = 0\nyen = 0\nwhile drink < M:\n a, b = heapq.heappop(L)\n if drink + b <= M:\n yen += a * b\n drink += b\n else:\n ...
['Wrong Answer', 'Accepted']
['s435816332', 's885902557']
[23108.0, 16696.0]
[513.0, 488.0]
[397, 400]
p03103
u327532412
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['from operator import itemgetter\nN, M = map(int, input().split())\nAB = sorted([list(map(int, input().split())) for i in range(N)], key=itemgetter(0))\nans, tmp = 0, 0\nprint(AB)\nfor ab in AB:\n if ab[1] + tmp < M:\n tmp += ab[1]\n ans += ab[0] * ab[1]\n print(tmp, ans)\n else:\n an...
['Wrong Answer', 'Accepted']
['s751091215', 's702592191']
[34768.0, 29864.0]
[637.0, 446.0]
[354, 320]
p03103
u329865314
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m=map(int,input().split())\nlis = []\nfor _ in range(n):\n lis.append(list(map(int,input().split())))\nlis.sort()\nwhile(1):\n x,y = lis[0]\n if y >= m:\n ans += x*m\n break\n ans += x * y\n m -= y\n del(lis[0])\nprint(ans)', 'n,m=map(int,input().split())\nlis = []\nfor _ in range(n):\n lis.append(list...
['Runtime Error', 'Accepted']
['s088836538', 's089002815']
[27760.0, 27760.0]
[508.0, 510.0]
[224, 241]
p03103
u336624604
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
["n,m = map(int, input().split())\nab = [list(map(int, input().split())) for _ in range(n)]\nab.sort()\ncost=0\namount=m\nfor i in range(n):\n if amount>0:\n print('am:',amount)\n if amount > ab[i][1]:\n cost+=ab[i][0]*ab[i][1]\n amount-=ab[i][1]\n else:\n cost+=...
['Wrong Answer', 'Accepted']
['s294347419', 's157780396']
[27756.0, 27760.0]
[586.0, 497.0]
[352, 353]
p03103
u337080722
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n, m = map(int, input().split())\na = []\nfor i in range(n):\n a.append(list(map(int, input().split())))\n\na = sorted(a, key=lambda x: x[0])\nprint(a)\npurchase_price = 0\n\n\nfor price, count in a:\n if count < m:\n purchase_price += price * count\n m -= count\n\n else:\n purchase_pric...
['Wrong Answer', 'Accepted']
['s079470747', 's867862803']
[34640.0, 29792.0]
[529.0, 497.0]
[354, 345]
p03103
u339550873
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['#! /usr/bin/env python3\n# -*- coding: utf-8 -*-\nN,M = [int(x) for x in input().split()]\nABdict = {}\nfor _ in range (N):\n A,B = [int(x) for x in input().split()]\n if A in ABdict.keys():\n ABdict[A] += B\n else:\n ABdict[A] = B\n\nprint(ABdict)\ndct = sorted(ABdict.items())\nls = []\nans = ...
['Wrong Answer', 'Accepted']
['s352817360', 's825754788']
[26976.0, 23004.0]
[487.0, 475.0]
[403, 389]
p03103
u341914122
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M=map(int, input().split(" "))\n\nA=[]\nB=[]\n\nbought = 0\nprice = 0\nfor i in range(0, N):\n a,b=list(map(int, input().split(" ")))\n A.append((a, i))\n B.append(b)\n\nprint(A)\nA.sort()\nprint(B)\n\ni = 0\np=0\nn=0\nwhile bought < M:\n p,n = A[i]\n price += p*B[n]\n bought += B[n]\n print("b...
['Wrong Answer', 'Accepted']
['s183961169', 's914693598']
[26660.0, 20972.0]
[659.0, 494.0]
[394, 331]
p03103
u342051078
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m = map(int,input().split())\nab = [0]\nnum = m\nfor i in range(n):\n a,b = map(int,input().split())\n ab.append([a,b])\nab.sort()\nans = 0\nfor i in ab:\n if i[1] >= num:\n ans += i[0]*num\n break\n else:\n ans += i[0]*i[1]\n num -= i[1]\nprint(ans)\n ', 'n,m = map(in...
['Runtime Error', 'Accepted']
['s523951667', 's028966541']
[19552.0, 20048.0]
[317.0, 467.0]
[286, 285]
p03103
u348868667
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['from operator import itemgetter\nN,M = map(int,input().split())\nls = [list(map(int,input().split())) for _ in range(N)]\nls = sorted(ls,key=itemgetter(0))\nans = 0\npon = 0\nfor i in range(N):\n if pon < M:\n pon += ls[i][1]\n ans += ls[i][1]*ls[i][0]\n else:\n break\nif pon == M:\n pri...
['Wrong Answer', 'Accepted']
['s378183477', 's260605434']
[29864.0, 29864.0]
[443.0, 442.0]
[365, 379]
p03103
u349091349
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['import sys\nN,M=map(int,input().split())\nA=[0]*N\nB=[0]*N\nfor i in range(0,N):\n A[i],B[i]=map(int,input().split())\nindex=sorted(range(len(A)), key=lambda k: A[k])\n\ncost=0\nget=0\nfor i in index:\n if get+B[i]<=M:\n get += B[i]\n cost += A[i]*B[i]\n else:\n cost += A[i]*(M-get)\n print(cost)\n\tsy...
['Runtime Error', 'Accepted']
['s393412872', 's773636835']
[3064.0, 16540.0]
[17.0, 376.0]
[308, 309]
p03103
u354567428
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m = map(int,input().split())\nab = [list(map(int,input().split())) for i in range(n)]\n\nc = sorted(ab, key= lambda x:x[0])\ns = [0]\nfor i in range(n):\n s.append(s[i] + c[i][1])\n if s[i] <= m <= s[i+1]:\n stop = i\n\nans=0\nfor i in range(stop):\n ans += c[i][0]*c[i][1]\n print(ans)\nwhile s[s...
['Wrong Answer', 'Accepted']
['s069290764', 's916752805']
[33380.0, 33252.0]
[523.0, 512.0]
[364, 349]
p03103
u360090862
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['import numpy as np\nN,M=[int(i) for i in input().split()]\na=[]\nfor j in range(N):\n a.append([int(i) for i in input().split()])\n\na.sort(key=lambda x:x[0])\n\ncost=0\nshop=0\nfor j in range(M):\n if a[shop][1]==0:\n shop+=1\n else:\n a[shop][1]-=1\n cost+=a[0][0]\nprint(cost)', 'import numpy as np\nN,M...
['Wrong Answer', 'Accepted']
['s495267513', 's007353686']
[31868.0, 31868.0]
[580.0, 554.0]
[275, 268]
p03103
u367130284
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['a,b=map(int,input().split())\ndef f(x):\n if x%4==3:\n return 0\n elif x%4==0:\n return x\n else:\n base=x-x%3\n ans=base\n for s in range(1,x%3+1):\n # print(base+s)\n ans^=(base+s)\n # print(ans)\n return ans\nprint(f(a-1)^f(b))', 'n,...
['Wrong Answer', 'Accepted']
['s912109853', 's812241964']
[3060.0, 29788.0]
[17.0, 440.0]
[298, 239]
p03103
u375282392
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m = map(int,input().split())\nab = []\nfor i in range(n):\n\tab.append(list(map(int,input().split())))\nsab = sorted(ab,key=lambda x:x[0])\n\n', 'n,m = map(int,input().split())\nab = []\nfor i in range(n):\n\tab.append(list(map(int,input().split())))\n \nsab = sorted(ab,key=lambda x:x[0])\ncost = 0\nfor i in sab...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s004958739', 's187794140', 's658070246']
[29800.0, 29792.0, 29792.0]
[420.0, 543.0, 429.0]
[137, 294, 279]
p03103
u378752007
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\ndic = {}\ncount = 0\ngoukei = 0\n\nfor i in range(N):\n price,honsu = map(int, input().split())\n dic[price] = honsu\ndic = sorted(dic.items()) \nfor kakaku, number in dic:\n nokori = M-count\n count += number\n if count >= M:\n print(goukei)\n goukei += nokori*...
['Wrong Answer', 'Accepted']
['s892393783', 's312688789']
[22992.0, 22984.0]
[418.0, 438.0]
[414, 412]
p03103
u391533749
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\nA = [list(map(int, input().split())) for i in range(N)]\nA.sort()\nsumcost = 0\nk = 0\nt = 0\nwhile M-k>0:\n buy = min(M-k, A[t][0])\n sumcost += A[t][0]*buy\n k += buy\n t += 1\n\n\nprint(sumcost)', 'N, M = map(int, input().split())\nA = [list(map(int, input().split())) ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s476217686', 's582891417', 's606544747', 's901553113', 's331916378']
[27880.0, 27880.0, 65840.0, 27884.0, 27760.0]
[453.0, 498.0, 241.0, 2050.0, 523.0]
[230, 230, 264, 300, 246]
p03103
u393481615
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['import numpy as np\n\nN, M = list(map(int, input().split()))\nA = np.zeros(N) \nB = np.zeros(N) # B hon\nfor i in range(N):\n A[i], B[i] = list(map(int, input().split()))\n\nrequire = M\nprice = 0\nwhile(require > 0):\n\n minidx = np.where(A == A.min())[0][0]\n# print("found idx = " + str(minidx))\n i...
['Wrong Answer', 'Accepted']
['s107659319', 's508550902']
[16508.0, 20456.0]
[2109.0, 572.0]
[773, 720]
p03103
u395202850
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\nA = []\nB = []\n\na, b = map(int, input().split())\n\nA.append(a)\nB.append(b)\n\nif N != 1:\n for n in range(N-1):\n a, b = map(int, input().split())\n swi = 0\n BSum = 0\n for j in range(len(A)):\n if BSum > M:\n swi = 1\n ...
['Runtime Error', 'Accepted']
['s212583426', 's600752288']
[3316.0, 27880.0]
[2104.0, 477.0]
[947, 294]
p03103
u396971285
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M=map(int,input().split())\n\n\nAB=[]\nfor i in range(N):\n ab=list(map(int,input().split()))\n AB.append(ab)\n\n\nlist.sort(AB,key=lambda x:x[0])\n\n\nm=0 \ncost=0 \nfor i in range(N):\n \n if M-m==AB[i][1]:\n m+=AB[i][1]\n cost+=AB[i][0]*AB[i][1]\n break\n\n elif M-m<AB[i][1] :\n for j in range...
['Runtime Error', 'Runtime Error', 'Accepted']
['s040751939', 's749157767', 's862157824']
[3064.0, 2940.0, 29024.0]
[17.0, 17.0, 564.0]
[618, 537, 641]
p03103
u397953026
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m = map(int,input().split())\nab = [list(map(int,input().split())) for _ in range(n)]\nab.sort()\nans = 0\ncnt = 0\ni = 0\nwhile cnt < m:\n ans += ab[i][0]*ab[i][1]\n cnt += ab[i][1]\n i += 1\nprint(ans - (cnt - m)*ab[i][0])', 'n,m = map(int,input().split())\nab = [list(map(int,input().split())) for _ in r...
['Runtime Error', 'Runtime Error', 'Accepted']
['s162515288', 's845554616', 's133346509']
[27424.0, 27512.0, 27520.0]
[341.0, 388.0, 350.0]
[225, 225, 227]
p03103
u400221789
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m=map(int,input().split())\na=[]\nfor i in range(n):\n a.append(list(map(int,input().split())))\na.sort() \ni=0\ncost=0\nwhile m>0:\n if a[i][1]<m:\n cost+=a[i][0]*a[i][1]\n M-=a[i][1]\n i+=1\n else:\n cost+=a[i][0]*m\n print(cost)\n break', 'n,m=map(int,input().split())\na=[]\nfor i in range(...
['Runtime Error', 'Accepted']
['s902370446', 's079829629']
[27760.0, 27756.0]
[477.0, 529.0]
[248, 249]
p03103
u409542115
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\n\nS = [[0]*2 for i in range(N)]\nfor i in range(N):\n S[i] = list(map(int, input().split()))\n \nS = sorted(S)\nprint(S)\n\nquantitys = 0\ntotal = 0\n\nfor i in range(N):\n \n if((M - quantitys) - S[i][1])>=0:\n quantitys += S[i][1]\n total += S[i][0] * S[i...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s165662591', 's422810267', 's819965688', 's970431512', 's700978182']
[34656.0, 28588.0, 28588.0, 34656.0, 28588.0]
[609.0, 564.0, 575.0, 660.0, 563.0]
[547, 538, 539, 547, 538]
p03103
u416773418
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['import numpy as np\n \nN, M = map(int, input().split())\nA = np.zeros((N, 2))\nfor i in range(N):\n A[i,:] = list(map(int, input().split()))\nA = A[A[:,0].argsort(), :]\n\n\ncount=0\nprice=0\nfor i in range(N):\n if A[0,1]>=M-count:\n price+=A[0,0]*(M-count)\n break\n else:\n price+=A[0,...
['Wrong Answer', 'Accepted']
['s359745398', 's715857480']
[16380.0, 31696.0]
[2109.0, 789.0]
[374, 339]
p03103
u426764965
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\nS = []\nfor i in range(N):\n a, b = map(int, input().split())\n S.append([a, b])\n\nS.sort(key=lambda x: x[0])\nprice = 0\ncount = 0\nfor s in S:\n if count + s[1] < M:\n price += s[0] * s[1]\n count += s[1]\n else:\n price += s[0] * (M - s[1])\n break\n\nprint(price)...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s035565157', 's568579042', 's551610660']
[21204.0, 21204.0, 21204.0]
[417.0, 385.0, 405.0]
[301, 298, 302]
p03103
u430508516
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['from operator import itemgetter\nn,m=map(int,input().split())\nl=[]\nfor i in range(n):\n a,b=map(int,input().split)\n l.append([a,b])\nl.sort(key=itemgetter(0))\ns=0\nfor j in range(n):\n s=s+l[j][0]*min(l[j][1],m)\n m=m-l[j][1]\n if m<0:\n break\nreturn s ', 'from operator import itemgetter\nn,m=map(int,inp...
['Runtime Error', 'Runtime Error', 'Accepted']
['s841501401', 's992419615', 's401263010']
[3064.0, 3064.0, 21272.0]
[17.0, 18.0, 466.0]
[253, 253, 255]
p03103
u434664398
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M = [int(x) for x in input().split(\' \')]\nAB = {}\nfor i in range(N):\n a,b = [int(x) for x in input().split(\' \')]\n AB[a] = b\n \ndc = sorted(AB.items())\n\nc = 0\nm = M\nfor s in dc:\n d = m - s[1]\n if d >= 0:\n m -= s[1]\n c += s[0] * s[1]\n #print(m,c)\n if d == 0:\n break\n else:\n ...
['Wrong Answer', 'Accepted']
['s182277830', 's819864960']
[23008.0, 23008.0]
[452.0, 484.0]
[378, 350]
p03103
u442877951
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M = map(int,input().split())\nAB = [list(map(int,input().split())) for _ in range(N)]\n\nAB.sort()\ncount = 0\nans = 0\nfor i,j in AB:\n if count+j >= M:\n ans += (M-count)*i\n break\n else:\n count += j\n ans += j*i\n print(ans)', 'N,M = map(int,input().split())\nAB = [list(map(int,input().split()))...
['Wrong Answer', 'Accepted']
['s773709717', 's381134897']
[27760.0, 27760.0]
[549.0, 473.0]
[233, 233]
p03103
u444732068
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M = map(int,input().split())\na = [list(map(int,input().split())) for i in range(N)]\na.sort(key=lambda x:x[0])\nprint(a)\nans = 0\nnokori = M\nfor j in range(N):\n\tans += a[j][0]*min(a[j][1],nokori)\n\tnokori -= a[j][1]\n\tif nokori <= 0:\n\t\tprint(ans)\n\t\texit()\n\n', 'N,M = map(int,input().split())\na = [lis...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s102208922', 's366805108', 's453857661']
[34656.0, 36404.0, 29028.0]
[533.0, 2105.0, 441.0]
[254, 374, 245]
p03103
u449473917
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['from sys import stdin\n\nn,m=map(int,input().split())\nl = [stdin.readline().rstrip().split() for _ in range(n)]\n\nl.sort()\na=0\nans=0\nfor i,j in l:\n aa=int(i)\n aaa=int(j)\n for k in range(aa):\n if a==m:\n print(ans)\n exit()\n else:\n ans+=int(aaa)\n ...
['Wrong Answer', 'Accepted']
['s127750342', 's264369145']
[33452.0, 27752.0]
[306.0, 577.0]
[313, 249]
p03103
u454735747
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m = map(int,input().split()) \nz = []\nfor i in range(n):\n a,b = list(map(int,input().split()))\n z.append((a,b)) \nz = sorted(z)\nprint(z)\nsum = 0\nfor a,b in z:\n if b <= m:\n sum += a * b\n m -= b\n else:\n sum += a * m\n break\nprint(sum)', 'n,m = map(int,input().split()) \nz = []\nfor i in...
['Wrong Answer', 'Accepted']
['s111959784', 's678880739']
[23816.0, 17736.0]
[512.0, 444.0]
[249, 240]
p03103
u460468647
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m = map(int, input().split())\npairs = [input().split() for _ in range(n)]\npairs.sort(key = lambda x:x[0])\nprint(pairs)\ncount = 0\nans = 0\nfor i in pairs:\n ans += int(i[0])*int(i[1])\n count += int(i[1])\n if count >= m:\n ans -= int(i[0])*(count - m)\n break\nprint(ans)', 'n,m = map(int...
['Wrong Answer', 'Accepted']
['s020805736', 's134367653']
[41440.0, 27760.0]
[501.0, 509.0]
[289, 282]
p03103
u466143662
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
["from operator import itemgetter\n\nN,M =map(int, input().split())\nb=[]\nfor _ in range(N):\n a=list(map(int, input().split()))\n b.append(a)\n\nb.sort(key=itemgetter(0))\nprint('ソート後(0番目の要素):{}'.format(b))\n\nc=0\nd=0\nfor i in range(N):\n c+=b[i][1]\n d+=b[i][0]*b[i][1]\n if c>M:\n d-=(c-M)*b[...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s007391621', 's415229109', 's991676597']
[36804.0, 28976.0, 28976.0]
[592.0, 470.0, 451.0]
[335, 375, 367]
p03103
u466331465
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M = list(map(int,input().split()))\nA = [tuple(map(int,input().split())) for _ in range(N)]\nsortA = sorted(A,key= lambda x: x[0])\nprint(sortA)\nans = 0\nfor i in range(N):\n if M-sortA[i][1]>0:\n ans += sortA[i][0]*sortA[i][1]\n M = M-sortA[i][1]\n else:\n ans += M*sortA[i][0]\n ...
['Wrong Answer', 'Accepted']
['s422025419', 's730542905']
[24556.0, 18892.0]
[435.0, 390.0]
[323, 310]
p03103
u472696272
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m = map(int,input().split())\nab = [list(map(int,input().split())) for _ in range(n)]\nab = sorted(ab, key=lambda ab:ab[0])\n\nans = 0\ntotal = 0\nfor i in range(n):\n num = m-toal\n if ab[i][1]<=num:\n total += ab[i][1]\n ans += ab[i][0]*ab[i][1]\n else:\n total += num\n ans += num*ab[i][1]\n bre...
['Runtime Error', 'Runtime Error', 'Accepted']
['s150236059', 's201546380', 's271984956']
[2940.0, 29796.0, 29796.0]
[17.0, 422.0, 463.0]
[320, 318, 320]
p03103
u474925961
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m=map(int,input().split())\n\na=sorted([list(map(int,input().split())) for _ in range(n)])\n\nprint(a)\npay=0\ni=0\nwhile m>0:\n p=min(m,a[i][1])\n m-=p\n pay+=p*a[i][0]\n i+=1\nprint(pay)\n\n\n', 'n,m=map(int,input().split())\n\na=sorted([list(map(int,input().split())) for _ in range(n)])\n\n#print(a)\...
['Wrong Answer', 'Accepted']
['s697217515', 's471926198']
[34656.0, 28652.0]
[581.0, 493.0]
[193, 194]
p03103
u475503988
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['import numpy as np\nN, M = map(int, input().split())\nAB = np.empty((N, 2), dtype=np.int64)\nfor n in range(N):\n AB[n, :] = list(map(int, input().split()))\nAB = AB[AB[:, 0].argsort(), :]\nprint(AB)\nn = 0\nans = 0\nwhile M > 0:\n if M > AB[n, 1]:\n ans += AB[n, 0] * AB[n, 1]\n M -= AB[n, 1]\n ...
['Wrong Answer', 'Accepted']
['s577679627', 's759926964']
[16404.0, 14812.0]
[1143.0, 805.0]
[375, 242]
p03103
u476124554
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\nA = []\nB = []\nfor _ in range(N):\n a, b = map(int, input().split())\n A.append(a)\n B.append(b)\nC = zip(A,B)\nC = sorted(C)\nA, B = zip(*C)\nindex = 0\ncount = 0\n\nfor i in range(N):\n if(count<=M):\n index = i\n sum += A[i]*B[i]\n count += B[i]...
['Runtime Error', 'Accepted']
['s260610748', 's503492632']
[26916.0, 26924.0]
[441.0, 484.0]
[337, 344]
p03103
u487342868
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M=map(int, input().split())\nA,B=[],[]\nfor i in range(N):\n A.append(list(map(int, input().split())))\nA.sort(key=lambda x:x[0])\nR,S=M,0\nfor a in A:\n if a[1]>=R:\n print(a[0],R)\n S+=a[0]*R;R=0\n else:\n print(a[0],a[1])\n S+=a[0]*a[1];R-=a[1]\n if R==0: break\nprint(S)\n...
['Wrong Answer', 'Accepted']
['s308482305', 's687060680']
[29024.0, 29024.0]
[569.0, 442.0]
[304, 257]
p03103
u489959379
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n, m = map(int, input().split())\nab = sorted([list(map(int, input().split())) for _ in range(n)], key=lambda x:x[0])\n\nans = 0\nfor i in range(n):\n print(ab[i][1], m)\n if ab[i][1] < m:\n ans += ab[i][0] * ab[i][1]\n m -= ab[i][1]\n else:\n ans += ab[i][0] * m\n break\n\nprint(...
['Wrong Answer', 'Accepted']
['s686089197', 's826922039']
[29788.0, 29788.0]
[569.0, 442.0]
[310, 287]
p03103
u502028059
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M = map(int,input().split())\nAB = []\nans = 0\nfor i in range(N):\n A,B = map(int,input().split())\n t = A,B\n AB.append(t)\n \nAB.sort()\n\nfor i in range(len(AB)):\n if M > 0:\n break\n for x in range(AB[i][1]):\n if M > 0:\n ans += AB[i][0]\n M -= 1\n ...
['Wrong Answer', 'Accepted']
['s952726704', 's945321346']
[16908.0, 23044.0]
[387.0, 322.0]
[316, 356]
p03103
u518042385
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m=map(int,input().split())\nl=[]\nfor i in range(n):\n a,s=map(int,input().split())\n l.append([a,s])\nl=sorted(l)\np=0\nc=0\nfor i in l:\n if c+l[i][1]>m:\n p+=l[i][0]*(m-c)\n break\n else:\n p+=l[i][0]*l[i][1]\n c+=l[i][1]\nprint(p)', 'n,m=map(int,input().split())\nl=[]\nfor i in range(n):\n a,s=...
['Runtime Error', 'Accepted']
['s157215209', 's482692568']
[20816.0, 20832.0]
[439.0, 484.0]
[237, 249]
p03103
u519996359
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M = list(map(int, input().split()))\nA = []\nB = []\n\nfor i in range(N):\n\tA[i],B[i]=list(map(int, input().split()))\n\nsum = 0\nans = 0\nfor i in range(N):\n\tidx = num_list.index(min(A))\n\tsum += A[idx]*B[idx]\n\tA[idx] = 10000000\n\tans += 1\n\tif(sum >= M):\n\t\tbreak\n\nprint(ans)\n', 'import numpy as np\n\...
['Runtime Error', 'Accepted']
['s741019680', 's392739096']
[3064.0, 21432.0]
[17.0, 582.0]
[267, 381]
p03103
u521271655
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m = map(int,input().split())\nlis = [list(map(int,input().split())) for i in range(n)]\nlis.sort()\ncnt = 0\nmon = 0\ni = 0\nif n >= 2:\n while cnt <= m:\n if lis[i][1] + cnt <= m:\n cnt += lis[i][1]\n mon += lis[i][0]*lis[i][1]\n i += 1\n else:\n break\n...
['Runtime Error', 'Accepted']
['s721243704', 's180644106']
[27592.0, 27672.0]
[362.0, 388.0]
[360, 367]
p03103
u522726434
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = [int(x) for x in input().split()]\nV = [tuple(map(int, innput().split())) for i in range(N)]\nV.sort()\n\nmoney = 0\ncount = 0\n\nfor a, b in V:\n if count + b < M:\n count += b\n money += a * b\n else:\n money += (M - b) * a\n break\nprint(money)', 'N, M = [int(x) for x in input().split()]\nV = ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s064470064', 's147062795', 's456179676']
[3064.0, 16976.0, 16976.0]
[17.0, 403.0, 407.0]
[254, 253, 257]
p03103
u527261492
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m=map(int,input().split())\na=[]\nfor i in range(n):\n a.append(list(map(int,input().split())))\na.sort()\ntotl=0\nx=0\nfor j,k in range(a):\n if x+j<m:\n totl+=j*k\n x+=k\n else:\n totl+=j*(x-m)\n break\nprint(totl)\n \n \n \n ', 'n,m=map(int,input().split())\nd={}\nfor i in range(n):\n a,b...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s026364029', 's044789956', 's359540670', 's399245155', 's701974107', 's738746779', 's811698467', 's963209176', 's057279014']
[27760.0, 15588.0, 27760.0, 14556.0, 27760.0, 14564.0, 12560.0, 12632.0, 27760.0]
[500.0, 341.0, 496.0, 318.0, 495.0, 308.0, 2105.0, 2104.0, 473.0]
[235, 245, 231, 212, 229, 227, 376, 434, 229]
p03103
u529012223
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\np_list = []\n\n\n# a, b = map(int, input().split())\n# p_list.append([a, b])\n \n\n\n# price = 0\n\n# while num < M:\n\n# price += p_sort[1][i] * p_sort[0][i]\n\n\n\n# print(price)\nres = M\nfor i in range(N):\n a, b = map(int, input().split())\n p_list.append(a,...
['Runtime Error', 'Accepted']
['s876680982', 's761666565']
[3060.0, 19796.0]
[17.0, 445.0]
[657, 340]
p03103
u536325690
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\nAB = []\nfor i in range(N):\n a, b = map(int, input().split())\n AB.append([a,b])\n\nsortedAB = sorted(AB, key=lambda x:x[0])\n\nans = 0\nfor i in range(N):\n a = sortedAB[i][0]\n b = sortedAB[i][1]\n if M == 0:\n print(ans)\n exit()\n if b <= M:\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s378176943', 's608422251', 's950839243', 's496354589']
[21984.0, 21972.0, 21984.0, 21984.0]
[449.0, 436.0, 430.0, 417.0]
[361, 342, 375, 392]
p03103
u549757728
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m = map(int, input().split(" "))\na = []\nb = []\nfor i in range(n):\n temp = list(map(int,input().split(" ")))\n a.append(temp[0])\n b.append(temp[1])\n\nsort_a = sorted(set(a))\nmoney = 0\n\nfor ai in sort_a:\n ind = [i for i, x in enumerate(a) if x == ai]\n print(ind)\n for i in ind:\n x...
['Wrong Answer', 'Accepted']
['s265461446', 's253076219']
[17152.0, 29020.0]
[2104.0, 496.0]
[409, 309]
p03103
u552357043
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M= map(int, input().split())\nA = []\nB = []\ncount = 0\ncost = 0\nfor i in range(N):\n a,b = map(int, input().split())\n A.append(a)\n B.append(b)\n count += b\n cost += a * b\n while count > M:\n pos = A.index(max(A))\n if count - B[pos] > 0:\n count -= B[pos]\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s159212536', 's302083134', 's740718276', 's543758218']
[7860.0, 28656.0, 11040.0, 28656.0]
[2104.0, 556.0, 2104.0, 559.0]
[498, 267, 319, 273]
p03103
u560889512
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M=map(int,input().split())\nstore=[list(map(int,input().split())) for _ in range(N)]\nsorted(store,cmp=lambda x,y:x[0]-y[0] if x[0]!=y[0] else x[1]-y[1])\nres=0\nfor i in range(len(store)):\n if M-store[i][1]<=0:\n res+=store[i][0]*M\n break\n else:\n res+=store[i][0]*store[i][1]\n M=M-store[i][1]\npr...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s012738653', 's238582442', 's254170973', 's260012279', 's817917329', 's157731789']
[27380.0, 49652.0, 59892.0, 59892.0, 60660.0, 21216.0]
[328.0, 365.0, 480.0, 478.0, 484.0, 414.0]
[315, 270, 292, 291, 295, 376]
p03103
u562753067
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
["n,m=[int(i) for i in input().split(' ')]\nclass P:\n def __init__(self, a, b)\n \tself.a = a\n self.b = b\n\np = []\nfor i in range(n):\n a,b=[int(i) for i in input().split(' ')]\n p.append(P(a, b))\n\n \nmon = 0\np.sort(key=lambda x: x.a)\nfor e in p:\n if m <= e.b:\n mon += e.q * m\n m = 0\n else:\n...
['Runtime Error', 'Accepted']
['s149148278', 's895615800']
[2940.0, 28288.0]
[17.0, 533.0]
[343, 345]
p03103
u576432509
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m=map(int,input().split())\na=[]\nb=[]\nai,bi=map(int,input().split())\na.append(ai)\nb.append(bi)\nfor i in range(1:n):\n ai,bi=map(int,input().split())\n for ii in range(i-1):\n if ai<a[ii]:\n a.insert(ii,ai)\n b.insert(ii,bi)\n break\n if len(a)==i-1:\n a.a...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s437887320', 's519050134', 's995378066', 's036290240']
[2940.0, 3812.0, 2940.0, 27820.0]
[17.0, 2104.0, 17.0, 510.0]
[508, 523, 324, 266]
p03103
u578489732
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
["# -*- coding: utf-8 -*- \nimport sys, heapq \n# ---------------------------------------------------------------- \n...
['Runtime Error', 'Accepted']
['s084910624', 's932669767']
[3064.0, 19028.0]
[18.0, 1837.0]
[3478, 3163]
p03103
u580697892
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['#coding: utf-8\nimport numpy as np\nN, M = map(int, input().split())\nAB = np.array([list(map(int, input().split())) for _ in range(N)])\nmoney = 0\ncol_num = 0\nAB = AB[np.argsort(AB[:, col_num])]\nprint(AB)\nif M <= AB[np.argmin(AB[:, 0]), 1]:\n money += AB[0, 0] * M\nelse:\n i = 0\n while M >= 0:\n ...
['Runtime Error', 'Accepted']
['s294576225', 's536745660']
[37872.0, 29788.0]
[789.0, 481.0]
[434, 336]
p03103
u582396808
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
[' N, M = map(int, input().split(" "))\nA_list = []\nB_list = []\ntotal = 0\n\nfor i in range(N):\n A, B = map(int, input().split(" "))\n A_list.append(A)\n B_list.append(B)\n\nz = list(zip(A_list, B_list))\nz.sort()\n\nfor a, b in z:\n if b > M:\n total += M * a\n break\n else:\n to...
['Runtime Error', 'Accepted']
['s803242048', 's263953293']
[2940.0, 18488.0]
[17.0, 432.0]
[341, 340]
p03103
u587199081
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['from sys import stdin\nimport numpy as np\nn, m = map(int, raw_input().split())\n# print(n)\nvals_list = np.zeros((n, 2))\n# print(vals_list)\nfor itr in range(n):\n a, b = map(int, raw_input().split())\n vals_list[itr][0], vals_list[itr][1] = a, b\nsorted_vals_list = vals_list[np.argsort(vals_list[:, 0])]\n\n\...
['Runtime Error', 'Accepted']
['s753462431', 's190516601']
[12500.0, 18020.0]
[149.0, 982.0]
[634, 666]
p03103
u588081069
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['#!/usr/bin/env python\n# -*- conding: utf-8 -*-\nimport numpy as np\n\nN, M = map(int, input().split())\nli = [list(map(int, input().split())) for i in range(N)]\nli = sorted(li, key=lambda x: x[0])\nm_sum = 0\nfor i in li:\n buy = min(M, i[i])\n m_sum += i[0]*buy\n M -= buy\nprint(m_sum)\n# A = []\n# B = []...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s342704789', 's410995069', 's613097287', 's667513844', 's842082787', 's837118564']
[38896.0, 21640.0, 21624.0, 21636.0, 21556.0, 29796.0]
[556.0, 539.0, 538.0, 636.0, 524.0, 502.0]
[756, 566, 564, 548, 496, 195]
p03103
u588829932
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n, m = list(map(int, input().split()))\n\ndata =[]\nfor i in range(n):\n tmp_a, tmp_b = list(map(int, input().split()))\n data.append((tmp_a, tmp_b))\n\n\ntotal =0\ncost = 0\nfor a, b in sorted(data, key=lambda x:x[0]):\n print(a, b)\n if total + b < m:\n total += b\n cost += a*b\n else:\...
['Wrong Answer', 'Accepted']
['s935937247', 's657494764']
[18888.0, 18888.0]
[540.0, 436.0]
[356, 357]
p03103
u599170882
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
[' def get_input_row():\n return [int(i) for i in input().split(" ")]\n \n inp = get_input_row()\n N = inp[0]\n M = inp[1]\n item_dict = {}\n num = 0\n for i in range(N):\n a, b = get_input_row()\n if a in item_dict:\n item_dict[a] += b\n else:\n \titem_dict[a] =...
['Runtime Error', 'Accepted']
['s075731164', 's160767239']
[2940.0, 17892.0]
[19.0, 416.0]
[594, 500]
p03103
u600261652
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\nA = []\nB = []\nfor _ in range(N):\n a, b = map(int, input().split())\n A.append(a)\n B.append(b)\nC = sorted(A)\nwhile M > 0:\n ', 'def resolve():\n N, M = map(int, input().split())\n A = []\n for _ in range(N):\n a = list(map(int, input().split()))\n ...
['Runtime Error', 'Accepted']
['s542651118', 's857166928']
[9032.0, 29444.0]
[26.0, 252.0]
[166, 340]
p03103
u606090886
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['2 3\n1 32\n2 63\n1 12', 'n,m = map(int,input().split())\na = []\nb = []\nfor i in range(n):\n P,Y = map(int,input().split())\n a.append(P)\n b.append(Y)\n\n\n\n\n\ncount = 0\nans = 0\ni = 0\nA = sorted(a)\nif n-m < n//2:\n while i < n:\n if m-b[a.index(A[i])] > 0:\n m -= b[a.index(A[i])]...
['Runtime Error', 'Runtime Error', 'Accepted']
['s392410965', 's421472805', 's864941335']
[2940.0, 3064.0, 27756.0]
[17.0, 17.0, 515.0]
[18, 897, 570]
p03103
u607072045
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\n\nmoney = float(0)\n\nkakaku = []\nhonsuu = []\nnokori_honsuu = M\n\nfor i in range(N):\n\tA, B = map(int, input().split())\n\tkakaku.append(A)\n\thonsuu.append(B)\n\nwhile nokori_honsuu > 0:\n\tmin_kakaku_pos = kakaku.index(min(kakaku))\n\tif honsuu[min_kakaku_pos] <= nokori_honsuu:...
['Wrong Answer', 'Accepted']
['s769661622', 's027031503']
[10980.0, 20056.0]
[2104.0, 467.0]
[558, 296]
p03103
u617037231
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['import sys\nN,M = map(int,input().split())\nshops = dict()\nprice = []\ntakahashi = 0\nmoney = 0\nfor i in range(N):\n bottle,stock = map(int,input().split())\n if bottle not in shops:\n shops[bottle] = 0\n shops[bottle] += stock\n if bottle not in price:\n price.append(bottle)\nprice.sort()...
['Wrong Answer', 'Accepted']
['s844756634', 's278517266']
[5016.0, 20056.0]
[2104.0, 473.0]
[704, 340]
p03103
u623687794
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m=map(int,input().split())\nedr=[]\nfor i in range(n):\n edr.append(list(map(int,input().split())))\nedr.sort(key =lambda x:x[0])\ncnt=0\nans=0\nfor i in range(n):\n cnt+=0\n ans+=edr[i][0]*edr[i][1]\n if cnt>=m:\n ans-=(cnt-m)*edr[i][0]\n break\nprint(ans)', 'n,m=map(int,input().split())\nedr=[]\nfor i i...
['Wrong Answer', 'Accepted']
['s670437883', 's172124057']
[29024.0, 29024.0]
[467.0, 461.0]
[256, 265]
p03103
u625554679
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
["def find_AC(S):\n ret = []\n for i in range(len(S)-1):\n if S[i] == 'A' and S[i+1] == 'C':\n ret.append(i)\n return ret\n\nN, Q = [int(x) for x in input().split()]\nS = input()\nresult = find_AC(S)\nprint(result)\npos = [res+1 for res in result]\n\nfor _ in range(Q):\n l, r = [int(x) for x in input().spli...
['Runtime Error', 'Accepted']
['s199744401', 's884028883']
[3188.0, 23524.0]
[810.0, 434.0]
[387, 427]
p03103
u638282348
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['M, N = map(int, input().split())\nCOST, STOCK = range(2)\nenergy_drinks = sorted((tuple(map(int, input().split())) for _ in range(N)), key=lambda tuple_: tuple_[COST])\n\ncost = 0\nfor energy_drink in energy_drinks:\n buy = min(energy_drink[STOCK], N)\n N -= buy\n cost += buy * energy_drink[COST]\nprint(cost...
['Runtime Error', 'Accepted']
['s630299623', 's166373978']
[18060.0, 18188.0]
[428.0, 433.0]
[311, 311]
p03103
u644360640
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m = map(int,input().split())\nab = [list(map(int,input().split())) for i in range(n)]\nab.sort(key=lambda x: x[1])\nans = 0\nprint(ab)\nfor i in range(n):\n if m == 0:\n break\n if m - ab[i][1] >= 0:\n ans += ab[i][0] * ab[i][1]\n m -= ab[i][1]\n #print(ans)\n else:\n ans...
['Wrong Answer', 'Accepted']
['s596597524', 's059058419']
[34656.0, 27756.0]
[470.0, 498.0]
[367, 300]
p03103
u645538982
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M=(map(int,input().split()))\n\nC=[input().split() for i in range(N)]\n\nCX=[]\nfor i in C:\n for j in i:\n try:CX.append(int(j))\n\n except ValueError:\n pass\n\nCA=[]\nCB=[]\ni=0\n\nfor k in CX:\n\n if (i+2)%2==0:\n CA.append(CX[i])\n else:\n CB.append(CX[i])\n i...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s182831928', 's188391186', 's619344400', 's754017293', 's072121692']
[42516.0, 3064.0, 35060.0, 35060.0, 57772.0]
[2107.0, 18.0, 2106.0, 2106.0, 495.0]
[820, 500, 618, 663, 327]
p03103
u647796955
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = list(map(int, input().spliit()))\nC = []\nfor n in range(N):\n A, B = list(map(int, input().spliit()))\n C.append([A,B])\n \nC = sorted(C, key=lambda x:x[0])\n\nS = 0\nn = 0\nwhilie S <= M:\n S += C[0][1]\n n += 1\nprint(S)\n \n \n ', 'N, M = list(map(int, input().split()))\nC = []\n...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s225485200', 's837159714', 's122077420']
[2940.0, 22368.0, 22492.0]
[17.0, 466.0, 481.0]
[250, 222, 295]
p03103
u652057333
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['# C\nn, m = map(int, input().split())\nab = [0, 0] * n\nfor i in range(n):\n ab[i] = map(int, input().split())\nab.sort(key=lambda x:x[0])\n\ncost = 0\nfor i in range(n):\n value = ab[i][0]\n num = ab[i][1]\n if num > m:\n cost += value * m\n break\n else:\n cost += value * num\n ...
['Runtime Error', 'Accepted']
['s347316715', 's746173086']
[50420.0, 22756.0]
[381.0, 401.0]
[328, 315]
p03103
u655110382
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['nm, left = map(int, input().split())\nshops = []\nfor _ in range(nm):\n shops.append([int(x) for x in input().split()])\nshops.sort(key=lambda x: x[0])\n#print(shops)\ntotal_cost = 0\nfor cost, stock in shops:\n if stock >= left:\n print("final : " + str(total_cost + cost * left))\n exit(0)\n e...
['Wrong Answer', 'Accepted']
['s573137406', 's062025028']
[22752.0, 22748.0]
[390.0, 403.0]
[422, 404]
p03103
u657901243
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n, m = map(int, input().split())\narr = []\nfor i in range(n):\n a, b = map(int, input().split())\n arr.append([a, b])\na.sort()\nans = 0\nidx = 0\nwhile True:\n if m <= 0:\n break\n ans += arr[idx][0] * min(arr[idx][1], m)\n m -= min(arr[idx][1], m)\n idx += 1\nprint(ans)\n', 'n, m = map(i...
['Runtime Error', 'Accepted']
['s963285415', 's366440469']
[19532.0, 20064.0]
[326.0, 502.0]
[286, 288]
p03103
u658627575
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\nX = []\nfor i in range(N):\n\tX.append(list(map(int, input().split())))\n\n#Sorted by first element\nX.sort(key=lambda x:x[0])\ni = 0\ntotal = 0\nans = 0\n\nwhile i <= N-1:\n\tnum += X[i][1]\n\tans += X[i][0] * X[i][1]\n\tif num > M:\n\t\tans -= X[i][0] * (num-M)\n\t\tbreak\n\ti += 1...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s226290040', 's452649064', 's549478719', 's749185615', 's852775140', 's909374249', 's825920517']
[29024.0, 10996.0, 2940.0, 3064.0, 11048.0, 3064.0, 29024.0]
[406.0, 2104.0, 17.0, 17.0, 307.0, 17.0, 460.0]
[303, 355, 403, 274, 374, 315, 310]
p03103
u665038048
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\nA_B = []\nfor i in range(N):\n A_B.append(list(map(int, input().split())))\nA_B.sort()\nprint(A_B)\nsum = 0\nmoney = 0\ni = 0\nwhile sum <= M:\n money += A_B[i][0] * A_B[i][1]\n sum += A_B[i][1]\n print(sum)\n i += 1\nmoney -= A_B[i-1][0] * (sum - M)\nprint(money)\n', ...
['Runtime Error', 'Accepted']
['s554720320', 's823866151']
[33776.0, 27760.0]
[645.0, 565.0]
[299, 282]
p03103
u667024514
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n,m = map(int,input().split())\nlis = list(map(int,input().split()))\nlis.sort(key = lambda x:x[1])\nans = 0\ncou = 0\nnum = 0\nwhile cou < m:\n nu = min(lis[num],m-cou)\n cou += nu\n ans += lis[num] * nu\n num += 1\nprint(ans)\n ', 'n, m = map(int, input().split())\nlis = [list(map(int,input().split())) for i i...
['Runtime Error', 'Accepted']
['s851227845', 's064595424']
[3060.0, 29028.0]
[17.0, 462.0]
[223, 257]
p03103
u670567845
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N, M = map(int, input().split())\narray = []\nfor i in range(N):\n elm = list(map(int, input().split()))\n array.append(elm)\n\narray.sort(key=lambda x: x[0])\nprint(array)\nans = 0\ncnt = 0\nfor i in range(N):\n \n buy = min([array[i][1], M-cnt])\n cnt += buy\n ans += array[i][0]*buy\n\nprint(ans)', 'N, M = ma...
['Wrong Answer', 'Accepted']
['s168235389', 's933525150']
[34656.0, 29020.0]
[579.0, 485.0]
[305, 292]
p03103
u671239754
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['li = list(input())\na = li.count("0")\nimport math\nif a < math.ceil(len(li)/2):\n print(2*a)\nelse:\n print(2*(len(li)-a))\n', 'n,m = map(int, input().split())\nli = [list(map(int, input().split())) for i in range(n)]\nli.sort(key=lambda x:x[0])\nans = 0\n\nwhile True:\n if m == 0:\n print(ans)\n ...
['Wrong Answer', 'Accepted']
['s310063356', 's289771926']
[3060.0, 29024.0]
[17.0, 1911.0]
[124, 275]
p03103
u674588203
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['import numpy as np\n\nN,M=map(int,input().split())\nl=[]\nfor n in range(N):\n A,B=map(int,input().split())\n temp_l=[A,B]\n l.append(temp_l)\narr=np.array(l,dtype=np.int64)\n# print(l)\n# print(arr)\n\nneed=M\nans=0\n\n\ncol_num=0\n\nroute=arr[np.argsort(arr[:,col_num])]\nprint(route)\nfor i in range(N):\n ...
['Wrong Answer', 'Accepted']
['s585739912', 's961258118']
[45592.0, 45492.0]
[474.0, 452.0]
[588, 590]
p03103
u674885198
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['N,M = list(map(int, input().split()))\nlis=[]\nfor i in range(N):\n a,b = list(map(int, input().split()))\n lis.append([a,b])\n\nlis.sort()\n\ncount=0\nmoney=0\nind=0\nwhile count+lis[ind][1]<=M:\n count+=lis[ind][1]\n money+=lis[ind][0]*lis[ind][1]\n ind+=1\n print(ind)\n \n\nmoney+=(M-count)*li...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s365214645', 's765594715', 's814175089']
[20460.0, 20460.0, 20460.0]
[604.0, 580.0, 547.0]
[327, 321, 327]
p03103
u679888753
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['n, m = map(int, input().split())\na, b = zip(*(map(int, input().split()) for _ in range(n)))\nc = sorted(zip(a, b))\n\ncost = 0\nrest = m\nfor a, b in c:\n if m >= b: \n cost += a * b\n rest -= b\n else: \n cost += a * m\n break\nprint(cost)', 'n, m = map(int, input().split())\na, ...
['Wrong Answer', 'Accepted']
['s013687093', 's788875804']
[58328.0, 58328.0]
[646.0, 507.0]
[352, 358]
p03103
u681150536
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['from sys import exit\n\nN, M = map(int, input().split())\n\nshops = {}\n\nfor _ in range(N):\n A, B = map(int, input().split())\n shops[A] = B\n\nshops = sorted(shops.items())\nprint(shops)\nans = 0\n\nfor k in shops:\n if M - k[1] <= 0:\n ans += k[0] * M\n print(ans)\n exit()\n else:...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s086034283', 's595248442', 's635600990']
[23000.0, 3064.0, 23000.0]
[491.0, 17.0, 453.0]
[345, 377, 386]
p03103
u682730715
2,000
1,048,576
Hearing that energy drinks increase rating in those sites, Takahashi decides to buy up M cans of energy drinks. There are N stores that sell energy drinks. In the i-th store, he can buy at most B_i cans of energy drinks for A_i yen (the currency of Japan) each. What is the minimum amount of money with which he can bu...
['# coding: UTF-8\nimport sys\n\nimport heapq\nimport re\nimport bisect\nimport random\nimport math\nimport itertools\nfrom collections import defaultdict, deque\nfrom copy import deepcopy\nfrom decimal import *\n\na, b = map(int, input().split())\nd = defaultdict(int)\narray = []\nfor i in range(a):\n x, y = map(in...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s069399633', 's651642519', 's831622541']
[2940.0, 20744.0, 19448.0]
[17.0, 410.0, 453.0]
[574, 560, 522]