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 |
|---|---|---|---|---|---|---|---|---|---|---|
p03102 | u861962192 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['def main():\n import numpy as np\n n, m, c = map(int, readline().split())\n ba = list(map(int, read().split()))\n a = np.array(ba[m:]).reshape((n,m))\n b = np.array(ba[:m])\n\n print(sum(np.dot(a,b)+c>0))\n\nif __name__ == "__main__":\n main()\n', 'import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\ndef main():\n import numpy as np\n n, m, c = map(int, readline().split())\n ba = list(map(int, read().split()))\n a = np.array(ba[m:]).reshape((n,m))\n b = np.array(ba[:m])\n\n print(sum(np.dot(a,b)+c>0))\n\nif __name__ == "__main__":\n main()\n'] | ['Runtime Error', 'Accepted'] | ['s543817739', 's591792048'] | [12488.0, 12448.0] | [149.0, 149.0] | [255, 372] |
p03102 | u868237899 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\n\ncorrect_answer = 0\n\nfor i in range(N):\n A = list(map(int, input().split()))\n \n for j in range(M):\n sum_AB += A[j]*B[j]\n if sum_AB + C > 0:\n correct_answer += 1\n\nprint(correct_answer)', 'N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\n\ncorrect_answer = 0\n\nfor i in range(N):\n A = list(map(int, input().split()))\n sum_AB = 0\n for j in range(M):\n sum_AB += A[j]*B[j]\n if sum_AB + C > 0:\n correct_answer += 1\n\nprint(correct_answer)'] | ['Runtime Error', 'Accepted'] | ['s592326443', 's505474968'] | [3060.0, 3060.0] | [17.0, 18.0] | [281, 291] |
p03102 | u869265610 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['N,M,H=list(map(int().input(),split()))\nB=list(map(int,input().split()))\ncount=0\nfor i in range(N):\n A=list(map(int,input().split()))\n ans=0\n for k in range(M):\n ans+=A[k]*B[k]\n if ans+H>:\n count+=1\nprint(count)\n', 'N,M,H=list(map(int,input().split()))\nB=list(map(int,input().split()))\ncount=0\nfor i in range(N):\n A=list(map(int,input().split()))\n ans=0\n for k in range(M):\n ans+=A[k]*B[k]\n if ans+H>0:\n count+=1\nprint(count)\n'] | ['Runtime Error', 'Accepted'] | ['s051916260', 's188309000'] | [8968.0, 9104.0] | [26.0, 28.0] | [221, 220] |
p03102 | u869937227 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['n,m,c = map(int,input().split())\nli = []\nfor i in range(n+1):\n\tli.append(list(map(int,input().split())))\n\ncnt = 0\nfor i in range(1,n):\n tmp = 0\n for j in range(m):\n tmp += li[i][j] * li[0][j]\n tmp += c\n if tmp > 0:\n cnt += 1\n \nprint(cnt)', 'n,m,c = map(int,input().split())\nli = []\nfor i in range(n+1):\n\tli.append(list(map(int,input().split())))\n\ncnt = 0\nfor i in range(1,n+1):\n tmp = 0\n for j in range(m):\n tmp += li[i][j] * li[0][j]\n tmp += c\n if tmp > 0:\n cnt += 1\n \nprint(cnt)'] | ['Wrong Answer', 'Accepted'] | ['s584765280', 's497543632'] | [3064.0, 3064.0] | [17.0, 18.0] | [250, 252] |
p03102 | u872538555 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['n, m, c =map(int, input().split())\nb = [int(x) for x in input().split()]\na = [[int (x) for x in input().split()] for _ in range(n)]\n\nans = 0\nfor i in range(n):\n cnt = 0\n for j in range(m):\n cnt += a[i][j] * b[j]\n \n cnt += c\n \n if 0 < cnt:\n ans += 1\n \nprint(ans)n', 'n, m, c =map(int, input().split())\nb = [int(x) for x in input().split()]\na = [[int (x) for x in input().split()] for _ in range(n)]\n\nans = 0\nfor i in range(n):\n cnt = 0\n for j in range(m):\n cnt += a[i][j] * b[j]\n \n cnt += c\n \n if 0 < cnt:\n ans += 1\n \nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s118130814', 's012239117'] | [3064.0, 3064.0] | [17.0, 18.0] | [301, 300] |
p03102 | u874244109 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['3 3 0\n100 -100 0\n0 100 100\n100 100 100\n-100 100 100', 'base = list(map(int,input().split()))\ncross = list(map(int,input().split()))\ncounter = 0\nfor i in range(base[0]):\n source = list(map(int,input().split()))\n point = 0\n for j in range(base[1]):\n point = point + cross[j]*source[j]\n \n if point+base[2] >0:\n counter = counter+1\n\nprint(counter)'] | ['Runtime Error', 'Accepted'] | ['s326879455', 's250796591'] | [2940.0, 3060.0] | [19.0, 19.0] | [51, 317] |
p03102 | u888610038 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['N,M,C=map(int,input().split())\nB=list(int,input().split())\nnum=0\nfor i in range(N):\n sum=0\n A=[]\n A.append(list(map(int,input().split())))\n for j in range(M):\n sum+=A[j] * B[j]\n if sum+C >0:\n num+=1\nprint(num)', 'N,M,C=map(int,input().split())\nB=list(int,input().split())\nnum=0\nfor i in range(N):\n sum=0\n A=list(int,input().split())\n for j in range(M):\n sum+=A[j] * B[j]\n if sum+C >0:\n num+=1\nprint(num)', 'N,M,C=map(int,input().split())\nB=list(map(int,input().split()))\nnum=0\nfor i in range(N):\n sum=0\n A=[]\n A.append(list(map(int,input().split())))\n for j in range(M):\n sum+=A[j] * B[j]\n if sum+C>0:\n num+=1\nprint(num)', 'N,M,C=map(int,input().split())\nB=list(map(int,input().split()))\nnum=0\nA=[]\nfor i in range(N):\n A.append(list(map(int,input().split())))\nD=[]\nfor j in range(N):\n sum=0\n D=A[j]\n for k in range(M):\n sum+=B[k]*D[k]\n if sum+C>0:\n num+=1\nprint(num)\n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s497027552', 's644263548', 's681139725', 's371860192'] | [3064.0, 3060.0, 3060.0, 3064.0] | [17.0, 17.0, 18.0, 17.0] | [220, 200, 224, 254] |
p03102 | u898999125 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['n, m, c=map(int, input().split())\nb=list(map(int, input().split()))\nac=0\nfor _ in range(n):\n ans=c\n a=list(map(int, input().split()))\n for i in range(n):\n ans+=a[i]*b[i]\n if ans>0:\n ac += 1\nprint(ac)', 'n, m, c=map(int, input().split())\nb=list(map(int, input().split()))\nac=0\nfor _ in range(n):\n ans=c\n a=list(map(int, input().split()))\n for i in range(m):\n ans+=a[i]*b[i]\n if ans>0:\n ac += 1\nprint(ac)'] | ['Runtime Error', 'Accepted'] | ['s189769919', 's137794657'] | [3060.0, 3060.0] | [17.0, 17.0] | [209, 209] |
p03102 | u909224749 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nA = [0]*N\ncount = 0\n\nfor n in range(N):\n A[n] = list(map(int, input().split()))\n \n for i in range(M):\n _sum += A[n][i] * B[i]\n \n if _sum + C > 0:\n count += 1\n else:\n continue\n \nprint(count)', 'N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nA = [0]*N\ncount = 0\n\nfor n in range(N):\n A[n] = list(map(int, input().split()))\n \n _sum = 0\n for i in range(M):\n _sum += A[n][i] * B[i]\n \n if _sum + C > 0:\n count += 1\n else:\n continue\n \nprint(count)\n'] | ['Runtime Error', 'Accepted'] | ['s431605232', 's345068829'] | [9112.0, 9184.0] | [27.0, 28.0] | [281, 293] |
p03102 | u912158215 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['import sys\nN, M, C = map(int, input().split())\nB = input().split()\nsumN = 0\ncount = 0\n\nfor i in range(N):\n A = input().split()\n for j in range(M):\n sumN = sumN + int(A[j])*int(B[j])\n if sumN + C > 0:\n count += 1\n sumN = 0', 'import sys\nN, M, C = map(int, input().split())\nB = input().split()\nsumN = 0\ncount = 0\n\nfor i in range(N):\n A = input().split()\n for j in range(M):\n sumN = sumN + int(A[j])*int(B[j])\n if sumN + C > 0:\n count += 1\n sumN = 0\n\nprint(count)'] | ['Wrong Answer', 'Accepted'] | ['s464486198', 's363597978'] | [3060.0, 3064.0] | [19.0, 17.0] | [247, 261] |
p03102 | u914330401 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nA = [[0]*M]*N\nans = 0\nsum = 0\nfor i in range(N):\n A[i] = list(map(int, input().split()))\nfor i in range(N):\n for j in range(M):\n sum += A[i][j] * B[j] + C\n if sum > 0:\n ans += 1\n \nprint(ans)', 'N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nA = [[0]*M]*N\nans = 0\nsum = 0\nfor i in range(N):\n A[i] = list(map(int, input().split()))\nfor i in range(N):\n for j in range(M):\n sum = A[i][j] * B[j] + C\n if sum > 0:\n ans += 1\n \nprint(ans)', 'N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nA = [[0]*M]*N\nans = 0\nsum = 0\nfor i in range(N):\n A[i] = list(map(int, input().split()))\n for j in range(M):\n sum = A[i][j] * B[j] + C\n if sum > 0:\n ans += 1\n \nprint(ans)', 'N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nA = [[0]*M]*N\nans = 0\nsum = 0\nfor i in range(N):\n A[i] = list(map(int, input().split()))\nfor i in range(N):\n sum = 0\n for j in range(M):\n sum += A[i][j] * B[j]\n sum += C\n if sum > 0:\n ans += 1\n \nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s141971916', 's433131118', 's976610291', 's871880765'] | [3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 17.0, 17.0, 18.0] | [276, 275, 256, 293] |
p03102 | u914773681 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ["def main():\n N, M, C = map(int, input().split())\n # B = []\n B = list(map(int, input().split())) \n A = [[] for i in range(N)]\n for i in range(N):\n A[i] = list(map(int, input().split()))\n print('B=',B)\n print('A=',A)\n \n num = 0\n for i in range(N):\n sum = 0\n for j in range(M):\n sum = sum + A[i][j]*B[j]\n result = sum + C\n if (result > 0 ):\n num = num + 1\n # print(num)\n return num\n\nmain()\n", '\ndef main():\n N, M, C = map(int, input().split())\n B = list(map(int, input().split())) \n A = [[] for i in range(N)]\n for i in range(N):\n A[i] = list(map(int, input().split()))\n\n num = 0\n for i in range(N):\n sum = 0\n for j in range(M):\n sum = sum + A[i][j]*B[j]\n result = sum + C\n if (result > 0 ):\n num = num + 1\n # print(num)\n return num\n\nmain()', "def main():\n N, M, C = map(int, input().split())\n # B = []\n B = list(map(int, input().split())) \n A = [[] for i in range(N)]\n for i in range(N):\n A[i] = list(map(int, input().split()))\n print('B=',B)\n print('A=',A)\n \n num = 0\n for i in range(N):\n sum = 0\n for j in range(M):\n sum = sum + A[i][j]*B[j]\n result = sum + C\n if (result > 0 ):\n num = num + 1\n print(num)\n return num\n\nmain()\n", 'def main():\n N, M, C = map(int, input().split())\n B = list(map(int, input().split())) \n A = [[] for i in range(N)]\n for i in range(N):\n A[i] = list(map(int, input().split()))\n\n num = 0\n for i in range(N):\n sum = 0\n for j in range(M):\n sum = sum + A[i][j]*B[j]\n result = sum + C\n if (result > 0 ):\n num = num + 1\n print(num)\n return num\n\nmain()'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s717679259', 's883917247', 's905156945', 's967392985'] | [3064.0, 3064.0, 3064.0, 3064.0] | [17.0, 17.0, 18.0, 17.0] | [512, 450, 510, 447] |
p03102 | u917013605 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['n, m , c = map(int, input().split())\nb_li = list(map(int, input().split()))\nans = 0\nfor i in range(n):\n a_li = list(map(int, input().split()))\n if (0 < a * b + c for a, b in zip(a_li, b_li)):\n ans += 1\nprint(ans)\n', 'n, m , c = map(int, input().split())\nb_li = list(map(int, input().split()))\nans = 0\nfor i in range(n):\n a_li = list(map(int, input().split()))\n if sum(a * b for a, b in zip(a_li, b_li)) + c > 0:\n ans += 1\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s225893945', 's053740459'] | [3060.0, 2940.0] | [19.0, 18.0] | [226, 229] |
p03102 | u924671994 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['n,m,c=map(int,input().split())\nb=list(map(int,input().split())\na=[list(map(int,input().split())) for k in range(n)]\n\ncount=0\n\nfor i in range(n)\n absum=0\n for j in range(m)\n absum +=a[i][j]*b[j]\n \n ans=absum+c\n if ans>0:\n count +=1\nprint(count) ', 'n,m,c=map(int,input().split())\nB=list(map(int,input().split())) \nA=[list(map(int,input().split()))for i in range(n)] \ncnt=0 \nfor i in range(n):\n total = 0\n for j in range(m):\n total+=B[j]*A[i][j]\n total+=c\n if total>0:\n cnt+=1 \nprint(cnt)', 'n,m,c=map(int,input().split())\nB=list(map(int,input().split()))\nA=[list(map(int,input().split()))for i in range(n)] \ncnt=0\nfor i in range(n):\n total=0\n for j in range(m):\n total+=B[j]*A[i][j]\n total+=c\n if 0<total:\n cnt+=1\nprint(cnt)', 'gt', 'n,m,c=map(int,input().split())\nb=list(map(int,input().split()))\na=[list(map(int,input().split())) for k in range(n)]\n \ncount=0\n \nfor i in range(n)\n absum=0\n for j in range(m)\n absum +=a[i][j]*b[j]\n \n ans=absum+c\n if ans>0:\n count +=1\nprint(count) ', 'n,m,c=map(int,input().split())\nB=list(map(int,input().split())) \nA=[list(map(int,input().split()))for i in range(n)] \ncnt=0 \nfor i in range(n):\n total = 0\n for j in range(m):\n total+=B[j]*A[i][j]\n total+=c\n if total>0:\n cnt+=1 \nprint(cnt)', 'n,m,c=map(int,input().split())\nB=list(map(int,input().split())) \nA=[list(map(int,input().split()))for i in range(n)] \ncnt=0 \nfor i in range(n):\n total = 0\n for j in range(m):\n total+=B[j]*A[i][j]\n total+=c\n if total>0:\n cnt+=1 \nprint(cnt)', 'n,m,c=map(int,input().split())\nb=list(map(int,input().split()))\na=[list(map(int,input().split())) for k in range(n)]\n \ncount=0\n \nfor i in range(n):\n absum=0\n for j in range(m):\n absum +=a[i][j]*b[j]\n \n ans=absum+c\n if ans>0:\n count+=1\n \nprint(count)'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s031769783', 's463202239', 's497056475', 's818633605', 's828657813', 's842905835', 's895990706', 's781267701'] | [2940.0, 2940.0, 3064.0, 2940.0, 2940.0, 3064.0, 3064.0, 3064.0] | [17.0, 17.0, 18.0, 17.0, 17.0, 18.0, 17.0, 17.0] | [292, 259, 286, 2, 295, 255, 275, 266] |
p03102 | u932868243 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['n,m,c=map(int,input().split())\nb=list(map(int,input().split()))\nlista=[list(map(int,input().split())) for x in range(n)]\nans=0\nfor i in range(1,n+1):\n sum=0\n for j in range(1,m+1):\n sum+=lista[j-1][j-1]*b[j-1]\n if sum+c>0:\n ans+=1\nprint(ans)\n', 'n,m,c=map(int,input().split())\nb=list(map(int,input().split()))\nlista=[list(map(int,input().split())) for x in range(n)]\nans=0\nfor i in range(1,n+1):\n sum=0\n for j in range(1,m+1):\n sum+=lista[i-1][j-1]*b[j-1]\n if sum+c>0:\n ans+=1\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s050268739', 's012609030'] | [3060.0, 3060.0] | [18.0, 18.0] | [251, 251] |
p03102 | u934442292 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nA = [0] * N\nfor i in range(N):\n A[i] = list(map(int, input().split()))\n\nans = 0\nfor i in range(N):\n y = C\n for j in range(M):\n y += A[j]*B[j]\n if y > 0:\n ans += 1\nprint(ans)\n', 'N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nA = [0] * N\nfor i in range(N):\n A[i] = list(map(int, input().split()))\n\nans = 0\nfor i in range(N):\n y = C\n for j in range(M):\n y += A[i][j]*B[j]\n if y > 0:\n ans += 1\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s288610202', 's946329518'] | [3060.0, 3064.0] | [17.0, 18.0] | [256, 259] |
p03102 | u934868410 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['n,m,c = map(int, input().split())\nb = list(map(int,input().split()))\na = []\n\ndef mul(x, y):\n ret = 0\n for i in range(len(x)):\n ret += x[i]*y[i]\n\nans = 0\nfor i in range(n):\n a = list(map(int, input().split()))\n if mul(a, b) + c > 0:\n ans += 1\n\nprint(ans)', 'n,m,c = map(int, input().split())\nb = list(map(int,input().split()))\na = []\n\ndef mul(x, y):\n ret = 0\n for i in range(len(x)):\n ret += x[i]*y[i]\n return ret\n \nans = 0\nfor i in range(n):\n a = list(map(int, input().split()))\n if mul(a, b) + c > 0:\n ans += 1\n\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s431784577', 's645901166'] | [3064.0, 3064.0] | [18.0, 17.0] | [263, 280] |
p03102 | u939585142 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nA = []\n\nfor i in range(N):\n A.append(list(map(int, input().split())))\n\nnum = 0\nfor i in range(N):\n ans = 0\n for j in range(M):\n ans = A[i][j] * B[j]\n if ans + C > 0:\n num += 1\nprint(num)\n\n ', 'N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nA = []\n\nfor i in range(N):\n A.append(list(map(int, input().split())))\n\nnum = 0\nfor i in range(N):\n ans = 0\n for j in range(M):\n ans = A[i][j] * B[j]\n if ans + C > 0:\n num += 1\nprint(num)\n\n ', 'N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nA = []\n\nfor i in range(N):\n A.append(list(map(int, input().split())))\n\nnum = 0\nfor i in range(N):\n ans = 0\n for j in range(M):\n ans += A[i][j] * B[j]\n if ans + C > 0:\n num += 1\nprint(num)\n\n \n \n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s401579865', 's767157233', 's369788180'] | [3060.0, 3064.0, 3064.0] | [18.0, 18.0, 18.0] | [276, 276, 283] |
p03102 | u941439555 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['import numpy as np\nN, M, C = list(map(int, input().split()))\nBs = list(map(int, input().split()))\n\ndef is_correct(As):\n return np.inner(As, Bs) + C > 0\n\nAs = list(map(int, input().split()))\nn = 0\nwhile As:\n if is_correct(As):\n n += 1\n try:\n\tAs = list(map(int, input().split()))\n except:\n break\n \nprint(n)', 'import numpy as np\nN, M, C = list(map(int, input().split()))\nBs = list(map(int, input().split()))\n\ndef is_correct(As):\n return np.inner(As, Bs) + C > 0\n\nAs = list(map(int, input().split()))\nn = 0\nwhile As:\n if is_correct(As):\n n += 1\n try:\n As = list(map(int, input().split()))\n except:\n break\n \nprint(n)\n\n'] | ['Runtime Error', 'Accepted'] | ['s676188275', 's963400376'] | [2940.0, 12500.0] | [17.0, 150.0] | [315, 320] |
p03102 | u946424121 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['n,m,c = map(int,input().split())\nb = list(map(int,input().split()))\ncount = 0\nfor i in range(n):\n A = list(map(int,input().split()))\n for j in range(len(m)):\n ans = A_i[j]*b[j] + c\n if ans > 0:\n tmp += 1\nprint(tmp)\n', 'n,m,c = map(int,input().split())\nb = list(map(int,input().split()))\ncount = 0\nfor i in range(n):\n A = list(map(int,input().split()))\n for j in range(m):\n ans = A[j]*b[j]\n ans = ans+ c\n if ans > 0:\n tmp += 1\nprint(tmp)', 'n,m,c = map(int,input().split())\nb = list(map(int,input().split()))\ntmp = 0\nfor i in range(n):\n A_i = list(map(int,input().split()))\n for _ in range(len(A_i)):\n ans = A_i[_]*b[_] + c\n if ans >= 0:\n tmp = tmp + 1\nprint(tmp)', 'n,m,c = map(int,input().split())\nb = list(map(int,input().split()))\ncount = 0\nans = 0\nfor i in range(n):\n A = list(map(int,input().split()))\n for j in range(m):\n ans += A[j]*b[j]\n ans = ans + c\n if ans > 0:\n tmp += 1\nprint(tmp)', 'n,m,c = map(int,input().split())\nb = list(map(int,input().split()))\ncount = 0\nfor i in range(n):\n A = list(map(int,input().split()))\n for j in range(m):\n ans = A_i[j]*b[j] + c\n if ans > 0:\n tmp += 1\nprint(tmp)', 'n,m,c = map(int,input().split())\nb = list(map(int,input().split()))\ntmp = 0\nfor i in range(n):\n A_i = list(map(int,input().split()))\n for _ in range(len(m)):\n ans = A_i[_]*b[_] + c\n if ans >= 0:\n tmp = tmp + 1\nprint(tmp)', 'n,m,c = map(int,input().split())\nb = list(map(int,input().split()))\ncount = 0\nfor i in range(n):\n A = list(map(int,input().split()))\n ans = 0\n for j in range(m):\n ans += A[j]*b[j]\n ans = ans + c\n if ans > 0:\n count+= 1\nprint(count)'] | ['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s383125586', 's400707325', 's420842935', 's530640067', 's550232283', 's574343694', 's719925646'] | [3060.0, 3064.0, 3060.0, 3060.0, 3060.0, 3064.0, 3060.0] | [18.0, 18.0, 18.0, 18.0, 20.0, 17.0, 17.0] | [238, 247, 245, 253, 232, 243, 260] |
p03102 | u957872856 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['n, m, c = map(int, input().split())\nb = list(map(int, input().split()))\nnum = c\ncount = 0\nfor i in range(n):\n a = list(map(int, input().split()))\n for j in range(m):\n num += a[j]*b[j]\n print(num)\n if num > 0:\n count += 1\n num = c\n else:\n num = c\nprint(count)', 'n, m, c = map(int, input().split())\nb = list(map(int, input().split()))\nnum = c\ncount = 0\nfor i in range(n):\n a = list(map(int, input().split()))\n for j in range(m):\n num += a[j]*b[j]\n if num > 0:\n count += 1\n num = c\n else:\n num = c\nprint(count)'] | ['Wrong Answer', 'Accepted'] | ['s526974976', 's539460916'] | [3064.0, 3064.0] | [18.0, 17.0] | [275, 262] |
p03102 | u960171798 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['N,M,C = map(int, input().split())\nB = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n A = list(map(int, input().split()))\n condition = C\n for j in range(M-1):\n condition += A[j]*B[j]\n if condition > 0:\n ans += 1\nprint(ans)\n', 'N,M,C = map(int, input().split())\nB = list(map(int, input().split()))\nans = 0\nfor i in range(N):\n A = list(map(int, input().split()))\n sum = 0\n for j in range(M):\n sum += A[j]*B[j]\n if sum+C > 0:\n ans += 1\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s529729538', 's266935445'] | [3060.0, 3060.0] | [20.0, 17.0] | [245, 227] |
p03102 | u970809473 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['n,m,c = map(int, input().split())\nb = list(map(int, input().split()))\nres = 0\nfor i in range(n):\n a = list(map(int, input().split()))\n if sum(a * b) + c > 0:\n res += 1\nprint(res)', 'import numpy as np\nn,m,c = map(int, input().split())\nb = np.array(list(map(int, input().split())))\nres = 0\nfor i in range(n):\n a = np.array(list(map(int, input().split())))\n if sum(a * b) + c > 0:\n res += 1\nprint(res)\n'] | ['Runtime Error', 'Accepted'] | ['s283520793', 's158859037'] | [3060.0, 20668.0] | [17.0, 292.0] | [183, 223] |
p03102 | u971811058 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['#include<bits/stdc++.h>\n// Begin Header {{{\nusing namespace std;\nusing ll = long long;\nusing P = pair<ll, ll>;\nusing Graph = vector<vector<ll>>;\n#define rep(i,n) for(ll i=0; i<n; i++)\n#define loop(i, j, n) for(ll i=j; i<n; i++)\n#define all(x) (x).begin(), (x).end()\nconstexpr int INF = 0x3f3f3f3f;\nconst long long mod=1e9+7;\nconst long double PI = acos(-1);\n// }}} End Header\n\nint main() {\n\tint n, m, c, ans =0;\n\tcin >> n >> m >> c;\n\tvector<int> b(m);\n\trep(i,m) cin >> b[i];\n\trep(i,n){\n\t\tint sum = 0;\n\t\tvector<int> a(m);\n\t\trep(j,m){\n\t\t\tcin >> a[j];\n\t\t\tsum += a[j]*b[j];\n\t\t}\n\t\tsum+=c;\n\t\tif(sum > 0) ans++;\n\t}\n\tcout << ans << endl;\n\treturn 0;\n}', 'n, m, c = map(int, input().split())\nb = [int(i) for i in input().split()]\nans = 0\nfor i in range(n):\n a = [int(i) for i in input().split()]\n sum = 0\n for k in range(m):\n sum +=(a[k]*b[k])\n sum+=c\n if sum > 0: ans+=1\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s442217169', 's786706400'] | [2940.0, 3064.0] | [17.0, 18.0] | [643, 273] |
p03102 | u979362546 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['import numpy as np\nn, m, c = map(int, input().split())\nb = list(map(int, input().split()))\nA = [[int(i) for i in input().split()] for i in range(n)]\nB = np.array(b).reshape(m,1)\ncnt = 0\nfor i in range(m):\n x = np.dot(A[i], B)+c\n if x >0:\n \tcnt += 1\n print(cnt)', 'import numpy as np\nn, m, c = map(int, input().split())\nb = list(map(int, input().split()))\nA = [[int(i) for i in input().split()] for i in range(n)]\nB = np.array(b).reshape(m,1)\n', 'import numpy as np\nn, m, c = map(int, input().split())\nb = list(map(int, input().split()))\nA = [[int(i) for i in input().split()] for i in range(n)]\nB = np.array(b).reshape(m,1)\ncnt = 0\nfor i in range(m):\n x = np.dot(A[i], B)+c\n if x >0:\n \tcnt += 1\n\nprint(cnt)', 'import numpy as np\nn, m, c = map(int, input().split())\nb = list(map(int, input().split()))\nA = [[int(i) for i in input().split()] for i in range(n)]\nB = np.array(b).reshape(m,1)\ncnt = 0\nfor i in range(n):\n x = np.dot(A[i], B)+c\n if x >0:\n \tcnt += 1\n\nprint(cnt)'] | ['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted'] | ['s015900682', 's018388616', 's475529125', 's616330791'] | [12428.0, 12448.0, 13364.0, 12428.0] | [150.0, 149.0, 169.0, 149.0] | [272, 178, 269, 269] |
p03102 | u987637902 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['# ABC121\n# B Can you solve this?\nN, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nA = [list(map(int, input().split())) for _ in range(N)]\nans = 0\nANS = []\nct = 0\nfor i in range(N):\n for j in range(M):\n ans += A[i][j] * B[j]\n if j == M-1:\n ANS.append(ans)\n ans = 0\nprint(ANS)\nfor x in ANS:\n if x + C > 0:\n ct += 1\nprint(ct)\n', '# ABC121\n# B Can you solve this?\nN, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nA = [list(map(int, input().split())) for _ in range(N)]\nans = 0\nANS = []\nct = 0\nfor i in range(N):\n for j in range(M):\n ans += A[i][j] * B[j]\n if j == M-1:\n ANS.append(ans)\n ans = 0\nfor x in ANS:\n if x + C > 0:\n ct += 1\nprint(ct)\n'] | ['Wrong Answer', 'Accepted'] | ['s047882800', 's617526731'] | [9104.0, 9092.0] | [30.0, 27.0] | [395, 384] |
p03102 | u990671997 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nhoge = [list(map(int, input().split())) for _ in range(N-1)]\nC_m = [C for _ in range(M)]\n\nout = []\nres = 0\nfor i in range(N-1):\n for j in range(M):\n res += (hoge[i][j]* B[j])\n out.append((res+C) > 0)\n res = 0\n\nprint(sum(out))', 'N, M, C = map(int, input().split())\nB = list(map(int, input().split()))\nhoge = [list(map(int, input().split())) for _ in range(N)]\nC_m = [C for _ in range(M)]\n\nout = []\nres = 0\nfor i in range(N):\n for j in range(M):\n res += (hoge[i][j]* B[j])\n out.append((res+C) > 0)\n res = 0\n\n \nprint(sum(out))'] | ['Wrong Answer', 'Accepted'] | ['s703498348', 's166814145'] | [3064.0, 3064.0] | [17.0, 17.0] | [303, 302] |
p03102 | u992910889 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['N, M, C = list(map(int, input().split()))\nB = list(map(int, input().split())\nA = []\n\nfor i in range(N):\n\tA.append(list(map(int, input().split())\n\t\ndef main():\n\tcnt = 0\n\tfor i in range(N):\n\t\tval = C\n\t\tfor j in range(M):\n\t\t\tval += A[i][j] * B[j]\n\t\tif val > 0:\n\t\t\tcnt += 1\n\treturn cnt\nprint(main)\n', 'N, M, C = list(map(int, input().split()))\nB = list(map(int, input().split()))\nA = []\nfor i in range(N):\n\tA.append(list(map(int, input().split())))\n\t\ndef main():\n\tcnt = 0\n\tfor i in range(N):\n\t\tval = C\n\t\tfor j in range(M):\n\t\t\tval += A[i][j] * B[j]\n\t\tif val > 0:\n\t\t\tcnt += 1\n\treturn cnt\nprint(main())\n'] | ['Runtime Error', 'Accepted'] | ['s406353859', 's344034179'] | [2940.0, 3060.0] | [17.0, 18.0] | [294, 298] |
p03102 | u996564551 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ["N, M, C = input().split(' ')\nN = int(N)\nM = int(M)\nC = int(C)\nB = []\nB = input().split(' ')\nB = [int(i) for i in B]\nA = []\nR = 0\nfor i in range(N):\n A = input().split(' ')\n A = [int(i) for i in A]\n combine = [x * y for (x, y) in zip(A, B)]\n print(sum(combine) + C)\n if sum(combine) + C > 0:\n R += 1\nprint(R)", "N, M, C = input().split(' ')\nN = int(N)\nM = int(M)\nC = int(C)\nB = []\nB = input().split(' ')\nB = [int(i) for i in B]\nA = []\nR = 0\nfor i in range(N):\n A = input().split(' ')\n A = [int(i) for i in A]\n combine = [x * y for (x, y) in zip(A, B)]\n if sum(combine) + C > 0:\n R += 1\nprint(R)"] | ['Wrong Answer', 'Accepted'] | ['s410531548', 's578547776'] | [9148.0, 9136.0] | [29.0, 28.0] | [315, 289] |
p03102 | u999503965 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['n,m,c=map(int,input().split())\nb_list=list(map(int,input().split()))\n\nans=0\nfor i in range(n):\n a_list=list(map(int,input().split()))\n num=0\n for j in range(m):\n num+=b_list[j]*a_list[j]\n if num-c>0:\n ans+=1\n ', 'n,m,c=map(int,input().split())\nb_list=list(map(int,input().split()))\n\nans=0\nfor i in range(n):\n a_list=list(map(int,input().split()))\n num=0\n for j in range(m):\n num+=b_list[j]*a_list[j]\n if num+c>0:\n ans+=1\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s236393549', 's067309216'] | [9144.0, 9160.0] | [26.0, 27.0] | [220, 229] |
p03102 | u999893056 | 2,000 | 1,048,576 | There are N pieces of source code. The characteristics of the i-th code is represented by M integers A_{i1}, A_{i2}, ..., A_{iM}. Additionally, you are given integers B_1, B_2, ..., B_M and C. The i-th code correctly solves this problem if and only if A_{i1} B_1 + A_{i2} B_2 + ... + A_{iM} B_M + C > 0. Among the N codes, find the number of codes that correctly solve this problem. | ['N , M ,C = map(int,input().split())\nB = map(int, input().split())\n\ncount = 0\nfor i in range(N):\n A = list(map(int, input().split()))\n p = C\n for j in range(M):\n p+= A[j]*B[j]\n if p > 0:\n count+=1\nprint(count)\n\n', 'N , M ,C = map(int,input().split())\nB = map(int, input().split())\n\ncount = 0\nfor i in range(N):\n A = list(map(int, input().split()))\n p = C\n for j in range(M):\n p+= A[j]*B[j]\n if p > 0:\n count+=1\nprint(count)\n\n', 'N,M,C=map(int,input().split())\nB=list(map(int,input().split()))\ncount=0\nfor i in range(N):\n A=list(map(int,input().split()))\n p=C\n for j in range(M):p+=A[j]*B[j]\n if p>0:count+=1\nprint(count)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s176846962', 's321293666', 's839020165'] | [3060.0, 3060.0, 3060.0] | [18.0, 17.0, 17.0] | [245, 245, 191] |
p03103 | u000557170 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['# -*- coding: utf-8 -*-\n\nimport sys\n\ndef parse_input(lines_as_string = None):\n\n lines = []\n if lines_as_string is None:\n lines.append(input())\n tokens = lines[0].split(" ")\n n = int(tokens[0])\n m = int(tokens[1])\n for i in range(n):\n lines.append(input())\n else:\n lines = [e for e in lines_as_string.split("\\n")][1:-1]\n print("lines=%s" % lines)\n tokens = lines[0].split(" ")\n n = int(tokens[0])\n m = int(tokens[1])\n\n a = []\n b = []\n for i in range(n):\n tokens = lines[i+1].split(" ")\n a.append(int(tokens[0]))\n b.append(int(tokens[1]))\n\n return (n, m, a, b)\n\ndef solve(n, m, a, b):\n\n \n s_a = sorted([(i, e) for i, e in enumerate(a)], key=lambda e: e[1])\n print("s_a=%s" % s_a)\n\n current = m\n total = 0\n tmp = 0\n for i, e in s_a:\n if current > b[i]:\n tmp = e * b[i]\n current = current - b[i]\n else:\n tmp = e * current\n current = 0\n\n total = total + tmp\n\n\n if current == 0:\n break\n\n return total\n\ndef main():\n\n print("%d" % solve(*parse_input()))\n\nif __name__ == \'__main__\':\n\n main()\n', '# -*- coding: utf-8 -*-\n\nimport sys\n\ndef parse_input(lines_as_string = None):\n\n lines = []\n if lines_as_string is None:\n lines.append(input())\n tokens = lines[0].split(" ")\n n = int(tokens[0])\n m = int(tokens[1])\n for i in range(n):\n lines.append(input())\n else:\n lines = [e for e in lines_as_string.split("\\n")][1:-1]\n print("lines=%s" % lines)\n tokens = lines[0].split(" ")\n n = int(tokens[0])\n m = int(tokens[1])\n\n a = []\n b = []\n for i in range(n):\n tokens = lines[i+1].split(" ")\n a.append(int(tokens[0]))\n b.append(int(tokens[1]))\n\n return (n, m, a, b)\n\ndef solve(n, m, a, b):\n\n \n s_a = sorted([(i, e) for i, e in enumerate(a)], key=lambda e: e[1])\n# print("s_a=%s" % s_a)\n\n current = m\n total = 0\n tmp = 0\n for i, e in s_a:\n if current > b[i]:\n tmp = e * b[i]\n current = current - b[i]\n else:\n tmp = e * current\n current = 0\n\n total = total + tmp\n\n\n if current == 0:\n break\n\n return total\n\ndef main():\n\n print("%d" % solve(*parse_input()))\n\nif __name__ == \'__main__\':\n\n main()\n'] | ['Wrong Answer', 'Accepted'] | ['s460048764', 's774622406'] | [27324.0, 23476.0] | [374.0, 336.0] | [1264, 1265] |
p03103 | u001687078 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m,*t = map(int, open(0).read().split())\nans = 0\nfor a, b in sorted(zip(t[::2], t[1::2])):\n ans += min(a, m)*b\n m -= a\n if m <= 0:\n print(ans)\n break;', 'n,m,*t = map(int, open(0).read().split())\nans = 0\nfor a, b in sorted(zip(t[::2], t[1::2])):\n ans += min(b, m)*a\n m -= b\n if m <= 0:\n print(ans)\n break'] | ['Wrong Answer', 'Accepted'] | ['s078220742', 's087244207'] | [24372.0, 25828.0] | [165.0, 222.0] | [160, 159] |
p03103 | u006721330 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N, M = map(int, input().split())\ndrink = []\ncost = 0\ncount = 0\nd_count = 0\nrest = 0\n \n \nfor _ in range(N):\n drink.append(list(map(int, input().split())))\n drink.sorted()\n \nfor i in range(N):\n cost += drink[i][0] * drink[i][1]\n d_count += drink[i][1]\n count += 1\n if d_count > M:\n break\n \ncost -= drink[count-1][0] * drink[count-1][1]\nd_count -= drink[count-1][1]\nrest = M - d_count\ncost += rest * drink[count-1][0]\nprint(cost)', 'N, M = map(int, input().split())\ndrink = []\ncost = 0\ncount = 0\nd_count = 0\nrest = 0\n\n\nfor _ in range(N):\n drink.append(list(map(int, input().split())))\n drink.sorted(drink)\n\nfor i in range(N):\n cost += drink[i][0] * drink[i][1]\n d_count += drink[i][1]\n count += 1\n if d_count > M:\n break\n \ncost -= drink[count-1][0] * drink[count-1][1]\nd_count -= drink[count-1][1]\nrest = M - d_count\ncost += rest * drink[count-1][0]\nprint(cost)\n ', 'N, M = map(int, input().split())\ndrink = []\ncost = 0\ncount = 0\nd_count = 0\nrest = 0\n\n\nfor i in range(N):\n Drink = list(map(int, input().split()))\n drink.append(Drink)\n drink.sort()\n for j in range(drink[i][1]):\n d_count += 1\n cost += drink[i][0]\n if d_count == M or d_count == drink[i][1]\nprint(cost)', 'N, M = map(int, input().split())\ndrink = []\ncost = 0\nd_count = 0\n\n\nfor _ in range(N):\n drink.append(list(map(int, input().split())))\n \ndrink = sorted(drink)\n\nfor i in range(N):\n cost += drink[i][0] * drink[i][1]\n d_count += drink[i][1] \n if d_count > M:\n cost -= drink[i][0] * (d_count - M)\n break\n \n\nprint(cost)\n \n'] | ['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s706165379', 's758225275', 's875153955', 's442584621'] | [3064.0, 3064.0, 2940.0, 28656.0] | [18.0, 18.0, 18.0, 534.0] | [454, 461, 327, 348] |
p03103 | u013408661 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m=map(int,input().split())\npotion=[]\nfor i in range(n):\n potion_R = list(map(int,input().split())\n potion.append(potion_R)\npotion.sort()\nans=0\nnumber=m\nfor i in potion:\n if i[1]<=number:\n number-= i[1]\n ans+= i[0]*i[1]\n else:\n ans+= i[0]*number\n break\nprint(ans)', 'n,m=map(int,input().split())\npotion=[]\nfor i in range(N):\n potion_R = list(map(int,input().split())\n potion.append(potion_R)\npotion.sort()\nans=0\nnumber=m\nfor i in potion:\n if i[1]<=number:\n number-= i[1]\n ans+= i[0]*i[1]\n else:\n ans+= i[0]*number\n break\nprint(ans)', 'n,m=map(int,input().split())\npotion=[]\nfor i in range(n):\n potion_R = list(map(int,input().split()))\n potion.append(potion_R)\npotion.sort()\nans=0\nnumber=m\nfor i in potion:\n if i[1]<=number:\n number-= i[1]\n ans+= i[0]*i[1]\n else:\n ans+= i[0]*number\n break\nprint(ans)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s454044000', 's688616556', 's064530785'] | [2940.0, 2940.0, 27760.0] | [17.0, 17.0, 547.0] | [304, 304, 305] |
p03103 | u015993380 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,k = map(int, input().split())\na = sorted([tuple(input().split()) for i in range(n)])\nans = 0\nfor x in a:\n temp = min(x[1],k)\n ans += temp*x[0]\n k = max(0,k-temp)\nprint(ans)', 'n,k = map(int, input().split())\na = sorted(tuple(map(int,input().split())) for i in range(n))\nans = 0\nfor x in a:\n temp = min(x[1],k)\n ans += temp*x[0]\n k = max(0,k-temp)\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s359037596', 's018932062'] | [23252.0, 17000.0] | [337.0, 461.0] | [177, 185] |
p03103 | u022658079 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['import numpy as np\nfrom operator import itemgetter\nN,M=(int(x) for x in input().split())\nA=[]\nfor i in range(N):\n D=[int(x) for x in input().split()]\n A=A+[D]\nprint(A) \nresult=A.sort(key=itemgetter(0))\nprint(A)\ncount=M\nsum=0\nfor i in range(N):\n if count-A[i][1]>0:\n count=count-A[i][1]\n sum=sum+A[i][0]*A[i][1]\n else:\n sum=sum+count*A[i][0]\n break\nprint(sum) ', 'import numpy as np\nfrom operator import itemgetter\nN,M=(int(x) for x in input().split())\nA=[]\n\nfor i in range(N):\n D=[int(x) for x in input().split()]\n A=A.append([D]) \nresult=A.sort(key=itemgetter(0))\ncount=M\nsum=0\nfor i in range(N):\n if count-A[i][1]>0:\n count=count-A[i][1]\n sum+=A[i][0]*A[i][1]\n else:\n sum+=count*A[i][0]\n break\nprint(sum) ', 'import numpy as np\nfrom operator import itemgetter\nN,M=(int(x) for x in input().split())\nA=[]\n \nfor i in range(N):\n D=[int(x) for x in input().split()]\n A+=[D] \nresult=A.sort(key=itemgetter(0))\ncount=M\nsum=0\nfor i in range(N):\n if count-A[i][1]>0:\n count=count-A[i][1]\n sum+=A[i][0]*A[i][1]\n else:\n sum+=count*A[i][0]\n break\nprint(sum) '] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s067693627', 's221209372', 's170429493'] | [17064.0, 14428.0, 31860.0] | [2109.0, 153.0, 568.0] | [381, 366, 355] |
p03103 | u023958502 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N,M = map(int,input().split())\nab = []\nfor n in range(N):\n a,b = map(int,input().split())\n ab.append((a,b))\nab.sort()\ncoin = 0\ncnt = 0\nfor n in range(N):\n cnt += ab[n][1]\n if cnt >= M:\n coin += (cnt - M) * ab[n][0]\n print(coin)\n break\n coin += ab[n][1] * ab[n][0]', 'N,M = map(int,input().split())\nab = []\nfor n in range(N):\n a,b = map(int,input().split())\n ab.append((a,b))\nab.sort()\ncoin = 0\ncnt = 0\nfor n in range(N):\n cnt += ab[n][1]\n coin += ab[n][1] * ab[n][0]\n if cnt >= M:\n coin -= (cnt - M) * ab[n][0]\n print(coin)\n exit()'] | ['Wrong Answer', 'Accepted'] | ['s295766986', 's024010731'] | [16892.0, 16908.0] | [422.0, 418.0] | [299, 300] |
p03103 | u025287757 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n, m = map(int, input().split())\nA = {}\nfor i in range(n):\n a, b = map(int, input().split())\n if not a in A:\n A[a] = b\n else:\n A[a] += b\nans = 0\nnum = 0\nfor k, v in A.items():\n if num < m and m <= num+v:\n ans += (m-num)*k\n break\n else:\n ans += v*k\n num += v\nprint(ans)', 'n, m = map(int, input().split())\nA = {}\nfor i in range(n):\n a, b = map(int, input().split())\n if not a in A:\n A[a] = b\n else:\n A[a] += b\nans = 0\nnum = 0\nA = sorted(A.items())\nfor k, v in A:\n if num < m and m <= num+v:\n ans += (m-num)*k\n break\n else:\n ans += v*k\n num += v\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s055718428', 's601251981'] | [17880.0, 22996.0] | [338.0, 440.0] | [291, 305] |
p03103 | u027929618 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m=map(int,input().split())\nab=[list(map(int,input().split())) for _ in range(n)]\nsorted_ab=sorted(ab, key=lambda x: x[0])\nans=0\ni=0\nfor a, b in sorted_ab:\n for _ in range(b):\n if i < m:\n ans+=a\n i+=1\n else:\n break', 'n,m=map(int,input().split())\nab=[list(map(int,input().split())) for _ in range(n)]\nsorted_ab=sorted(ab, key=lambda x: x[0])\nans=0\ni=0\nfor a, b in sorted_ab:\n for _ in range(b):\n if i < m:\n ans+=a\n i+=1\n else:\n break\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s176006312', 's618209223'] | [29796.0, 29796.0] | [484.0, 466.0] | [237, 248] |
p03103 | u033272694 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['from functools import reduce\nN, M = map(int,input().split())\nary1 =[]\nfor x in range(N):\n ary1.append(list(map(int,input().split())))\n\nary2 = sorted(ary1)\nprint(ary2)\ncount = 0\ntotal_sum = 0\nfor i in range(N):\n if count + ary2[i][1] <= M:\n total_sum += ary2[i][0] * ary2[i][1]\n count += ary2[i][1]\n elif count > M :\n break\n else:\n zan = M - count\n total_sum += ary2[i][0] * zan\n count += zan\n\nprint(total_sum)\n', 'from functools import reduce\nN, M = map(int,input().split())\nary1 =[]\nfor x in range(N):\n ary1.append(list(map(int,input().split())))\n\nary2 = sorted(ary1)\ncount = 0\ntotal_sum = 0\nfor i in range(N):\n if count + ary2[i][1] <= M:\n total_sum += ary2[i][0] * ary2[i][1]\n count += ary2[i][1]\n elif count > M :\n break\n else:\n zan = M - count\n total_sum += ary2[i][0] * zan\n count += zan\n\nprint(total_sum)'] | ['Wrong Answer', 'Accepted'] | ['s393206743', 's458912918'] | [35040.0, 29076.0] | [629.0, 546.0] | [432, 419] |
p03103 | u033524082 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m=map(int,input().split())\nl={}\nnedan=[]\nans=0\nnum=0\nsmall=0\nfor i in range(n):\n kane,kazu=map(int,input().split())\n if kane in nedan:\n l[kane]+=kazu\n else:\n l[kane]=kane\n nedan.append(kane)\nnedan.sort()\nset(nedan)\nwhile True:\n if num+l[nedan[small]]<m:\n ans+=nedan[small]*l[nedan[small]]\n num+=l[nedan[small]]\n small+=1\n else:\n ans+=(m-num)*nedan[small]\n break\nprint(ans)', 'n,m=map(int,input().split())\nl={}\nk=[]\nans=0\nnum=0\nv=0\nfor i in range(n):\n a,b=map(int,input().split())\n if a in l:\n l[a]=l[a]+b\n else:\n l[a]=b\n k.append(a)\nset(k)\nwhile True:\n if num+l[k[v]]<m:\n ans+=k[v]*l[k[v]]\n num+=l[k[v]]\n v+=1\n else:\n ans+=(m-num)*k[v]\n break\nprint(ans)', 'n,m=map(int,input().split())\nl=[list(map(int,input().split())) for i in range(n)]\nl.sort()\nmoney=0\nbottle=0\nfor i in range(n):\n if bottle+l[i][1]<=m:\n bottle+=l[i][1]\n money+=l[i][0]*l[i][1]\n else:\n money+=l[i][0]*(m-bottle)\n break\nprint(money)'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s238541785', 's495366315', 's265139638'] | [7072.0, 23032.0, 27760.0] | [2104.0, 392.0, 529.0] | [441, 344, 278] |
p03103 | u033602950 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N,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\nprint(li)\nfor i in li:\n\tbuy=min(M,i[1])\n\tm_sum+=i[0]*buy\n\tM-=buy\nprint(m_sum)', 'N,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\tbuy=min(M,i[1])\n\tm_sum+=i[0]*buy\n\tM-=buy\nprint(m_sum)'] | ['Wrong Answer', 'Accepted'] | ['s410315389', 's576382095'] | [34640.0, 29796.0] | [558.0, 453.0] | [205, 195] |
p03103 | u037074041 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ["from sys import stdin\n\n\ndef a(input_string):\n N, M = [int(x) for x in input_string[0].split()]\n C = input_string[1:]\n temp = [string.split() for string in C]\n D = []\n for i in range(len(temp)):\n D.append([int(word) for word in temp[i]])\n #print(D)\n get_count = 0\n min_cost = 10000000000000000\n cost = 0\n D = sorted(D, key=lambda x: x[0])\n for i in range(N):\n get_count += 1\n cost += D[i][0]\n if get_count >= M:\n if cost < min_cost:\n min_cost = cost\n return min_cost\n\n\ndef main():\n input_line = stdin.readlines()\n answer = a(input_line)\n print(answer)\n\n\nif __name__ == '__main__':\n main()\n", "from sys import stdin\n\n\ndef a(input_string):\n N, M = [int(x) for x in input_string[0].split()]\n C = input_string[1:]\n temp = [string.split() for string in C]\n D = []\n for i in range(len(temp)):\n D.append([int(word) for word in temp[i]])\n #print(D)\n get_count = 0\n min_cost = 10000000000000000\n cost = 0\n D = sorted(D, key=lambda x: x[0])\n for i in range(N):\n for j in range(D[i][1]):\n get_count += 1\n cost += D[i][0]\n if get_count >= M:\n return cost\n return cost\n\n\ndef main():\n input_line = stdin.readlines()\n answer = a(input_line)\n print(answer)\n\n\nif __name__ == '__main__':\n main()\n"] | ['Wrong Answer', 'Accepted'] | ['s599584908', 's726194279'] | [62044.0, 62044.0] | [293.0, 302.0] | [690, 695] |
p03103 | u046432236 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ["import random\n\ndef quick_sort(array):\n low_array = []\n high_array = []\n if len(array) <= 1:\n return array\n pivot = random.choice(array)[0]\n pivot_count = 0\n for a in range(len(array)):\n if pivot > array[a][0]:\n low_array.append(array[a])\n elif pivot < array[a][0]:\n high_array.append(array[a])\n else:\n pivot_count += 1\n print(pivot, low_array, high_array, pivot_count)\n low_array = quick_sort(low_array)\n high_array = quick_sort(high_array)\n return low_array + [pivot, ] * pivot_count + high_array\n \n\ndef main():\n list1=input().split(' ')\n n=int(list1[0])\n m=int(list1[1])\n biglist=[]\n for i in range(n):\n list=input().split(' ')\n biglist.append([int(list[0]), int(list[1])])\n #array = [3, 4, 2, 6, 8, 1, 7]\n array=[[5,1], [2,3], [3,4], [7,2], [6,6]]\n #new_array=quick_sort(array)\n #print(new_array)\n newlist=sorted(biglist)\n \n #print(newlist, m, n)\n money=0\n jun=0\n while m>0:\n if newlist[jun][1]>=m:\n money+=m*newlist[jun][0]\n print(money)\n return\n else:\n money+=newlist[jun][0]*newlist[jun][1]\n #print(money)\n m-=newlist[jun][1]\n jun+=1\n \n", "import random\n \ndef quick_sort(array):\n low_array = []\n high_array = []\n if len(array) <= 1:\n return array\n pivot = random.choice(array)[0]\n pivot_count = 0\n for a in range(len(array)):\n if pivot > array[a][0]:\n low_array.append(array[a])\n elif pivot < array[a][0]:\n high_array.append(array[a])\n else:\n pivot_count += 1\n print(pivot, low_array, high_array, pivot_count)\n low_array = quick_sort(low_array)\n high_array = quick_sort(high_array)\n return low_array + [pivot, ] * pivot_count + high_array\n \n \ndef main():\n list1=input().split(' ')\n n=int(list1[0])\n m=int(list1[1])\n biglist=[]\n for i in range(n):\n list=input().split(' ')\n biglist.append([int(list[0]), int(list[1])])\n #array = [3, 4, 2, 6, 8, 1, 7]\n array=[[5,1], [2,3], [3,4], [7,2], [6,6]]\n #new_array=quick_sort(array)\n #print(new_array)\n newlist=sorted(biglist)\n \n #print(newlist, m, n)\n money=0\n jun=0\n while m>0:\n if newlist[jun][1]>=m:\n money+=m*newlist[jun][0]\n print(money)\n return\n else:\n money+=newlist[jun][0]*newlist[jun][1]\n #print(money)\n m-=newlist[jun][1]\n jun+=1\n\nmain()"] | ['Wrong Answer', 'Accepted'] | ['s961091302', 's314491759'] | [5224.0, 21292.0] | [43.0, 424.0] | [1338, 1342] |
p03103 | u047023156 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['from collections import deque\nN, M = map(int, input().split())\n\nA = [0]*N\nB = [0]*N\nfor i in range(N):\n A[i], B[i] = map(int, input().split())\n\nC = deque()\n\nwhile len(C) < M:\n for j in range(B[A.index(min(A))]):\n C.append(min(A))\n A.remove(min(A))\n\nC = sorted(C)\nprint(C)\nprint(sum(C[:M]))', 'import sys\nfrom collections import deque\nfrom operator import itemgetter\ninput = sys.stdin.readline\nN, M = map(int, input().split())\n\nA = deque()\nfor i in range(N):\n A.append(list(map(int, input().split())))\n\nA = sorted(A, key=itemgetter(0))\n\nm=0\ncost=0\n\nfor i in range(N):\n if m >= M:\n break\n buy = min(M - m, A[i][1])\n cost += A[i][0] * buy\n m += buy\n\nprint(cost)'] | ['Wrong Answer', 'Accepted'] | ['s858781649', 's939117650'] | [13296.0, 30224.0] | [2104.0, 324.0] | [305, 387] |
p03103 | u057109575 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N, M = map(int, input())\nX = [list(map(int, input().split())) for _ in range(N)]\n\nans = 0\nres = M\nfor v in X:\n ans += v[0] * min(v[1], res)\n res -= v[1]\n if res <= 0:\n break\n \nprint(res)', 'N, M = map(int, input().split())\nX = [list(map(int, input().split())) for _ in range(N)]\nX.sort()\n\nans = 0\nres = M\nfor v in X:\n ans += v[0] * min(v[1], res)\n res -= v[1]\n if res <= 0:\n break\n \nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s759562214', 's996284831'] | [3060.0, 27756.0] | [17.0, 482.0] | [209, 227] |
p03103 | u058861899 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['num_drink=0\nprice=0\na.sort()\nfor i in a:\n\n if num_drink+i[1]<m:\n \n num_drink+=i[1]\n price+=i[1]*i[0]\n\n else:\n price+=(m-num_drink)*i[0]\n\n break\n \nprint(price)', 'n,m=map(int,input().split())\na=[]\nfor i in range(n):\n a.append(list(map(int,input().split())))\n\nnum_drink=0\nprice=0\na.sort()\nfor i in a:\n\n if num_drink+i[1]<m:\n \n num_drink+=i[1]\n price+=i[1]*i[0]\n\n else:\n price+=(m-num_drink)*i[0]\n\n break\n \nprint(price)'] | ['Runtime Error', 'Accepted'] | ['s315845330', 's352985540'] | [2940.0, 27760.0] | [17.0, 501.0] | [202, 301] |
p03103 | u059210959 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['# encoding:utf-8\nimport copy\nimport numpy as np\nimport random\n\nn,m = map(int,input().split())\n\nshops = []\nfor i in range(n):\n a,b = map(int,input().split())\n shops.append([a,b])\n\n\n\n# dp[i][j]\n\n# dp = [[10**10 for i in range(m)] for j in range(n)]\n\nshops.sort()\nans = 0\ncount = m\n# print(shops)\ni = 0\nwhile True:\n print(count,ans)\n yen,num = shops[i]\n if count-num > 0:\n count -= num\n ans += yen*num\n # print(ans)\n i += 1\n else:\n ans += yen*count\n # print(ans)\n count -= count\n break\n\n\nprint(ans)\n', '# encoding:utf-8\nimport copy\nimport numpy as np\nimport random\n\nn,m = map(int,input().split())\n\nshops = []\nfor i in range(n):\n a,b = map(int,input().split())\n shops.append([a,b])\n\n\n\n# dp[i][j]\n\n# dp = [[10**10 for i in range(m)] for j in range(n)]\n\nshops.sort()\nans = 0\ncount = m\n# print(shops)\ni = 0\nwhile True:\n # print(count,ans)\n yen,num = shops[i]\n if count-num > 0:\n count -= num\n ans += yen*num\n # print(ans)\n i += 1\n else:\n ans += yen*count\n # print(ans)\n count -= count\n break\n\n\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s315911204', 's444473962'] | [30284.0, 29796.0] | [709.0, 604.0] | [630, 632] |
p03103 | u063073794 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['yandy\nN, M = list(map(int, input().split()))\ndata = [list(map(int, input().split())) for _ in range(N)]\n\ndata.sort()\n\nprice = 0\nfor d in data:\n price += d[0] * min(M, d[1])\n M -= d[1]\n if M <= 0:\n break\nprint(price)\n', 'satoooh\n, M = map(int, input().split())\nA, B = [0] * N, [0] * N\nfor i in range(N):\n\tA[i], B[i] = map(int, input().split())\n\n\nC = sorted(zip(A, B))\nA, B = zip(*C)\n\nans, cnt, i = 0, 0, 0\nwhile cnt < M:\n\ttmp = min(B[i], M - cnt)\n\tcnt += tmp\n\tans += A[i] * tmp\n\ti += 1\nprint(ans)\n', 'N, M = list(map(int, input().split()))\ndata = [list(map(int, input().split())) for _ in range(N)]\ndata.sort()\n\nhonsu=0\ncost=0\nfor i in range(N):\n honsu+=data[i][1]\n cost+=data[i][0]*data[i][1]\n \n if honsu>M:\n cost=cost-((honsu-M)*data[i][0])\n print(cost)\n exit()\nprint(cost)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s215117040', 's349236261', 's128815510'] | [3060.0, 2940.0, 27880.0] | [17.0, 17.0, 494.0] | [232, 307, 286] |
p03103 | u064434060 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['#python 2.7\nn,m=map(int,input().split())\nab=[list(map(int,input().split()))]\nab=sorted(ab,key=lambda x:x[0])\nres=ans=0\nfor i in range(n):\n if res+ab[i][1]>=m:\n ans+=(ab[i][0])*(m-res)\n break\n else:\n ans+=(ab[i][0])*ab[i][1]\n res+=ab[i][1]\nprint(ans)', '#python 2.7\nn,m=map(int,input().split())\nab=[list(map(int,input().split())) for i in range(n)]\nab=sorted(ab,key=lambda x:x[0])\nres=ans=0\nfor i in range(n):\n if res+ab[i][1]>=m:\n ans+=(ab[i][0])*(m-res)\n break\n else:\n ans+=(ab[i][0])*ab[i][1]\n res+=ab[i][1]\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s898705597', 's165795501'] | [9212.0, 29164.0] | [27.0, 325.0] | [263, 281] |
p03103 | u067694718 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n, m = [int(i) for i in input().split()]\nab = [[int(i) for i in input().split()] for j in range(n)]\nab = sorted(ab, key=lambda x:x[0])\n\nsm = 0\ni = 0\nfor i in ab:\n if m > i[1]:\n sm += i[0] * i[1]\n m -= i[1]\n else:\n sm += i[0] * m\n break\nprint(ab)', 'n, m = [int(i) for i in input().split()]\nab = [[int(i) for i in input().split()] for j in range(n)]\nab = sorted(ab, key=lambda x:x[0])\n\nsm = 0\ni = 0\nfor i in ab:\n if m > i[1]:\n sm += i[0] * i[1]\n m -= i[1]\n else:\n sm += i[0] * m\n break\nprint(sm)'] | ['Wrong Answer', 'Accepted'] | ['s015051341', 's368312168'] | [28496.0, 23524.0] | [495.0, 429.0] | [279, 279] |
p03103 | u069602573 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['import numpy as np\n\nN, M = map(int, input().split()) \n\nA = [[0, 0]] * N\nfor i in range(N):\n A[i] = list(map(int, input().split())) \n\nA = np.array(A, dtype=np.float64)\nA = A[np.argsort(A[:, 0])]\n\nans = 0\nfor i in range(N):\n if M >= A[i][1]:\n M -= A[i][1]\n ans += A[i][0] * A[i][1]\n print(M)\n else:\n ans += A[i][0] * M\n break\n\nprint(int(ans))\n', 'import numpy as np\n\nN, M = map(int, input().split()) \n\nA = [[0, 0]] * N\nfor i in range(N):\n A[i] = list(map(int, input().split())) \n\nA = np.array(A, dtype=np.float64)\nA = A[np.argsort(A[:, 0])]\n\nans = 0\nfor i in range(N):\n if M >= A[i][1]:\n M -= A[i][1]\n ans += A[i][0] * A[i][1]\n else:\n ans += A[i][0] * M\n break\n\nprint(int(ans))\n'] | ['Wrong Answer', 'Accepted'] | ['s009900597', 's437884305'] | [37864.0, 37900.0] | [1046.0, 783.0] | [427, 410] |
p03103 | u070449185 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N,M = map(int,input().split())\nA,B = [],[]\nfor i in range(N):\n A_next, B_next = map(int,input().split())\n A.append(A_next),B.append(B_next)\nshop = list(zip(A,B))\nshop.sort(key=lambda x:x[0])\ndef count(i,M):\n if(M==0):\n return 0\n elif(shop[i][1]<=M):\n return count(i+1,M-shop[i][1])+shop[i][0]*shop[i][1]\n else:\n return M*shop[i][0]\ncount(0,M)', 'N,M = map(int,input().split())\nA,B = [],[]\nfor i in range(N):\n A_next, B_next = map(int,input().split())\n A.append(A_next),B.append(B_next)\nshop = list(zip(A,B))\nshop.sort(key=lambda x:x[0])\ndef count(i,M):\n if(M==0):\n return 0\n elif(shop[i][1]<=M):\n return count(i+1,M-shop[i][1])+shop[i][0]*shop[i][1]\n else:\n return M*shop[i][0]\ncount(0,M)', 'N,M = map(int, input().split())\nA,B = [],[]\nfor i in range(N):\n A_next, B_next = map(int,input().split())\n A.append(A_next)\n B.append(B_next)\nl = sorted(list(zip(A,B)), key=lambda x:x[0])\ncount = 0\nvalue = 0\ni = 0\nwhile(count<M):\n if(M-count<l[i][1]):\n value = value + l[i][0]*(M-count)\n break\n else:\n value = value + l[i][0]*l[i][1]\n count = count + l[i][1]\n i = i + 1\nprint(value)'] | ['Runtime Error', 'Runtime Error', 'Accepted'] | ['s548011298', 's702058168', 's981278764'] | [19660.0, 19788.0, 20480.0] | [442.0, 443.0, 433.0] | [378, 378, 432] |
p03103 | u078116888 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['ii = lambda: int(input())\nmi = lambda: map(int, input().split())\nli = lambda: list(mi())\n\nn, m = mi()\na = [li() for i in range(n)]\na.sort(reverse=True)\nrem = m\nsm = 0\nwhile a:\n rate, cnt = a.pop()\n take = min(rem, cnt)\n sm += take * rate\n rem -= take\nprint(sm)\n=', 'ii = lambda: int(input())\nmi = lambda: map(int, input().split())\nli = lambda: list(mi())\n\nn, m = mi()\na = [li() for i in range(n)]\na.sort(reverse=True)\nrem = m\nsm = 0\nwhile a:\n rate, cnt = a.pop()\n take = min(rem, cnt)\n sm += take * rate\n rem -= take\nprint(sm)'] | ['Runtime Error', 'Accepted'] | ['s559089153', 's938321730'] | [3060.0, 27772.0] | [17.0, 533.0] | [274, 272] |
p03103 | u081688405 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N, M = map(int, input().split(" "))\nstores = []\n\nfor i in range(N):\n Ai, Bi = map(int, input().split(" "))\n stores.append((Ai, Bi)) \n\nprice = 0\nfor a, b in stores:\n if M <= b:\n price += a * M\n break\n else:\n price += a * b\n M -= b\nprint(price)\n', 'N, M = map(int, input().split(" "))\nstores = []\nfor i in range(N):\n Ai, Bi = map(int, input().split(" "))\n tg_idx = -1\n for idx, s in enumerate(stores):\n if s[0] > Ai:\n tg_idx = idx\n break\n if tg_idx != -1:\n stores.insert(tg_idx, (Ai, Bi))\n else:\n stores.append((Ai, Bi))\n\n stock = 0\n unuse_idx = 0\n for idx, s in enumerate(stores):\n if stock <= M:\n stock += s[1]\n else:\n unuse_idx = idx\n if unuse_idx != -1:\n stores = stores[:unuse_idx]\n\nprice = 0\nfor store in stores:\n if M <= store[1]:\n price += store[0] * M\n break\n else:\n price += store[0] * store[1]\n M -= store[1]\nprint(price)\n', 'N, M = map(int, input().split(" "))\nstores = []\nfor i in range(N):\n Ai, Bi = map(int, input().split(" "))\n tg_idx = -1\n for idx, s in enumerate(stores):\n if s[0] > Ai:\n tg_idx = idx\n break\n if tg_idx != -1:\n stores.insert(tg_idx, (Ai, Bi))\n else:\n stores.append((Ai, Bi))\n\n stock = 0\n unuse_idx = 0\n for idx, s in enumerate(stores):\n if stock <= M:\n stock += s[1]\n else:\n unuse_idx = idx\n if unuse_idx != -1:\n stores = stores[:unuse_idx]\n\nprice = 0\nfor store in stores:\n if M <= store[1]:\n price += store[0] * M\n break\n else:\n price += store[0] * store[1]\n M -= store[1]\nprint(price)\n', 'N, M = map(int, input().split(" "))\nstores = dict()\np = 10000000000\n\nfor i in range(N):\n if p==1 and stores[p] >= M:\n break\n Ai, Bi = map(int, input().split(" "))\n if Ai in stores:\n stores[Ai] += Bi\n else:\n stores[Ai] = Bi\n p = min(p, Ai)\n\n\nprice = 0\nfor i, c in sorted(stores, key=lambda x: x[0]):\n if M <= c:\n price += i * M\n break\n else:\n price += i * c\n M -= c\n\nprint(price)\n', 'N, M = map(int, input().split(" "))\nstores = []\nprice = 0\nfor i in range(N):\n Ai, Bi = map(int, input().split(" "))\n stock = 0\n unuse = False\n tg_idx = -1\n price = 0\n for idx, s in enumerate(stores):\n if s[0] > Ai and tg_idx == -1:\n tg_idx = idx\n price += Ai*(Bi if M - stock > Bi else M - stock)\n stock += s[1] \n if stock <= M:\n price += s[0]*(s[1] if M - stock > s[1] else M - stock)\n stock += s[1]\n else:\n unuse = True\n \n if tg_idx != -1:\n stores.insert(tg_idx, (Ai, Bi))\n else:\n stores.append((Ai, Bi))\n if unuse:\n stores = stores[:-1]\n\nprint(price)\n', 'N, M = map(int, input().split(" "))\nstores = []\ncan_buy = False\nfor i in range(N):\n Ai, Bi = map(int, input().split(" "))\n print(Ai, Bi)\n if can_buy and Ai > stores[-1][0]:\n continue\n stock = 0\n last_idx = -1\n tg_idx = -1\n for idx, s in enumerate(stores):\n if s[0] > Ai and tg_idx == -1:\n stock += Bi\n tg_idx = idx\n if stock < M:\n stock += s[1]\n else:\n last_idx = idx\n can_buy = True\n break\n if tg_idx != -1:\n stores.insert(tg_idx, (Ai, Bi))\n else:\n stores.append((Ai, Bi))\n if last_idx != -1:\n stores = stores[:last_idx+1]\n\nprice = 0\nfor store in stores:\n if M <= store[1]:\n price += store[0] * M\n break\n else:\n price += store[0] * store[1]\n M -= store[1]\nprint(price)\n', 'N, M = map(int, input().split(" "))\nstores = []\n\nfor i in range(N):\n Ai, Bi = map(int, input().split(" "))\n stores.append((Ai, Bi)) \n\nprice = 0\nfor a, b in sorted(stores, key=lambda x: x[0]):\n if M <= b:\n price += a * M\n break\n else:\n price += a * b\n M -= b\nprint(price)\n'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s028846453', 's425612393', 's448835051', 's575907052', 's827971610', 's878228778', 's347757773'] | [16584.0, 3064.0, 3064.0, 17892.0, 3308.0, 4852.0, 18948.0] | [329.0, 440.0, 433.0, 362.0, 2103.0, 2104.0, 377.0] | [286, 731, 731, 447, 695, 849, 314] |
p03103 | u086503932 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N, M = map(int, input().split())\nA = [0 for i in range(N)]\nB = [0 for i in range(N)]\n\nfor i in range(N):\n a,b = map(int, input().split())\n A[i] = a\n B[i] = b\n\nans = 0\ncount = 0\nwhile(count < M):\n min_A = min(A)\n min_Ai = A.index(min_A)\n B_min = B[min_Ai]\n if count + B_min >= M:\n print(ans + min_A * (M - count))\n break\n else:\n ans += min_A * B_min\n count += B_min\n A.remove(min_A)\n B.remove(min_A)\n', 'import numpy as np\nN, M = map(int, input().split())\nA = np.zeros(N)\nB = np.zeros(N)\n\nfor i in range(N):\n a,b = map(int, input().split())\n A[i] = a\n B[i] = b\n\nans = 0\ncount = 0\nwhile(count < M):\n min_A = np.min(A)\n min_Ai = np.argmin(A)\n B_min = B[min_Ai]\n if count + B_min > M:\n ans += min_A * (M - count)\n count = M\n else:\n ans += min_A * B_min\n count += B_min\n np.delete(A, min_Ai)\n np.delete(B, min_Ai)\n\nprint(ans)\n', 'def unzip(li):\n return map(list, zip(*li))\n\nN, M = map(int, input().split())\ntmp_C = [0 for i in range(N)]\n\nfor i in range(N):\n a,b = map(int, input().split())\n tmp_C[i] = (a,b)\n \nC = sorted(tmp_C)\nA, B = unzip(C)\nans = 0\ncount = 0\ncur = 0\nwhile(count < M):\n min_A = A[cur]\n B_min = B[cur]\n if count + B_min >= M:\n print(ans + min_A * (M - count))\n break\n else:\n ans += min_A * B_min\n count += B_min\n cur += 1'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s198103982', 's646600092', 's890266508'] | [11036.0, 16816.0, 26096.0] | [2104.0, 2108.0, 501.0] | [425, 440, 432] |
p03103 | u095756391 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N, M = map(int, input().split())\n\nshop = []\n\nans = 0\n\nnum = 0\n\nfor i in range(N):\n shop.append(list(map(int, input().split())))\n \nshop = sorted(shop)\n\nprint(shop)\n \nfor i in range(N):\n for b in range(shop[i][1]):\n if (num == M):\n break\n num += 1\n ans += shop[i][0]\n \nprint(ans)', 'N, M = map(int, input().split())\n\nshop = []\n\nans = 0\n\nnum = 0\n\nfor i in range(N):\n shop.append(list(map(int, input().split())))\n \nsorted(shop)\n \nfor i in range(N):\n for b in range(shop[i][1]):\n if (num == M):\n break\n num += shop[i][1]\n ans += shop[i][0]\n \nprint(ans)', 'N, M = map(int, input().split())\n\nshop = []\n\nans = 0\n\nnum = 0\n\nfor i in range(N):\n shop.append(list(map(int, input().split())))\n \nshop = sorted(shop)\n \nfor i in range(N):\n for b in range(shop[i][1]):\n if (num == M):\n break\n num += shop[i][1]\n ans += shop[i][0]\n \nprint(ans)', 'N, M = map(int, input().split())\n\nshop = []\n\nans = 0\n\nnum = 0\n\nfor i in range(N):\n shop.append(list(map(int, input().split())))\n \nshop = sorted(shop)\n \nfor i in range(N):\n for b in range(shop[i][1]):\n if (num == M):\n break\n num += shop[i][1]\n ans += shop[i][0]\n \nprint(ans)', 'N, M = map(int, input().split())\n\nshop = []\n\nans = 0\n\nnum = 0\n\nfor i in range(N):\n shop.append(list(map(int, input().split())))\n \nshop = sorted(shop)\n \nfor i in range(N):\n for b in range(shop[i][1]):\n if (num == M):\n break\n num += shop[i][1]\n ans += shop[i][0]\n \nprint(ans)', 'N, M = map(int, input().split())\n\nshop = []\n\nans = 0\n\nnum = 0\n\nfor i in range(N):\n shop.append(list(map(int, input().split())))\n \nshop = sorted(shop)\n\nprint(shop)\n \nfor i in range(N):\n for b in range(shop[i][1]):\n if (num == M):\n break\n num += shop[i][1]\n ans += shop[i][0]\n \nprint(ans)', 'N, M = map(int, input().split())\n\nshop = []\n\nans = 0\n\nnum = 0\n\nfor i in range(N):\n shop.append(list(map(int, input().split())))\n \nshop = sorted(shop)\n \nfor i in range(N):\n for b in range(shop[i][1]):\n if (num == M):\n break\n num += 1\n ans += shop[i][0]\n \nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s303952815', 's376264403', 's546504812', 's606227701', 's749551153', 's788443627', 's953948844'] | [34656.0, 28656.0, 28656.0, 28656.0, 28656.0, 34656.0, 28656.0] | [618.0, 2105.0, 2105.0, 2105.0, 2105.0, 2105.0, 603.0] | [298, 287, 294, 294, 294, 307, 285] |
p03103 | u102278909 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['# coding: utf-8\n\nimport sys\ninput = sys.stdin.readline\n\nN, M = map(int, input().split())\n\nAB = [list(map(int, input().split())) for __ in range(N)]\nAB.sort(key=lambda x : x[0])\n\nfor k in AB:\n if M > k[1]:\n M -= k[1]\n ans += k[0] * k[1]\n else:\n ans += k[0] * M\n break\n\nprint(ans)\n\n', '# coding: utf-8\n\nimport sys\ninput = sys.stdin.readline\n\nN, M = map(int, input().split())\n\nAB = [list(map(int, input().split())) for __ in range(N)]\nAB.sort(key=lambda x : x[0])\n\nans = 0\nfor k in AB:\n if M > k[1]:\n M -= k[1]\n ans += k[0] * k[1]\n else:\n ans += k[0] * M\n break\n\nprint(ans)\n\n'] | ['Runtime Error', 'Accepted'] | ['s111424084', 's794416433'] | [28940.0, 28940.0] | [236.0, 272.0] | [314, 322] |
p03103 | u102461423 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['import numpy as np\n\nN,M = map(int,input().split())\nAB = [[int(x) for x in input().split()] for _ in range(N)]\n\nAB.sort()\n\ncnt = 0\nyen = 0\n\nfor a,b in AB:\n print(cnt,yen)\n if cnt + b <= M:\n cnt += b\n yen += a * b\n continue\n yen += a * (M - cnt)\n break\n\nanswer = yen\nprint(answer)', 'import numpy as np\n\nN,M = map(int,input().split())\nAB = [[int(x) for x in input().split()] for _ in range(N)]\n\nAB.sort()\n\ncnt = 0\nyen = 0\n\nfor a,b in AB:\n if cnt + b <= M:\n cnt += b\n yen += a * b\n continue\n yen += a * (M - cnt)\n break\n\nanswer = yen\nprint(answer)'] | ['Wrong Answer', 'Accepted'] | ['s313816527', 's886866022'] | [30640.0, 30636.0] | [700.0, 574.0] | [291, 274] |
p03103 | u103902792 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m = map(int,input().split())\ndrink=[]\nfor _ in range(n):\n a,b = map(int,input().split())\n drink.append(a,b)\ndrink.sort(reverse=1)\n\nans = 0\nwhile m<0:\n a,b = drink.pop(-1)\n ans += a*min(m, b)\n m -= b\nprint(ans)', 'n,m = map(int,input().split())\ndrink=[]\nfor _ in range(n):\n a,b = map(int,input().split())\n drink.append((a,b))\ndrink.sort(reverse=1)\n\nans = 0\nwhile m<0:\n a,b = drink.pop(-1)\n ans += a*min(m, b)\n m -= b\nprint(ans)\n\n', 'n,m = map(int,input().split())\ndrink=[]\nfor _ in range(n):\n a,b = map(int,input().split())\n drink.append((a,b))\ndrink.sort(reverse=1)\n\nans = 0\nwhile m>0:\n a,b = drink.pop(-1)\n ans += a*min(m, b)\n m -= b\nprint(ans)\n\n'] | ['Runtime Error', 'Wrong Answer', 'Accepted'] | ['s837737575', 's914729601', 's297145608'] | [3064.0, 16892.0, 16908.0] | [18.0, 394.0, 434.0] | [216, 220, 220] |
p03103 | u106778233 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m=map(int,input().split())\nAB=[]\nfor i in range(n):\n a,b=map(int,input().split())\n AB.append((b,a))\n\nAB.sort()\n\ncnt=0\nans=0\nfor b,a in AB:\n if cnt==k:\n print(ans)\n break\n temp=min(k-cnt,a)\n ans+=b*temp\n cnt+=temp', '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\nAB.sort()\n\ncnt=0\nans=0\nfor a,b in AB:\n if cnt==m:\n print(ans)\n break\n temp=min(m-cnt,b)\n ans+=a*temp\n cnt+=temp', 'n,m=map(int,input().split())\nAB=[]\nfor i in range(n):\n a,b=map(int,input().split())\n AB.append((b,a))\n\nAB.sort()\n\ncnt=0\nans=0\nfor b,a in AB:\n if cnt==m:\n print(ans)\n break\n temp=min(m-cnt,a)\n ans+=b*temp\n cnt+=temp', '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\nAB.sort()\n\ncnt=0\nans=0\nfor a,b in AB:\n\n temp=min(m-cnt,b)\n ans+=a*temp\n cnt+=temp\n if cnt==m:\n print(ans)\n break'] | ['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s475192563', 's637151314', 's955142378', 's654371100'] | [16912.0, 16892.0, 16912.0, 16908.0] | [398.0, 453.0, 387.0, 466.0] | [246, 246, 246, 247] |
p03103 | u107091170 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N,M=map(int, input().split())\nAB=[ [] for _ in range(N)]\nfor i in range(N):\n AB[i] = list( map(int, input().split()))\nAB.sort()\nprint(AB)\ncnt = ans = 0\nfor i in range(N):\n buy = AB[i][1]\n if cnt + AB[i][1] >= M:\n buy = M - cnt\n cnt += buy\n ans += buy * AB[i][0]\n print(buy,cnt,ans)\n if cnt >= M:\n break\nprint(ans)\n', 'N,M=map(int, input().split())\nAB=[ [] for _ in range(N)]\nfor i in range(N):\n AB[i] = list( map(int, input().split()))\nAB.sort()\n\ncnt = ans = 0\nfor i in range(N):\n buy = AB[i][1]\n if cnt + AB[i][1] >= M:\n buy = M - cnt\n cnt += buy\n ans += buy * AB[i][0]\n# print(buy,cnt,ans)\n if cnt >= M:\n break\nprint(ans)\n\n'] | ['Wrong Answer', 'Accepted'] | ['s470414097', 's387486871'] | [33836.0, 27880.0] | [731.0, 563.0] | [327, 330] |
p03103 | u112247039 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m=map(int,input().split())\nab=sorted([list(map(int,input().split())) for i in range(n)])\nshop,cost,rest=m,0,0\nwhile True:\n if ab[shop][1]<rest:\n cost+=ab[shop][1]*ab[shop][0]\n rest-=ab[shop][1]\n shop+=1\n else:\n cost+=ab[shop][0]*rest\n break\nprint(cost)', 'n,m = map(int,input().split())\nab = sorted([list(map(int,input().split())) for i in range(n)])\nshop,cost,rest=0,0,m\nwhile True:\n if ab[shop][1]<rest:\n cost += ab[shop][1]*ab[shop][0]\n rest -= ab[shop][1]\n shop+=1\n else:\n cost+=ab[shop][0]*rest\n break\nprint(cost)'] | ['Runtime Error', 'Accepted'] | ['s036427384', 's547809081'] | [28160.0, 28452.0] | [335.0, 374.0] | [295, 303] |
p03103 | u112766430 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N,m = list(map(int,input().split()))\ndata = {}\nfor i in range(N):\n\ta,b = list(map(int,input().split()))\n\tdata[a] = b\nsortedData = sorted(data.items())\ncost = 0\nfor i in range(N):\n\tprices = sortedData[i][0]\n\tnums = sortedData[i][1]\n\tif m > nums:\n\t\tcost += price * nums\n\t\tm -= nums\n\telse:\n\t\tcost += prices * m\n\t\tprint(cost)\n\t\tbreak', 'N,m = list(map(int,input().split()))\ndata = [[0,0] for i in range(N)]\nfor i in range(N):\n\tdata[i] = list(map(int,input().split()))\ndata.sort()\ncost = 0\nfor i in range(N):\n\tprices,nums = data[i]\n\tif m > nums:\n\t\tcost += prices * nums\n\t\tm -= nums\n\telse:\n\t\tcost += prices * m\n\t\tprint(cost)\n\t\tbreak'] | ['Runtime Error', 'Accepted'] | ['s808444843', 's567948784'] | [23024.0, 27820.0] | [452.0, 527.0] | [329, 293] |
p03103 | u120691615 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N,m = map(int,input().split())\nA = []\nB = []\nfor i in range(N):\n a,b = map(int,input().split())\n A.append([a,b])\n\nA = sorted(A)\nprint(A)\nmoney = 0\nfor n in range(N):\n if m > A[n][1]:\n m -= A[n][1]\n money += A[n][1] * A[n][0]\n elif m <= A[n][1]:\n money += m * A[n][0]\n break\n\nprint(money)\n', 'N,m = map(int,input().split())\nA = []\nB = []\nfor i in range(N):\n a,b = map(int,input().split())\n A.append([a,b])\n\nA = sorted(A)\nmoney = 0\nfor n in range(N):\n if m > A[n][1]:\n m -= A[n][1]\n money += A[n][1] * A[n][0]\n elif m <= A[n][1]:\n money += m * A[n][0]\n break\n\nprint(money)\n'] | ['Wrong Answer', 'Accepted'] | ['s506588221', 's844467299'] | [26936.0, 20840.0] | [515.0, 493.0] | [328, 319] |
p03103 | u121732701 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['# -*- coding: utf-8 -*-\n"""\nCreated on Sat Mar 9 21:40:34 2019\n\n@author: iwata\n"""\n\nN,M = map(int, input().split())\nnumlist =[]\nnum = 0\n\nfor i in range(N):\n A,B = map(int, input().split())\n for j in range(B):\n numlist.append(A)\n\nnumlist.sort()\n\n\nsum(numlist[:M])\n \nprint(num)\n ', '# -*- coding: utf-8 -*-\n"""\nCreated on Sat Mar 9 21:40:34 2019\n\n@author: iwata\n"""\n\nN,M = map(int, input().split())\nnumlist =[]\nmoney = 0\ncount = 0\ncount1 = 0\ncount2 = 0\n\nfor i in range(N):\n AB = list(map(int, input().split()))\n numlist.append(AB)\n\nnumlist.sort()\n\nwhile count <= M:\n while numlist[count1][1] <= count2:\n money = money + numlist[count1][0]\n count = count + 1\n count2 = count2 + 1\n if count == M:\n break\n count1 = count1 + 1\n count2 = 0\n \nprint(money)\n', '# -*- coding: utf-8 -*-\n"""\nCreated on Sat Mar 9 21:40:34 2019\n\n@author: iwata\n"""\n\nN,M = map(int, input().split())\nnumlist =[]\nmoney = 0\ncount = 0\ncount1 = 0\ncount2 = 0\n\nfor i in range(N):\n AB = list(map(int, input().split()))\n numlist.append(AB)\n\nnumlist.sort()\n\nwhile count < M:\n while numlist[count1][1] > count2:\n money = money + numlist[count1][0]\n count = count + 1\n count2 = count2 + 1\n if count == M:\n break\n count1 = count1 + 1\n count2 = 0\n \nprint(money)\n'] | ['Wrong Answer', 'Runtime Error', 'Accepted'] | ['s368680287', 's982797626', 's882379504'] | [166832.0, 27760.0, 27760.0] | [2112.0, 490.0, 514.0] | [297, 525, 523] |
p03103 | u121879791 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['import sys\ninput=sys.stdin.readline\nsys.setrecursionlimit(10**9)\nn,m=map(int,input().split())\nshop=[]\nfor i in range(n):\n shop.append(map(int,input().split()))\nshop_sorted=sorted(shop,key=lambda x :x[0])\nans=0\ncnt=0\nfor a,b in shop_sorted:\n tmp=cnt\n cnt=min(m,cnt+b)\n ans+=a*(cnt-tmp)\n if cnt==m:\n break\nprint(ans)', 'import sys\ninput=sys.stdin.readline\nsys.setrecursionlimit(10**9)\nn,m=map(int,input().split())\nAB=[list(map(int,input().split())) for _ in range(n)]\nAB=sorted(AB,key=lambda x:x[0])\ncnt=0\nans=0\nfor a,b in AB:\n tmp=cnt\n cnt=min(m,cnt+b)\n ans+=a*(cnt-tmp)\n if cnt==m:\n break\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s874100392', 's097474365'] | [50420.0, 29724.0] | [257.0, 330.0] | [336, 300] |
p03103 | u123318974 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ["import numpy as np\n\nN, M = map(int, input().split())\na = [input().split() for i in range(N)]\n\na = np.array(a, dtype='int64')\na = a[a[:, 0].argsort(), :]\nprint(a)\n\nmysum = 0\ncoin = 0\nfor c in a:\n if mysum + c[1] < M:\n mysum += c[1]\n coin += c[0] * c[1]\n else:\n d = M - mysum\n coin += d * c[0]\n break\n\nprint(coin)", "import numpy as np\n\nN, M = map(int, input().split())\na = [input().split() for i in range(N)]\n\na = np.array(a, dtype='int64')\na = a[a[:, 0].argsort(), :]\n\nmysum = 0\ncoin = 0\nfor c in a:\n if mysum + c[1] < M:\n mysum += c[1]\n coin += c[0] * c[1]\n else:\n d = M - mysum\n coin += d * c[0]\n break\n\nprint(coin)"] | ['Wrong Answer', 'Accepted'] | ['s010160827', 's802797561'] | [51452.0, 51408.0] | [619.0, 645.0] | [393, 384] |
p03103 | u123824541 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['# 2150 start\n\nimport numpy\n\nN,M=map(int, input().split())\nprice = numpy.empty((N,3))\nsumcan = 0\nsumprice = 0\nlastshop = 0\n\nfor i in range(N):\n shop_data = input().split()\n A = int(shop_data[0])\n B = int(shop_data[1])\n price[i,0]= A * B\n price[i,1] = A\n price[i,2] = B\n\nprice = price[price[:,1].argsort(),:]\n\nfor j in range(M):\n sumcan = sumcan + price[j,2]\n if sumcan < M:\n sumprice = sumprice + price[j,0]\n elif sumcan >= M:\n sumcan = sumcan - price[j,2]\n lastshop = j\n break\n\nsumprice = sumprice + (M - sumcan)*price[lastshop,1]\n\nprint(sumprice)\n\n\n\n\n\n\n\n', 'import numpy as np\n\nN,M = map(int, input().spit())\n\nA = np.empty(N)\nB = np.empty(N)\n\nfor i in range(N):\n INPUT_AB = input()\n A[i] = int(INPUT_AB.split(" ")[0])\n B[i] = int(INPUT_AB.split(" ")[1])\n\nnum_drink = 0\ndrink_price = 0\n\nwhile num_drink < M:\n price = np.amin(A)\n store_index = np.argmin(A)\n num_drink += B[store_index]\n print(num_drink)\n if num_drink >= M:\n num_drink -= B[store_index]\n while num_drink < M:\n num_drink += 1\n drink_price += price\n \n else:\n drink_price += price * B[store_index]\n A = np.delete(A, store_index)\n B = np.delete(B, store_index)\n\nprint(drink_price)', 'numpy as np\n\nN,M = map(int, input().spit())\n\nA = np.empty(N)\nB = np.empty(N)\n\nfor i in range(N):\n INPUT_AB = input()\n A[i] = int(INPUT_AB.split(" ")[0])\n B[i] = int(INPUT_AB.split(" ")[1])\n\nnum_drink = 0\ndrink_price = 0\n\nwhile num_drink < M:\n price = np.amin(A)\n store_index = np.argmin(A)\n num_drink += B[store_index]\n print(num_drink)\n if num_drink >= M:\n num_drink -= B[store_index]\n while num_drink < M:\n num_drink += 1\n drink_price += price\n \n else:\n drink_price += price * B[store_index]\n A = np.delete(A, store_index)\n B = np.delete(B, store_index)\n\nprint(drink_price)', ' numpy as np\n\nINPUT_1 = input()\n\nN = int(INPUT_1.split(" ")[0])\nM = int(INPUT_1.split(" ")[1])\n\nA = np.empty(N)\nB = np.empty(N)\n\nfor i in range(N):\n INPUT_AB = input()\n A[i] = int(INPUT_AB.split(" ")[0])\n B[i] = int(INPUT_AB.split(" ")[1])\n\nnum_drink = 0\ndrink_price = 0import\n\nwhile num_drink < M:\n price = np.amin(A)\n store_index = np.argmin(A)\n num_drink += B[store_index]\n print(num_drink)\n if num_drink >= M:\n num_drink -= B[store_index]\n while num_drink < M:\n num_drink += 1\n drink_price += price\n \n else:\n drink_price += price * B[store_index]\n A = np.delete(A, store_index)\n B = np.delete(B, store_index)\n\nprint(drink_price)', ' numpy as np\n\nINPUT_1 = input()\n\nN = int(INPUT_1.split(" ")[0])\nM = int(INPUT_1.split(" ")[1])\n\nA = np.empty(N)\nB = np.empty(N)\n\nfor i in range(N):\n INPUT_AB = input()\n A[i] = int(INPUT_AB.split(" ")[0])\n B[i] = int(INPUT_AB.split(" ")[1])\n\nnum_drink = 0\ndrink_price = 0\n\nwhile num_drink < M:\n price = np.amin(A)\n store_index = np.argmin(A)\n num_drink += B[store_index]\n print(num_drink)\n if num_drink >= M:\n num_drink -= B[store_index]\n while num_drink < M:\n num_drink += 1\n drink_price += price\n \n else:\n drink_price += price * B[store_index]\n A = np.delete(A, store_index)\n B = np.delete(B, store_index)\n\nprint(drink_price)', 'import numpy as np\nN, M = map(int,input().split())\nS = np.empty((N,2))\nsum_buy = 0\nsum_money = 0\n\nfor i in range(N):\n A, B = map(int,input().split())\n S[i,0] = A\n S[i,1] = B\n\nS = S[S[:,0].argsort(),:]\n\nj = 0\n\nwhile True:\n if sum_buy + S[j,1] < M:\n sum_buy += S[j,1]\n sum_money += S[j,1] * S[j,0]\n j += 1\n else:\n break\n\nsum_money = sum_money + (M - sum_buy) * S[j,0]\n\nprint(int(sum_money))'] | ['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted'] | ['s130350492', 's327990044', 's464448474', 's614647211', 's941513380', 's842747876'] | [17928.0, 12508.0, 2940.0, 2940.0, 2940.0, 16344.0] | [677.0, 149.0, 17.0, 18.0, 17.0, 768.0] | [610, 673, 666, 723, 717, 431] |
p03103 | u129978636 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m=map(int,input().split())\na=[]\nb=[]\nans=0\nfor _ in range(n):\n c,d=map(int,input().split())\n a.append(c)\n b.append(d)\ne=sorted(a)\nfor i in range(n):\n m=m-b[a.index(e[i])]\n if(m=<0):\n ans+=e[i]*(b[a.index(e[i])]+m)\n break\n else:\n ans+=b[a.index(e[i])]*e[i]\nprint(ans)', 'n,m=map(int,input().split())\na=[]\nans=0\nfor i in range(n):\n a.append(list(map(int,input().split())))\na=sorted(a)\nfor i in range(n):\n m=m-a[i][1]\n if(m<=0):\n ans+=a[i][0]*(a[i][1]+m)\n break\n else:\n ans+=a[i][1]*a[i][0]\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s728086626', 's029520896'] | [2940.0, 28652.0] | [17.0, 527.0] | [307, 261] |
p03103 | u135116520 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N,M=map(int,input().split())\nA=[list(map(int,input().split())) for i in range(N)]\nA=sorted(A,key=lambda x:x[0])\ns=0 \nt=0 \nfor i in range(N):\n s+=A[i][1]\n if M>s:\n t+=A[i][0]*A[i][1]\n else:\n over=s-M\n t-=A[i][0]*over\nprint(t)', 'N,M=map(int,input().split())\nk=M\ns=0\nA=[list(map(int,input().split())) for i in range(N)]\nA=sorted(A,key=lambda x:x[0])\nfor i in range(N):\n while k>0:\n if k>A[i][1]:\n k=k-A[i][1]\n s+=A[i][0]*A[i][1]\n else:\n k=0\n s+=A[i][0]*k\nprint(s)\n ', 'N,M=map(int,input().split())\nk=M\ns=0\nA=[list(map(int,input().split())) for i in range(N)]\nA=sorted(A,key=lambda x:x[0])\nfor i in range(N):\nwhile k>0:\n for i in range(N):\n if k>A[i][1]:\n s+=A[i][0]*A[i][1]\n k=k-A[i][1]\n else:\n s+=A[i][0]*k\n k=0\nprint(s)', 'N,M=map(int,input().split())\nA=[list(map(int,input().split())) for i in range(N)]\nA=sorted(A,key=lambda x:x[0])\ncnt=0 \nans=0 \nfor i in range(N):\n cnt+=A[i][1]\n if cnt>=m:\n over=cnt-m\n ans+=over*A[i][0]\n cnt+=over\n else:\n ans+=A[i][0]*A[i][1]\nprint(ans)', 'N,M=map(int,input().split())\nA=[list(map(int,input().split())) for i in range(N)]\nA=sorted(A,key=lambda x:x[0])\ns=0 \nt=0 \nfor i in range(N):\n if M>s:\n s+=A[i][1]\n t+=A[i][0]*A[i][1]\n else:\n over=s-M\n t-=A[i-1][0]*over\nprint(t)', 'N,M=map(int,input().split())\nk=M\ns=0\nA=[list(map(int,input().split())) for i in range(N)]\nA=sorted(A,key=lambda x:x[0])\nfor i in range(N):\n while k>0:\n if k>A[i][1]:\n s+=A[i][0]*A[i][1]\n k=k-A[i][1]\n else:\n s+=A[i][0]*k\n k=0\nprint(s)\n ', 'N,M=map(int,input().split())\nk=M\ns=0\nA=[list(map(int,input().split())) for i in range(N)]\nA=sorted(A,key=lambda x:x[0])\nfor i in range(N):\n while k>0:\n if k>A[i][1]:\n s+=A[i][0]*A[i][1]\n k=k-A[i][1]\n else:\n s+=A[i][0]*k\n k=0\nprint(s)\n ', 'N,M=map(int,input().split())\nA=[list(map(int,input().split())) for i in range(N)]\nA=sorted(A,key=lambda x:x[0])\ns=0 \nt=0 \nfor i in range(N):\n s+=A[i][1]\n if M>s:\n t+=A[i][0]*A[i][1]\n else:\n over=s-M\n t+=A[i][0]*A[i][1]-A[i][0]*over\n break\nprint(t)'] | ['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s200989261', 's300974527', 's414642682', 's474400526', 's611345217', 's655642264', 's770848487', 's879200830'] | [29796.0, 29792.0, 2940.0, 29796.0, 29796.0, 29792.0, 29792.0, 29796.0] | [484.0, 452.0, 17.0, 420.0, 470.0, 449.0, 451.0, 451.0] | [250, 263, 279, 281, 254, 267, 263, 276] |
p03103 | u143322814 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N,M = map(int, input().split())\na = []\nb = []\nans = 0\n\nfor i in range(N):\n store = input().split()\n a.append(int(store[0]))\n b.append(int(store[1]))\n\nnokori = M\nfor i in range(M):\n if nokori > 1:\n index = a.index(min(a))\n if nokori - (b[index]) >= 0:\n ans += a[index] * b[index]\n nokori -= b[index]\n a.pop(index)\n b.pop(index)\n else:\n ans += a[index] * nokori\n break\n else:\n break\nprint(ans)', 'N,M = map(int, input().split())\nab = []\nans = 0\n\nfor i in range(N):\n ab.append(list(map(int, input().split())))\nab = sorted(ab)\nnokori = M\nfor i in ab:\n if nokori - i[1] >= 0:\n ans += i[0] * i[1]\n nokori -= i[1]\n else:\n ans += i[0] * nokori\n break\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s767969784', 's025899780'] | [11048.0, 28656.0] | [2104.0, 496.0] | [500, 296] |
p03103 | u145145077 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m=map(int,input().split())\nab=[list(map(int,input().split())) for i in range(n)]\n\nab_sorted = sorted(ab, key=lambda x:(x[0], -x[1]))\nprint(ab_sorted)\n\nnum = 0\namount_of_money = 0\nfor i in range(n):\n buy = min(ab_sorted[i][1], m-num)\n num += buy\n amount_of_money += ab_sorted[i][0] * buy\n \n if num >= m:\n print(amount_of_money)\n', 'n,m=map(int,input().split())\nab=[list(map(int,input().split())) for i in range(n)]\n\nab_sorted = sorted(ab, key=lambda x:(x[0], -x[1]))\n\nnum = 0\namount_of_money = 0\nfor i in range(n):\n buy = min(ab_sorted[i][1], m-num)\n num += buy\n amount_of_money += ab_sorted[i][0] * buy\n \n if num >= m:\n print(amount_of_money)\n exit(0)\n'] | ['Wrong Answer', 'Accepted'] | ['s736214835', 's628195042'] | [42116.0, 38712.0] | [472.0, 371.0] | [339, 334] |
p03103 | u146382803 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n, m = map(int,input().split())\na = [list(map(int,input().split())) for i in range(n)]\na = a.sort()\nans = 0\ni = 0\nwhile m > 0:\n if a[i][1] > 0:\n a[i][1] -= 1\n ans += a[i][0]\n m -= 1\n else:\n i += 1\nprint(ans)\n', 'n, m = map(int,input().split())\na = [list(map(int,input().split())) for i in range(n)]\na.sort()\nans = 0\ni = 0\nwhile m > 0:\n if a[i][1] > 0:\n a[i][1] -= 1\n ans += a[i][0]\n m -= 1\n else:\n i += 1\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s327973423', 's357545630'] | [27756.0, 27884.0] | [510.0, 511.0] | [222, 218] |
p03103 | u150641538 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['import numpy as np\n\nN,M = map(int,input().split())\nA = []\nfor i in range(N):\n A.append([int(x) for x in input().split()])\n\nAB = np.array(A)\n\nAB = AB[np.argsort(AB[:,0])]\n\nyen = 0\ncnt = 0\ni = 0\nwhile(1):\n cnt_ = cnt + AB[i,1]\n if(cnt_ >= M):\n yen += (M - cnt)*AB[i,0]\n break\n yen += AB[i,0]*AB[i,1]\n print(cnt_,yen)\n cnt = cnt_\n i += 1\n\n\nprint(yen)', 'import numpy as np\n\nN,M = map(int,input().split())\nA = []\nfor i in range(N):\n A.append([int(x) for x in input().split()])\n\nAB = np.array(A)\n\nAB = AB[np.argsort(AB[:,0])]\n\nyen = 0\ncnt = 0\ni = 0\nwhile(1):\n cnt_ = cnt + AB[i,1]\n if(cnt_ >= M):\n yen += (M - cnt)*AB[i,0]\n break\n yen += AB[i,0]*AB[i,1]\n cnt = cnt_\n i += 1\n\n\nprint(yen)'] | ['Wrong Answer', 'Accepted'] | ['s993344342', 's765420610'] | [34024.0, 34020.0] | [1639.0, 740.0] | [382, 362] |
p03103 | u157184457 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m=map(int,input().split())\nA=[list(map(int,input().split()))for i in range(n)]\nprint(A)\nA=sorted(A,key=lambda y:y[0])\nprint(A)\ncnt=0\nans=0\nfor i in range(n):\n cnt+=A[i][1]\n if m<=cnt:\n over=cnt-m \n ans+=(A[i][0]*A[i][1])-(over*A[i][0])\n break\n else:\n ans+=A[i][0]*A[i][1]\nprint(ans)', 'n,m=map(int,input().split())\nA=[list(map(int,input().split()))for i in range(n)]\nA=sorted(A,key=lambda y:y[0])\ncnt=0\nans=0\nfor i in range(n):\n cnt+=A[i][1]\n if m<=cnt:\n over=cnt-m \n ans+=(A[i][0]*A[i][1])-(over*A[i][0])\n break\n else:\n ans+=A[i][0]*A[i][1]\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s045502539', 's011446601'] | [38156.0, 29796.0] | [581.0, 452.0] | [375, 357] |
p03103 | u162758522 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N,M = map(int,input().split())\nA = [0] * N\nB = [0] * N\nC = [[0,0] for i in range(N)]\ncheck = 0\nmoney = 0\na = 0\nk = 0\n\nfor i in range(N):\n\n A[i],B[i] = map(int,input().split())\n C[i] = [A[i],B[i]]\n\nC.sort()\n\nwhile a == 0:\n\n if check + C[k][1] <= M:\n\n check += C[k][1]\n money += C[k][0]*C[k][1]\n\n if check + C[k][1] < M:\n\n k += 1\n\n else:\n\n money += C[k][0] * (M-check)\n a += 1\n\nprint(money)', 'N,M = map(int,input().split())\nA = [0] * N\nB = [0] * N\nC = [[0,0] for i in range(N)]\ncheck = 0\nmoney = 0\na = 0\nk = 0\n\nfor i in range(N):\n\n A[i],B[i] = map(int,input().split())\n C[i] = [A[i],B[i]]\n\nC.sort()\n\nwhile a == 0:\n\n if check + C[k][1] < M:\n\n check += C[k][1]\n money += C[k][0]*C[k][1]\n k += 1\n\n \n else:\n\n money += C[k][0] * (M-check)\n a += 1\n\nprint(money)'] | ['Wrong Answer', 'Accepted'] | ['s897850928', 's616460519'] | [21548.0, 21676.0] | [500.0, 499.0] | [446, 416] |
p03103 | u165233868 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N, M = map(int, input().split())\ndrink = 0\nmax_drink = M\nsum = 0\ndal = {}\nfor n in range(N):\n A, B = map(int, input().split())\n dal[A] = B\nsorted_d = sorted(dal.items())\nfor sd, sd2 in sorted_d:\n for bottle in range(sd2):\n if drink <= M:\n sum += sd\n drink += 1\n else:\n break\nprint(sum)', "N, M = map(int, input().split())\nAB = []\np = 0\n\nfor n in range(N):\n AB.append(list(map(int, input().split())))\n print(AB)\n AB.sort()\n for s, b in AB:\n print('M',M)\n p += s * min(M, b)\n M -= min(M, b)\nprint(p)", "N, M = map(int, input().split())\nAB = []\np = 0\nfor n in range(N):\n AB.append(list(map(int, input().split())))\nAB.sort()\nfor s, b in AB:\n print('M',M)\n p += s * min(M, b)\n M -= min(M, b)\nprint(p)", 'N, M = map(int, input().split())\nAB = []\np = 0\nfor n in range(N):\n AB.append(list(map(int, input().split())))\nAB.sort()\nfor s, b in AB:\n p += s * min(M, b)\n M -= min(M, b)\nprint(p)'] | ['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s036578118', 's111185988', 's271000344', 's817164924'] | [22996.0, 30264.0, 28400.0, 27760.0] | [476.0, 2110.0, 622.0, 540.0] | [341, 221, 206, 189] |
p03103 | u167523937 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['import numpy as np\n#N,M=2,5\n#AB=np.array([[4,9],[2,4]])\nN,M=map(int,input().split())\nAB=np.zeros((N,2))\nfor i in range(N):\n AB[i,0],AB[i,1]=map(int,input().split())\nAB = AB[np.argsort(AB[:, 0])]\nprint(AB)\nnumd=0\nans=0\nfor i in range(len(AB)):\n if numd==M:\n break\n else:\n if AB[i][1] < M-numd:\n ans+=AB[i][0]*AB[i][1]\n numd+=AB[i][1]\n else:\n ans+=AB[i][0]*(M-numd)\n numd+=M-numd\nprint(int(ans))', 'import numpy as np\n#N,M=2,5\n#AB=np.array([[4,9],[2,4]])\nN,M=map(int,input().split())\nAB=np.zeros((N,2))\nfor i in range(N):\n AB[i,0],AB[i,1]=map(int,input().split())\nAB = AB[np.argsort(AB[:, 0])]\nnumd=0\nans=0\nfor i in range(len(AB)):\n if numd==M:\n break\n else:\n if AB[i][1] < M-numd:\n ans+=AB[i][0]*AB[i][1]\n numd+=AB[i][1]\n else:\n ans+=AB[i][0]*(M-numd)\n numd+=M-numd\nprint(int(ans))'] | ['Wrong Answer', 'Accepted'] | ['s059358615', 's733216188'] | [16332.0, 16360.0] | [922.0, 961.0] | [467, 457] |
p03103 | u167681750 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n, m = map(int, input().split())\nab = sorted([list(map(int, input().split())) for i in range(n)])\n\ncount = 0\nbuy = 0\nfor a, b in ab:\n print(a,b)\n for i in range(b):\n buy += a\n count += 1\n\n if count >= m:\n print(buy)\n exit()', 'n, m = map(int, input().split())\nab = sorted([list(map(int, input().split())) for i in range(n)])\n\ncount = 0\nbuy = 0\nfor a, b in ab:\n for i in range(b):\n buy += a\n count += 1\n\n if count >= m:\n print(buy)\n exit()'] | ['Wrong Answer', 'Accepted'] | ['s135196826', 's397725244'] | [28648.0, 28648.0] | [670.0, 525.0] | [272, 257] |
p03103 | u175590965 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m = map(int,input().split())\nli = [list(map(int,input().split()))for i in range(n)]\n\nli.sort()\nn = 0\nans = 0\nfor i in range(n):\n a = min(m,li[i][1])\n m-=a\n ans += li[i][0]*a\n if a ==0:\n break\nprint(ans)\n', 'n,m = map(int,input().split())\nli = [list(map(int,input().split()))for i in range(n)]\n\nli.sort()\n\nans = 0\nfor i in range(n):\n a = min(m,li[i][1])\n m -= a\n ans += li[i][0]*a\n if a == 0:\n break\nprint(ans)\n'] | ['Wrong Answer', 'Accepted'] | ['s853544700', 's213753481'] | [27756.0, 27756.0] | [430.0, 488.0] | [224, 222] |
p03103 | u177411511 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N, M = list(map(int, input().split()))\nsh_li = []\nfor i in range(N):\n a, b = list(map(int, input().split()))\n sh_li.append([a, b])\nsh_li.sort(key=lambda x:x[0],reverse=False)\n\ndef calc(li, m):\n total = 0\n for sh in li:\n print(sh)\n if sh[1] < m:\n total += sh[0] * sh[1]\n m -= sh[1]\n else:\n total += sh[0] * m\n return total\n\nprint(calc(sh_li, M))', 'N, M = list(map(int, input().split()))\nsh_li = []\nfor i in range(N):\n a, b = list(map(int, input().split()))\n sh_li.append([a, b])\nsh_li.sort(key=lambda x:x[0],reverse=False)\n\ndef calc(li, m):\n total = 0\n for sh in li:\n if sh[1] < m:\n total += sh[0] * sh[1]\n m -= sh[1]\n else:\n total += sh[0] * m\n return total\n\nprint(calc(sh_li, M))'] | ['Wrong Answer', 'Accepted'] | ['s554204222', 's440245616'] | [21668.0, 21600.0] | [542.0, 459.0] | [421, 403] |
p03103 | u178192749 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m = map(int, input().split())\nl = [list(map(int,input().split)) for _ in range(n)]\ncnt = 0\nans = 0\nl.sort(key=lambda x:x[0])\nfor i in range(n):\n cnt += l[i][1]\n ans += l[i][0] * l[i][1]\n if cnt > m:\n ans -= l[i][0] * l[i][1]\n ans += l[i][0]*(m-(cnt-l[i][1]))\nprint(ans)', 'n,m = map(int, input().split())\nl = [list(map(int,input().split())) for _ in range(n)]\ncnt = 0\nans = 0\nl.sort(key=lambda x:x[0])\nfor i in range(n):\n cnt += l[i][1]\n ans += l[i][0] * l[i][1]\n if cnt > m:\n ans -= l[i][0] * l[i][1]\n ans += l[i][0]*(m-(cnt-l[i][1]))\n break\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s783624328', 's215457157'] | [3064.0, 29024.0] | [17.0, 415.0] | [294, 311] |
p03103 | u183896397 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N,M = map(int,input().split())\nX =[]\nfor i in range(N):\n a,b = map(int,input().split())\n X.append([a,b])\nX.sort(key=lambda x: x[0])\ncount = 0\nans = 0\nfor i in X:\n if M - count > i[1]:\n count += i[1]\n ans += i[0] * i[1]\n print(ans,count)\n else:\n x = M - count\n ans += i[0] * x\n break\nprint(ans)', 'N,M = map(int,input().split())\nX =[]\nfor i in range(N):\n a,b = map(int,input().split())\n X.append([a,b])\nX.sort(key=lambda x: x[0])\ncount = 0\nans = 0\nfor i in X:\n if M - count > i[1]:\n count += i[1]\n ans += i[0] * i[1]\n #print(ans,count)\n else:\n x = M - count\n ans += i[0] * x\n break\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s564551844', 's989899354'] | [25400.0, 25332.0] | [342.0, 294.0] | [347, 348] |
p03103 | u185733149 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N,M = map(int, input().split())\ndata = [input().split() for i in range(N)]\n\ndata.sort()\nnum = 0\nfor x in data:\n print(x)\n \nfor x in data:\n for xx in range(int(x[1])):\n M -= 1\n num += int(x[0])\n if(M == 0):\n break\n if(M == 0):\n break\nprint(num) ', 'N,M = map(int, input().split())\ndata = [list(map(int, input().split())) for i in range(N)]\n\ndata.sort()\nnum = 0\n# for x in data:\n# print(x)\n \nfor x in data:\n for xx in range(int(x[1])):\n M -= 1\n num += int(x[0])\n if(M == 0):\n break\n if(M == 0):\n break\nprint(num) '] | ['Wrong Answer', 'Accepted'] | ['s414218099', 's484407037'] | [35444.0, 27760.0] | [560.0, 512.0] | [302, 322] |
p03103 | u185896732 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['#import pysnooper\n\n#from collections import Counter,deque\n#from operator import itemgetter\n#from itertools import accumulate,combinations,groupby,combinations_with_replacement\nfrom sys import stdin,setrecursionlimit\n#from copy import deepcopy\n\nsetrecursionlimit(10**6)\ninput=stdin.readline\n\nn,m=map(int,input().split())\na=sorted([list(map(int,input().split())) for _ in range(n)])\nprint(a)\ncnt,can=0,0\nfor i in range(n):\n if can+a[i][1]<m:\n cnt+=a[i][0]*a[i][1]\n can+=a[i][1]\n else:\n cnt+=a[i][0]*(m-can)\n break\n #print(cnt)\nprint(cnt)', '#import pysnooper\n\n#from collections import Counter,deque\n#from operator import itemgetter\n#from itertools import accumulate,combinations,groupby,combinations_with_replacement\nfrom sys import stdin,setrecursionlimit\n#from copy import deepcopy\n\nsetrecursionlimit(10**6)\ninput=stdin.readline\n\nn,m=map(int,input().split())\na=sorted([list(map(int,input().split())) for _ in range(n)])\n#print(a)\ncnt,can=0,0\nfor i in range(n):\n if can+a[i][1]<m:\n cnt+=a[i][0]*a[i][1]\n can+=a[i][1]\n else:\n cnt+=a[i][0]*(m-can)\n break\n #print(cnt)\nprint(cnt)'] | ['Wrong Answer', 'Accepted'] | ['s235797453', 's713992433'] | [34656.0, 28572.0] | [420.0, 341.0] | [616, 617] |
p03103 | u194894739 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N, M = map(int, input().split())\n*storeList = map(int, open().read().split())\nans = 0\nfor a, b in sorted(zip(storeList[::2], storeList[1::2])):\n ans += a * min(m, b) ; m = max(0, m - b)\nprint(ans)\n', 'n, m = map(int, input().split())\ntupList = []\nfor i in range(n):\n a, b = [int(i) for i in input().split()]\n tupList.append((a, b))\n\ndef tupVal(tup):\n return tup[0]\ntupList.sort(key = tupVal)\nans = 0\nfor i in tupList:\n if m >= i[1]:\n ans += i[0] * i[1]\n m -= i[1]\n else:\n ans += i[0] * m\n break\nprint(ans)\n'] | ['Runtime Error', 'Accepted'] | ['s615101374', 's613336897'] | [2940.0, 18092.0] | [17.0, 392.0] | [200, 348] |
p03103 | u197457087 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N, M = map(int,input().split())\n\nA = []\nfor i in range(N):\n a,b = map(int,input().split())\n A.append([a,b])\n\nA.sort()\nprint(A)\n\nnokori = M\nyen = 0\nmise = 0\nwhile nokori > 0:\n if A[mise][1] >= nokori: \n yen += A[mise][0]*nokori\n break\n else:\n yen += A[mise][0]*A[mise][1]\n nokori -= A[mise][1]\n mise += 1\nprint(yen)\n ', 'N, M = map(int,input().split())\n\nA = []\nfor i in range(N):\n a,b = map(int,input().split())\n A.append([a,b])\n\nA.sort()\n#print(A)\n\nnokori = M\nyen = 0\nmise = 0\nwhile nokori > 0:\n if A[mise][1] >= nokori: \n yen += A[mise][0]*nokori\n break\n else:\n yen += A[mise][0]*A[mise][1]\n nokori -= A[mise][1]\n mise += 1\nprint(yen)\n '] | ['Wrong Answer', 'Accepted'] | ['s608232405', 's131506496'] | [26056.0, 20064.0] | [564.0, 469.0] | [371, 372] |
p03103 | u201489353 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ["import numpy as np\n\nN, M = map(int, input().split())\nA = []\nB = []\n\nfor i in range(0, N):\n a, b = np.array(list(map(float, input().split())))\n A.append(a)\n B.append(b)\n\nprint(A)\n\ncnt = 0\nsum = 0\nflag = 0\ninf = float('inf')\narrayA = np.array(A)\narrayB = np.array(B)\nfor j in range(0, N):\n idx = A.index(min(arrayA))\n pay = arrayA[idx]\n num = arrayB[idx]\n arrayA[idx]=inf\n if cnt + num < M :\n cnt += num\n sum += pay*num\n else :\n diff = int(M - cnt)\n for t in range(0, diff):\n sum += pay\n cnt += 1\n if cnt == M :\n flag = 1\n print(int(sum))\n break\n if flag == 1:\n break\n", "import numpy as np\n\nN, M = map(int, input().split())\nA = []\n\nfor i in range(0, N):\n a, b = np.array(list(map(float, input().split())))\n A.append((a, b))\n\ndtype = [('key', int), ('value', int)]\narrayA = np.array(A, dtype=dtype)\narrayA = np.sort(arrayA, order=['key'])\ncnt = 0\nsum = 0\nflag = 0\nfor j in range(0, N):\n pay = arrayA[j][0]\n num = arrayA[j][1]\n if cnt + num < M :\n cnt += num\n sum += pay*num\n else :\n diff = int(M - cnt)\n for t in range(0, diff):\n sum += pay\n cnt += 1\n if cnt == M :\n flag = 1\n print(int(sum))\n break\n if flag == 1:\n break"] | ['Wrong Answer', 'Accepted'] | ['s889379522', 's888367723'] | [25584.0, 30700.0] | [2109.0, 1412.0] | [709, 683] |
p03103 | u202570162 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N,M = map(int,input().split())\nAB = [tuple(int(i) for i in input().split()) for j in range(N)]\nAB.sort()\nans = 0\nfor i in range(N):\n\ta,b = AB[i]\n\tif M-b > 0:\n\t\tans += a*b\n\t\tM -= b\n else:\n\t\tans += M*b\n\t\tbreak\nprint(ans)', 'N,M = map(int,input().split())\nAB = [tuple(int(i) for i in input().split()) for j in range(N)]\nAB.sort()\nans = 0\nfor i in range(N):\n a,b = AB[i]\n if M -b > 0:\n ans += a*b\n M -= b\n else:\n ans += M*a\n break\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s949295243', 's333639818'] | [2940.0, 16992.0] | [17.0, 477.0] | [221, 252] |
p03103 | u204904256 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m = map(int,input().split())\na = []\nb = []\nraw = []\nans = 0\nfor i in range(n):\n raw.append(input())\nraw.sort()\nfor i in range(n):\n raw[i] = raw[i].split()\n ans = ans + float(raw[i][0])*min(m,float(raw[i][1]))\n m = m - min(m,float(raw[i][1]))\n if m == 0:\n break\n \nprint(ans)', 'n,m = map(int,input().split())\na = []\nb = []\nans = 0\nfor i in range(n):\n aa, bb = map(int,input().split())\n a.append(aa)\n b.append(bb)\nans = 0\nmini = 10000000000\nwhile(1):\n for i in range(n):\n if a[i] < mini:\n mini = a[i]\n index = i\n ans = ans + float(a[index]*min(m,b[index]))\n m = m - min(m,b[index])\n if m == 0:\n break\n a.pop(index)\n b.pop(index)\n n = n - 1\n mini = 10000000000\n \nprint(ans)', 'n,m = map(int,input().split())\na = []\nb = []\nraw = []\nans = 0\nfor i in range(n):\n raw.append(list(map(int,input().split())))\nraw.sort(key=lambda x:x[0])\nfor i in range(n):\n ans = ans + raw[i][0] * min(raw[i][1],m)\n m = m - min(raw[i][1],m)\n if m == 0:\n break\nprint(ans)\n\n \n'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s223653388', 's452971957', 's854975914'] | [27420.0, 11024.0, 29024.0] | [454.0, 2104.0, 505.0] | [288, 421, 285] |
p03103 | u209918867 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m=map(int,input().split())\nab = [list(map(int,input().split())) for i in range(n)]\nacsd=sorted(ab,key=lambda a:a[0])\nprint(n,m);print(acsd)\nyen_tot=0\nn_b=m\ndef count_p(store,n_v):\n yen,num=store\n return yen*min(n_v,num),max(n_v-num,0)\nfor s in acsd:\n cost,rem=count_p(s,n_b)\n yen_tot+=cost\n n_b=rem\n if rem==0: break\nprint(yen_tot)\n', 'n,m=map(int,input().split())\nab = [list(map(int,input().split())) for i in range(n)]\nacsd=sorted(ab,key=lambda a:a[0])\nyen_tot=0\nn_b=m\ndef count_p(store,n_v):\n yen,num=store\n return yen*min(n_v,num),max(n_v-num,0)\nfor s in acsd:\n cost,rem=count_p(s,n_b)\n yen_tot+=cost\n n_b=rem\n if rem==0: break\nprint(yen_tot)'] | ['Wrong Answer', 'Accepted'] | ['s972249237', 's650379478'] | [35448.0, 29760.0] | [506.0, 477.0] | [352, 328] |
p03103 | u210827208 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m=map(int,input().split())\n\nX=[]\n\nfor i in range(n):\n X.append(list(map(int,input().split())))\n\nY=sorted(X,key=lambda x:x[0])\n\ncnt=0\nans=0\nfor i in range(n):\n ad=Y[i][1]\n temp=cnt\n cnt+=ad\n if cnt+ad>m:\n ad=m-temp\n ans+=Y[i][0]*ad\n break\n ans+=Y[i][0]*ad\n\nprint(ans)', 'n,m=map(int,input().split())\n\nX=[]\n\nfor i in range(n):\n X.append(list(map(int,input().split())))\n\nY=sorted(X,key=lambda x:x[0])\n\ncnt=0\nans=0\nfor i in range(n):\n cnt+=Y[i][1]\n if cnt>m:\n ad=m-(cnt-Y[i][1])\n ans+=Y[i][0]*ad\n break\n ans+=Y[i][0]*Y[i][1]\n\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s776191516', 's742876666'] | [29788.0, 29792.0] | [459.0, 431.0] | [307, 295] |
p03103 | u221041683 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m =map(int,input().split())\nlm = []\nfor _ in range(n):\n lm.append(list(map(int,input().split())))\ns = 0\nmon = 0\nlm.sort(key = lambda x:x[0])\nwhile s < m:\n s += 1\n print(s)\n mon += lm[0][0]\n lm[0][1] -= 1\n print(lm)\n if lm[0][1] == 0:\n lm = lm[1::]\nprint(mon)', 'N, M = list(map(int, input().split()))\nAB = [list(map(int, input().split())) for i in range(N)]\n \nAB.sort()\nAns = 0\nfor i in AB:\n if i[1] >= M:\n Ans += i[0] * M\n break\n else:\n Ans += i[0] * i[1]\n M -= i[1]\n \nprint(Ans)'] | ['Wrong Answer', 'Accepted'] | ['s014560419', 's157499348'] | [115412.0, 27756.0] | [2105.0, 487.0] | [289, 232] |
p03103 | u223904637 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['import numpy as np\nn,m=map(int,input().split())\na=np.zeros(n)\nb=np.zeros(n)\nfor i in range(n):\n a[i],b[i]=map(int,input().split())\nx=np.argsort(a)\nans=0\ni=0\nwhile m>0:\n ans+=a[x[i]]*min(b[x[i]],m)\n i+=1\n m-=b[x[i]]\nprint(round(ans))\n ', 'import numpy as np\nn,m=map(int,input().split())\na=np.zeros(n)\nb=np.zeros(n)\nfor i in range(n):\n a[i],b[i]=map(int,input().split())\nx=np.argsort(a)\nans=0\ni=0\nwhile m>0:\n ans+=a[x[i]]*min(b[x[i]],m)\n m-=b[x[i]]\n i+=1\nprint(int(ans))\n \n'] | ['Runtime Error', 'Accepted'] | ['s501072657', 's044195067'] | [16732.0, 14812.0] | [802.0, 799.0] | [249, 248] |
p03103 | u227082700 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['n,m=map(int,input().split());d,ans=[],0\nfor i in range(n):d.append(list(map(int,input().split())))\nd.sort()\nfor i in range(n):\n if d[i][1]<=m:\n ans+=i*d[i][1]\n m-=d[i][1]\n else:\n ans+=d[i][0]*m\n m=0\n if m<=0:break\nprint(ans)', 'n,m=map(int,input().split());dd,d,ans={},{},0\nfor i in range(n):\n a,b=map(int,input().split())\n if a in dd:dd[a]+=b\n else:dd[a]=b\nfor i,j in sorted(dd.items()):d[i]=j\nfor i in d:\n if d[i]<=m:\n ans+=i*d[i]\n m-=d[i]\n else:\n a+=i*m\n m=0\n if m==0:break\nprint(ans)', 'n,m=map(int,input().split());d,ans=[],0\nfor i in range(n):d.append(list(map(int,input().split())))\nd.sort()\nfor i in range(n):\n if d[i][1]<=m:\n ans+=d[i][0]*d[i][1]\n m-=d[i][1]\n else:\n ans+=d[i][0]*m\n m=0\n if m<=0:break\nprint(ans)'] | ['Wrong Answer', 'Wrong Answer', 'Accepted'] | ['s001418258', 's027761782', 's280393596'] | [27884.0, 34900.0, 27756.0] | [506.0, 477.0, 513.0] | [239, 277, 245] |
p03103 | u228759454 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['import numpy as np\n\nN, M = map(int, input().split())\nnum_dict = dict()\nA_list = []\n\nfor n in range(N):\n A, B = map(int, input().split())\n num_dict[A] = B\n A_list.append(A)\n\nA_list.sort()\nb_accum = 0\nall_pay = 0\n\nfor a in A_list:\n if M <= b_accum:\n break\n\n if b_accum + num_dict[a] <= M:\n all_pay += num_dict[a] * a\n b_accum += num_dict[a]\n \n if M == b_accum:\n\t\t\n \n else:\n all_pay += (M - b_accum) * a \n b_accum += num_dict[a]\n \nprint(all_pay)\n\n ', 'import numpy as np\n\nN, M = map(int, input().split())\nnum_dict = dict()\nA_list = []\nB_list = []\n\nfor n in range(N):\n A, B = map(int, input().split())\n num_dict.setdefault(A, 0)\n num_dict[A] += B\n A_list.append(A)\n\nA_list = list(set(A_list))\nA_list.sort()\nb_accum = 0\nall_pay = 0\n\nfor a in A_list:\n if M <= b_accum:\n break\n\n if b_accum + num_dict[a] <= M:\n all_pay += num_dict[a] * a\n b_accum += num_dict[a] \n \n else:\n all_pay += (M - b_accum) * a \n b_accum += num_dict[a]\n break\n \nprint(all_pay)\n\n '] | ['Runtime Error', 'Accepted'] | ['s633615373', 's106478034'] | [3060.0, 32024.0] | [17.0, 567.0] | [476, 529] |
p03103 | u229660384 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N, M = map(int, input().split())\nX = []\nfor i in range(N):\n X.append(list(map(int, input().split())))\nX.sort1(key=lambda x: x[0])\ni = 0\nnum = 0\nans = 0\nwhile i <= N - 1:\n num += X[i][1]\n ans += X[i][0] * X[i][1]\n if num > M:\n ans -= X[i][0] * (num - M)\n break\n i += 1\nprint(ans)', 'N, M = map(int, input().split())\nX = []\nfor i in range(N):\n X.append(list(map(int, input().split())))\nX.sort(key=lambda x: x[0])\ni = 0\nnum = 0\nans = 0\nwhile i <= N - 1:\n num += X[i][1]\n ans += X[i][0] * X[i][1]\n if num > M:\n ans -= X[i][0] * (num - M)\n break\n i += 1\nprint(ans)'] | ['Runtime Error', 'Accepted'] | ['s642853283', 's445872508'] | [27380.0, 29024.0] | [348.0, 512.0] | [307, 306] |
p03103 | u230549821 | 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 buy M cans of energy drinks? It is guaranteed that, in the given inputs, a sufficient amount of money can always buy M cans of energy drinks. | ['N,M = map(int,input().split())\nAB=[[int(j) for j in input().split()] for i in range(N)]\nans=0\nAB = sorted(AB)\nnum, ans, i,j =0,0,0,1\nwhile num<M:\n if j<=AB[i][1]:\n ans += AB[i][0]\n num+=1\n j+=1\n print("num",num)\n else:\n i+=1\n j=1\nprint(ans)', 'N,M = map(int,input().split())\nAB=[[int(j) for j in input().split()] for i in range(N)]\nans=0\nAB = sorted(AB)\nnum, ans, i,j =0,0,0,1\nwhile num<M:\n if j<=AB[i][1]:\n ans += AB[i][0]\n num+=1\n j+=1\n else:\n i+=1\n j=1\nprint(ans)'] | ['Wrong Answer', 'Accepted'] | ['s669539288', 's081522868'] | [22540.0, 22376.0] | [599.0, 466.0] | [288, 263] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.