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
p02682
u901582103
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['if a>=k:\n print(k)\nelif a<k<=a+b:\n print(a)\nelse:\n print(a-(k-a-b))', 'a,b,c,k=map(int,input().split())\nif a>=k:\n print(k)\nelif a<k<=a+b:\n print(a)\nelse:\n print(a-(k-a-b))\n']
['Runtime Error', 'Accepted']
['s190783789', 's275109900']
[9088.0, 9156.0]
[19.0, 23.0]
[76, 110]
p02682
u904811150
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['if a.isdigit()==True and b.isdigit()==True and c.isdigit()==True and k.isdigit()==True:\n a = int(a)\n b = int(b)\n c = int(c)\n k = int(k)\n if a>=0 and b>=0 and c>=0:\n if k>=1 and k<=(a+b+c) and (a+b+c)<=2*(10**9):\n if k < a:\n print(k)\n elif k >= a and ...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s342980316', 's411127804', 's661027003', 's863525059', 's290185742']
[9124.0, 9080.0, 9016.0, 9132.0, 9136.0]
[25.0, 26.0, 22.0, 22.0, 20.0]
[402, 383, 370, 370, 144]
p02682
u904995051
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['#ABC167B\na,b,c,d,k = map(int,input().split())\nprint(min(a,k)-max(k-a-b,0))', '#ABC167B\na,b,c,k = map(int,input().split())\nprint(min(a,k)-max(k-a-b,0))']
['Runtime Error', 'Accepted']
['s045142244', 's647736385']
[9152.0, 9068.0]
[22.0, 27.0]
[74, 72]
p02682
u905174677
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = map(int,input().split())\n\ndef choice2(a,b,c,k):\n if a >= k and a +b < k:\n print(a)\n elif a + b >= k and a + b + c <k:\n print(a)\n else:\n print(a-(k-c))\n\nchoice2(a,b,c,k)', 'a,b,c,k = map(int,input().split())\n\nxa = min(a,k)\nk1 = k-xa\nxb = min(b,k1)\nk2 = k1-xb\nxc =...
['Wrong Answer', 'Accepted']
['s032147522', 's373153563']
[9040.0, 9108.0]
[23.0, 25.0]
[208, 107]
p02682
u907446975
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k=map(int,input().split())\nif k<=a+c:\n print(k)\nelif k>a+c:\n print(a+c)', 'def do():\n a,b,c,k=map(int,input().split())\n if a>=k:\n return k\n elif a+b>=k:\n return a\n elif k>a+b:\n v=min(k-a-b,c)\n return a-v\nprint(do())\n']
['Wrong Answer', 'Accepted']
['s802450754', 's346051666']
[9164.0, 9080.0]
[23.0, 23.0]
[83, 181]
p02682
u913392095
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['\n\n#b b <B\n#c K-a-b <C \nif K < A:\n ans=K\nelif K-A <= B and K>=A:\n ans=A\nelse :\n ans=A-(K-A-B)\nprint(ans)', 'A,B,C,K=map(int,input().split())\n\n\n#b b <B\n#c K-a-b <C \nif K < A:\n ans=K\nelif K-A <= B and K>=A:\n ans=A\nelse :\n ans=A-(K-A-B)\nprint(ans)']
['Runtime Error', 'Accepted']
['s412593837', 's928915507']
[9048.0, 8904.0]
[22.0, 23.0]
[119, 167]
p02682
u917444023
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k=map(int,input().split())\nif k<=a+b:\n print(k)\nelse:\n print(2*a+b-k)', 'a,b,c,k=map(int,input().split())\nif k<=a:\n print(k)\nelif a<k<=a+b:\n print(a)\nelse:\n print(2*a+b-k)']
['Wrong Answer', 'Accepted']
['s291389748', 's070801716']
[9160.0, 9164.0]
[21.0, 22.0]
[81, 107]
p02682
u917734688
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,D = map(int,input().split())\ncount = 0\npoint = 0\n\nif D-A <= 0:\n point = A\n D -= A\n if D-B <= 0:\n D -= B\n if D-C <= 0:\n point -= C\n print(point)\n else:\n point -= D\n print(point)\n else:\n print(point)\nelse:\n po...
['Wrong Answer', 'Accepted']
['s991682105', 's267991304']
[9132.0, 9196.0]
[20.0, 20.0]
[324, 324]
p02682
u921156673
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A, B, C, K = map(int, input().split())\n\nA = max(A, K)\nB = max(K - A, B)\nC = max(K - A - B, C)\nassert A + B + C >= K\nprint(A - C)A, B, C, K = map(int, input().split())\n\nA = min(A, K)\nB = min(K - A, B)\nC = min(K - A - B, C)\nassert A + B + C >= K\n#print(A, B, C)\nprint(A - C)', 'A, B, C, K = map(int, input()...
['Runtime Error', 'Accepted']
['s142615756', 's325770487']
[8992.0, 9000.0]
[23.0, 27.0]
[352, 184]
p02682
u927373043
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A, B, C, K = map(int,input().split())\n\nif(A >= K):\n print(K)\nif(A+B>=K):\n print(A)\nif(A+B+C>=K):\n print(A-(K-A-B))', 'A, B, C, K = map(int,input().split())\n\nif(A >= K):\n print(K)\nelif(A+B>=K):\n print(A)\nelse:\n print(A-(K-A-B))']
['Wrong Answer', 'Accepted']
['s822667302', 's031017653']
[9172.0, 9168.0]
[21.0, 20.0]
[117, 111]
p02682
u928758473
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['import os\n\ndef main():\n\ta,b,c,k = map(int, input().split())\n\tans = 0\n\tans += a\n\tk -= a\n\tk -= b\n\tans += (c - k - 1) * (-1)\n\t\n\nif __name__ == "__main__":\n\tmain()\n', 'import os\nimport sys\nfrom collections import defaultdict, Counter\nfrom itertools import product, permutations,combinations, accumu...
['Wrong Answer', 'Accepted']
['s786724398', 's677285653']
[9172.0, 9524.0]
[24.0, 26.0]
[160, 556]
p02682
u931011688
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a , b ,c , k = map(int, input().split())\n\ntmp = k -(a+b)\n\n\nif (a+b) >= k:\n print(k)\nelif a > 0 and (a+b) < k:\n print (a - tmp)\nelif a == 0 :\n print (-(k-b))\n', 'a , b ,c , k = map(int, input().split())\n\n\ntmp = k - a \ntmp2 = k -a-b\n\nif k < a:\n print(k)\nelif tmp > 0 and tmp < b:\n pr...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s110584508', 's702009323', 's789359868', 's007654176']
[9168.0, 9180.0, 9124.0, 9184.0]
[22.0, 20.0, 20.0, 24.0]
[166, 222, 231, 180]
p02682
u931224873
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['abck = input().split(" ")\na = abck[0]\nb = abck[1]\nc = abck[2]\nk = abck[3]\n\nif k < a:\n\tprint(a)\nelif k < a + b:\n\tprint(a)\nelse:\n\tprint(a - (k - (a + b)))\n\n ', 'abck = input().split(" ")\na = int(abck[0])\nb = int(abck[1])\nk = int(abck[3])\n\nif k < a:\n\tprint(k)\nelif k <= a + b:\n\tprint(a)\nelse:\n...
['Runtime Error', 'Accepted']
['s489431403', 's781920168']
[9104.0, 9148.0]
[23.0, 22.0]
[155, 162]
p02682
u931394483
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K = map(int, input().split())\n\nD = 0\nif K-A-B > 0:\n\tD = K-A-B\nif K == A:\n\tans = A - D\nelse:\n\tans = K\nprint(ans)', 'A,B,C,K = map(int, input().split())\n\nD = 0\nif K-A-B > 0:\n\tD = K-A-B\nif K >= A:\n\tans = A - D\nelse:\n\tans = K\nprint(ans)']
['Wrong Answer', 'Accepted']
['s088334007', 's938350776']
[9176.0, 9176.0]
[21.0, 24.0]
[117, 117]
p02682
u931489673
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['def main(A, B, C, K):\n """\n a = [1 for _ in range(A)]\n b = [0 for _ in range(B)]\n c = [-1 for _ in range(C)]\n k = a + b + c\n ans = sum(k[:K])\n """\n if A+B >= K:\n return K\n else:\n return A - (K-A-B)\n\nif __name__ == \'__main__\':\n A, B, C, K = map(int, input().s...
['Wrong Answer', 'Accepted']
['s538120694', 's804916177']
[9116.0, 9052.0]
[27.0, 24.0]
[353, 390]
p02682
u932868243
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k=map(int,input().split())\nif a>=k:\n print(k)\nelif a<k and b>=k-a:\n print(a)\nelse:\n print(2a+b-k)', 'a,b,c,k=map(int,input().split())\nif a>=k:\n print(k)\nelif a<k and b>=k-a:\n print(a)\nelse:\n print(2*a+b-k)']
['Runtime Error', 'Accepted']
['s974632031', 's173952523']
[9040.0, 9172.0]
[24.0, 21.0]
[106, 107]
p02682
u938718404
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k=map(int,input().split())\nn=k-a-b\nif n>=0 \n print(a-n)\nelif n<0 and a<=k:\n print(a)\nelif n<0 and a>k:\n print(k)', 'a,b,c,k=map(int,input().split())\nn=k-a-b\nif n>=0 \n print(a-n)\nelif n<0 and a<=k:\n print(a)\nelse:\n print(k)', 'a,b,c,k=map(int,input().split())\nn=k-a-b\nif n>=0: \n...
['Runtime Error', 'Runtime Error', 'Accepted']
['s317225874', 's960816828', 's031331193']
[8940.0, 8976.0, 9140.0]
[23.0, 20.0, 23.0]
[127, 115, 128]
p02682
u939949527
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['\na, b, c, k = map(int, input().split())\ncards = 0\nsum = 0\n\nif k >=a:\n sum = sum + a * 1\n cards = k - a\n if k >= b:\n sum += 0\n cards = cards + b\n if k >= c:\n \tsum -= 1\n \tcards = cards + c\n \tprint(sum)\n else:\n sum = sum + (k - cards) * -1\n print(sum)\n \n if k...
['Runtime Error', 'Accepted']
['s011755146', 's984503787']
[8808.0, 9200.0]
[21.0, 20.0]
[363, 488]
p02682
u942356554
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,d=map(int,input().split())\nh=k-a\nh2=h-b\nif a>k:\n print(k)\nelse:\n if h<=b:\n print(a)\n else:\n print(a+h2*(-1))', 'a,b,c,d=map(int,input().split())\nh=k-a\nh2=h-b\nif a>k:print(k)\nelse:if h<=b:print(a)\n else: print(a+h2*(-1))', 'a,b,c,k=map(int,input().split())\nh=k-a\nh2=h-b\nif a>k:\n pr...
['Runtime Error', 'Runtime Error', 'Accepted']
['s109452355', 's924333654', 's844102841']
[9172.0, 8872.0, 9172.0]
[18.0, 24.0, 21.0]
[123, 111, 123]
p02682
u944886577
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k=map(int,input().split())\n \nif a>=k:\n print(a)\n exit()\nelse:\n if k-a=<b:\n print(a)\n exit()\n else:\n c=k-a-b\n print(a-c)', 'a,b,c,k=map(int,input().split())\n\nif a>=k:\n print(a)\n break()\nelse:\n if k-a<b:\n print(a)\n else:\n c=k-a-b\n print(a-c)\n', 'a,b,c,k=map(int,i...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s175272943', 's314776430', 's628621770', 's240923264']
[8912.0, 8972.0, 8784.0, 9204.0]
[29.0, 27.0, 24.0, 26.0]
[141, 130, 141, 141]
p02682
u948050032
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['from sys import stdin\n\nA, B, C, K = [int(x) for x in stdin.readline().rstrip().split()]\nif K-A == 0:\n print(A)\nelif K-A > 0:\n if K-A-B <= 0:\n print(A)\n else:\n print(int(A+(K-A-B)*-1))\n\nprint(int(A+(K-A-B)*-1))', 'from sys import stdin\n\nA, B, C, K = [int(x) for x in stdin.readline()...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s753204186', 's794104115', 's883834128', 's820666793']
[9196.0, 9156.0, 9196.0, 9184.0]
[22.0, 2206.0, 24.0, 19.0]
[232, 574, 231, 206]
p02682
u949210009
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K = map(int,input().split())\nanswer = 0\nif K <= A:\n print(K)\nelif K > A:\n answer = A\n K = K - A\nif K <= B and K > 0 :\n print(answer)\nelif K > B:\n K = K - B\nif K <= C and K > 0:\n answer = answer - K\n print(answer)', 'A,B,C,K = map(int,input().split())\nanswer = 0\nif K <= A:\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s872825063', 's958463980', 's767997775']
[9132.0, 9048.0, 9204.0]
[22.0, 20.0, 21.0]
[239, 233, 259]
p02682
u952968889
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c, k = map(int, input().split())\nnum = a\nk -= a\n\nif k>0:\n k-=b\n if k>0:\n print(num-k)\n exit()\n else:\n print(num)\n\nprint(num)', 'a, b, c, k = map(int, input().split())\nnum = 0\n\nif k-a>0:\n num += a\n k-=a\n if k-b>0:\n k -= b\n print(num-k)\n ...
['Wrong Answer', 'Accepted']
['s276569580', 's061279845']
[9180.0, 9116.0]
[19.0, 21.0]
[160, 177]
p02682
u953379577
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['if k<=a:\n print(k)\nelse:\n x = k-a\n if x<=b:\n print(a)\n else:\n print(a-(x-b))', '\na,b,c,k = map(int,input().split())\n\nif k<=a:\n print(k)\nelse:\n x = k-a\n if x<=b:\n print(a)\n else:\n print(a-(x-b))']
['Runtime Error', 'Accepted']
['s754420500', 's625874150']
[9088.0, 9196.0]
[21.0, 21.0]
[102, 139]
p02682
u953794676
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['# abc167 b\na, b, c, k = [int(i) for i in input().split()]\nans = 0\nif k < a:\n ans = 0\nelif k < a + b:\n ans = a\nelse:\n ans = a - (k-(a+b))', '# abc167 b\na, b, c, k = [int(i) for i in input().split()]\nans = 0\nif k <= a:\n ans = k\nelif k <= a + b:\n ans = a\nelse:\n ans = a - (k-(a+b))\nprin...
['Wrong Answer', 'Accepted']
['s644558573', 's454995045']
[9164.0, 9100.0]
[23.0, 23.0]
[145, 158]
p02682
u957957759
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,x=map(int,input().split())\n \nif:\n print(x)\nelif x<a+b:\n print(int(a))\nelse:\n print(int(2*a+b-x))', 'a,b,c,x=map(int,input().split())\n \nif x<a:\n print(x)\nelif x<a+b:\n print(a)\nelse:\n print(2*a+b-x)']
['Runtime Error', 'Accepted']
['s572043595', 's830498926']
[9000.0, 9120.0]
[21.0, 21.0]
[105, 99]
p02682
u962765087
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['S = input()\nT = input()\n\nif(S==T[0:len(S)]):\n print(Yes)\n else:\n print(No)\n\t\n\n', 'A, B, C, K = map(int, input().split())\nif((K-A)>0):\n Y = K-A\nelse:\n print(K)\n exit()\nif((Y-B)>0):\n Z = Y-B\nelse:\n Z = 0\n\nX = A + 0 * Y + (-1) * Z\nprint(X)\n\n\n\n\n\n\n\n\n\n\n\n\t\n\n']
['Runtime Error', 'Accepted']
['s769919753', 's859546484']
[9016.0, 9076.0]
[23.0, 29.0]
[82, 184]
p02682
u964521959
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A, B,C,K = map(int, input().split())\n\nans = 0\n\nfor i in range(A):\n if(K>0):\n ans = ans + 1\n K = K-1\nfor i in range(B):\n if(K>0):\n ans = ans \n K = K-1\nfor i in range(C):\n if(K>0):\n ans = ans - 1\n K = K-1', 'A, B,C,K = map(int, input().split())\nif(K<A):\n print(K)\nelif(K>A+B):\n ...
['Wrong Answer', 'Accepted']
['s112963163', 's457413478']
[9032.0, 9016.0]
[2205.0, 20.0]
[223, 107]
p02682
u965482124
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a, b, c , k = map(int, input().split())\nif k <=a:\n print(k)\nif k <=(a+b):\n print(a)\nif k < a+b+c:\n print(a-(k-(a+b)))\n', 'a, b, c , k = map(int, input().split())\nif k <=a:\n print(k)\nif k <=(a+b):\n print(a)\nif k <= a+b+c:\n print(a-(k-(a+b)))\n', 'a, b, c , k = map(int, input().split())\n...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s048179451', 's057319632', 's523497893', 's158172181']
[9044.0, 9108.0, 9012.0, 9136.0]
[30.0, 29.0, 24.0, 29.0]
[127, 128, 123, 213]
p02682
u975719989
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a,b,c,k = map(int,input().split())\nif a >= k:\n\tprint(k)\nelif a+b >=k:\n\tprint(k)\nelse:\n print(a*1+b*0 +(k-a-b)*(-1))\n \n\n', 'a,b,c,k = map(int,input().split())\nxa = min(a,k)\nk-=xa\nxb=min(b,k)\nk-=xb\nxc=k\nprint(xa-xc)\n \n\n']
['Wrong Answer', 'Accepted']
['s898018648', 's322046767']
[9004.0, 9160.0]
[23.0, 22.0]
[125, 97]
p02682
u982030663
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A, B, C, K = map(int, input.split(" "))\nif K <= A:\n print(K)\nelse:\n K = K - A\n if K <= B:\n print(A)\n else:\n K = K - B\n print(A - K)\n', 'A, B, C, K = map(int, input().split(" "))\nif K <= A:\n print(K)\nelse:\n K = K - A\n if K <= B:\n print(A)\n else:\n ...
['Runtime Error', 'Accepted']
['s825415458', 's295802485']
[9096.0, 9164.0]
[23.0, 22.0]
[165, 167]
p02682
u984592063
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['a = input()\nb = input()\nc = input()\nk = input()\n\nif(k<a):\n print(k)\nelif(k>a and k<a+b):\n print(a)\nelif(k>a+b and k<a+b+c):\n print(a-(k-(a+b)))\n', 'a, b, c, k = map(int, input().split())\n\nif(k<=a):\n print(k)\nelif(k>a and k<=a+b):\n print(a)\nelse:\n print(a-(k-(a+b)))\n']
['Runtime Error', 'Accepted']
['s344037098', 's991435678']
[9048.0, 9172.0]
[24.0, 22.0]
[153, 127]
p02682
u987549444
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['from sys import stdin\n\na=stdin.readline().split()\nA=int(a[0]) #1\nB=int(a[1]) #0\nC=int(a[2]) #-1\nK=int(a[3])\n\nif K<=A:\n print(K)\nelif K<A<=A+B:\n print(A)\nelse:\n print(2*(A+B)-K)', 'from sys import stdin\n \na=stdin.readline().split()\nA=int(a[0]) #1\nB=int(a[1]) #0\nC=int(a[2]) #-1\nK=int(a[3])\n \nif ...
['Wrong Answer', 'Accepted']
['s644056042', 's085581688']
[9160.0, 9192.0]
[24.0, 24.0]
[179, 179]
p02682
u988191897
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A,B,C,K = map(int,input().split())\nif A + B >= K:\n\tprint(K)\nelse:\n\tprint(A-(K-(A+B)))', 'A,B,C,K = map(int,input().split())\nif A + B >= K:\n\tprint(max(K,A))\nelse:\n\tprint(A-(K-(A+B)))', 'A,B,C,K = map(int,input().split())\nif A + B >= K:\n\tprint(max(K.A))\nelse:\n\tprint(A-(K-(A+B)))', 'A,B,C,K = map(int,i...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s375255300', 's860529535', 's927821456', 's924713600']
[9192.0, 9060.0, 9168.0, 9164.0]
[23.0, 22.0, 23.0, 24.0]
[85, 92, 92, 92]
p02682
u995163736
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A = list(map(int, input().split()))\n\nif A[0]+A[1]+A[2]>=A[3]:\n if A[3]-A[0]-A[1]>A[2]:\n \tprint(A[0]-(A[3]-A[0]-A[1]))\n else:\n print(A[0]-A[2])\nelse:\n print(A[0]-A[2])', 'A = list(map(int, input().split())) \n\nans=0\nif A[0]<A[3]:\n ans = A[0]\nelse:\n ans = A[3]\n print(ans)\n \nprint(ans-(A[3]-A...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s302885057', 's689338286', 's864708179']
[9224.0, 9040.0, 9176.0]
[22.0, 23.0, 20.0]
[173, 132, 149]
p02682
u996996256
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['l = map(int, input().split())\nlists = [1]*l[0] + [0]*l[1] + [-1]*l[2]\nsum = 0\nfor i in range(l[3]):\n sum += lists[i]\nprint(sum)', 'a, b, c, k = map(int, input().split())\nprint(a+b if a+b>=k else a-(k-a-b))', 'a, b, c, k = map(int, input().split())\nprint(a if a>=k else a-c)', 'a, b, c, k = map(int, input().s...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s300165140', 's311246853', 's688396171', 's986983744', 's844934079']
[8892.0, 9144.0, 9008.0, 8900.0, 9120.0]
[21.0, 19.0, 23.0, 21.0, 21.0]
[130, 74, 64, 65, 64]
p02682
u997648604
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['import math\nsys.setrecursionlimit(10**9)\n\ndef main():\n A,B,C,K = map(int,input().split())\n\n if K<= A:\n print(K)\n elif K<=B:\n print(A)\n else:\n print(2*A+B-K)\n\nif __name__ == "__main__":\n main()', 'import sys\nimport math\nsys.setrecursionlimit(10**9)\n\ndef main():\n ...
['Runtime Error', 'Accepted']
['s426112888', 's387674809']
[9104.0, 9196.0]
[20.0, 22.0]
[226, 238]
p02682
u998082063
2,000
1,048,576
We have A cards, each of which has an integer 1 written on it. Similarly, we also have B cards with 0s and C cards with -1s. We will pick up K among these cards. What is the maximum possible sum of the numbers written on the cards chosen?
['A, B, C, K = inpl()\nif A >= K:\n print(K)\n exit()\nif A+B >= K:\n print(A)\n exit()\nprint(A-(K-A-B))', "from collections import defaultdict, deque\nimport sys\nimport heapq\nimport bisect\nimport itertools\nimport queue\nimport copy\nimport time\nsys.setrecursionlimit(10**8)\nINF = float('inf')\nmod = ...
['Runtime Error', 'Accepted']
['s020204130', 's636015540']
[9060.0, 10048.0]
[20.0, 26.0]
[108, 491]
p02683
u017624958
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["N, M, X = list(map(int, input().split()))\nCA = [list(map(int, input().split())) for i in range(N)]\n# print(N, M, X)\n# print(CA)\n\ndef can_reach(M, CA, X):\n understandig_list = [0] * M\n for CAi in CA:\n for j in range(1, len(CAi)):\n understandig_list[j - 1] += CAi[j] \n\n can = all([u...
['Wrong Answer', 'Accepted']
['s557458445', 's003739456']
[9200.0, 9228.0]
[23.0, 81.0]
[448, 792]
p02683
u020472025
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["import numpy as np\n\nN, M, X = map(int, input().split())\n\nALL = np.zeros((1, M+1))\nfor n in range(N):\n CA = np.array([ int(i) for i in input().split() ])\n ALL = np.vstack([ALL, CA])\n\nA = ALL.sum(axis=0)\ncost =12*10**5+1\n#ALL = np.sort(ALL, axis=0)\n\nfor n in range(2**N):\n a = str(bin(n))[2:]\n b ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s085240999', 's162869612', 's334567263', 's496149360', 's648623141', 's757440405']
[27348.0, 27352.0, 27324.0, 27352.0, 27392.0, 27200.0]
[182.0, 182.0, 175.0, 176.0, 183.0, 159.0]
[561, 557, 624, 575, 565, 540]
p02683
u021548497
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['n, m, x = map(int, input().split())\nbooks = [0]*n\nfor i in range(n):\n books[i] = [int(x) for x in input().split()]\n\nans = 10**9\nfor i in range(2**n):\n cost = 0\n point = [0]*m\n for j in range(n):\n if (i>>j)&1:\n for k in range(1, m+1):\n point[k-1] += books[j][k]\n flag = True\n for j in...
['Runtime Error', 'Accepted']
['s114168002', 's360287713']
[9136.0, 9116.0]
[22.0, 91.0]
[888, 457]
p02683
u029021990
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import numpy as np\n\nN,M,X = map(int, input().split())\n\na = np.zeros((N,M+1))\n\nfor i in range(N):\n \n a[i] = [int(x) for x in input().split()]\n\nb = np.zeros(N)\nc = np.zeros(M+1)\nmin_cost = 9999999999999999\n\nfor i in range(2**N):\n ii = i\n for j in range(N):\n b[j] = ii % 2\n ii ...
['Wrong Answer', 'Accepted']
['s561057417', 's204513416']
[27008.0, 27184.0]
[549.0, 576.0]
[745, 750]
p02683
u033360495
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['N, M, X = map(int,input().split())\nA=[]\nfor i in range(N):\n A.append(list(map(int, input().split())))\n \npr=10**9\nfor s in range(2**N):\n x_m = [0]*13\n for i in range(N):\n b = (s >> i) & 1\n if b == 1:\n pr_s += A[i][0]\n for j in range(M+1):\n x_m...
['Runtime Error', 'Runtime Error', 'Accepted']
['s638041964', 's949417891', 's750175943']
[9240.0, 9240.0, 9128.0]
[20.0, 22.0, 91.0]
[511, 513, 485]
p02683
u036914910
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import itertools\nN,M,X = map(int,input().split())\nA = [0]*M\nC = []\nZ = []\ncz = []\nb = 0\nfor i in range(N) :\n C.append(list(map(int,input().split())))\n\nfor i in range(1,N+1) :\n c = list(itertools.combinations(C,i))\n print(c)\n for j in range(len(c)) :\n A=[0]*M\n cj = c[j]\n ...
['Wrong Answer', 'Accepted']
['s632096953', 's069226247']
[10656.0, 27236.0]
[108.0, 176.0]
[580, 452]
p02683
u048800107
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['\n\nN,M,X = map(int,input().split())\nitems = [list(map(int,input().split())) for _ in range(N)]\nans = -1\nfor i in range(1 << N):\n total = [0]*(M+1)\n for j in range(N): \n if ((i >> j) & 1): \n h = [x + y for (x, y) in zip(total, items[j])]\n # print(total)\n if all( k >= X for k i...
['Runtime Error', 'Accepted']
['s358022185', 's500829616']
[9200.0, 9136.0]
[23.0, 57.0]
[518, 530]
p02683
u050706842
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import numpy as np\n\nN, M, X = list(map(int, input().split()))\n\nCA = []\nfor i in range(N):\n s = input()\n CA.append(np.fromstring(s, np.int16, sep=" "))\n\nCA = np.asarray(CA)\nC = CA[:, :1]\nA = CA[:, 1:]\n\ndef loop(i, x, total):\n if i == N:\n if (x >= X).all():\n return total\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s224089817', 's773089352', 's306869837']
[27352.0, 27372.0, 27140.0]
[126.0, 133.0, 169.0]
[496, 496, 530]
p02683
u050708958
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['n, m, x = [*map(int, input().split())]\nk = []\nans = 10 ** 6\nfor i in range(n):\n c, *a = [*map(int, input().split())]\n s += c\n k.append([c, *a])\n\nfor i in range(2 ** n):\n cost = 0\n skills = [0] * m\n for j in range(n):\n if ((i >> j) & 1):\n cost += k[j][0]\n fo...
['Runtime Error', 'Accepted']
['s121680086', 's935251741']
[9232.0, 9120.0]
[28.0, 104.0]
[498, 452]
p02683
u052244548
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['N, M, X = map(int,input().split())\na=[]\nb=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\nc=[]\nfor i in range(N):\n a.append(input().split())\n c.append(0)\n\ncheck=0\nans=-1\nfor i in range(1,(2**N)-1):\n b=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\n check=0\n for j in range(N):\n if 0x01 & (i >> j):\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s181501367', 's338448568', 's888820390', 's171235973']
[9264.0, 9196.0, 9220.0, 9268.0]
[160.0, 271.0, 271.0, 129.0]
[584, 556, 556, 511]
p02683
u054274920
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['N,M,X = map(int,input().split())\nC=[0 for i in range(N)]\nA=[[] for i in range(N)]\nmin_cost=10000000000\nfor i in range(N):\n C[i],*A[i]=map(int,input().split())\nfor i in range(1<<N):\n L=[0 for i in range(M)]\n cost=0\n for j in range(N):\n if 1&(i>>j):\n for k in range(M):\n ...
['Runtime Error', 'Accepted']
['s735159722', 's163095257']
[8992.0, 9240.0]
[23.0, 85.0]
[463, 464]
p02683
u059487235
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["\nn, m, x = map(int, input().split())\nca = [list(map(int, input().split())) for _ in range(n)]\n\nans = -1\nfor i in range(2**n):\n li = [0]*(m+1)\n print('==========')\n for j in range(n):\n print('i = ', i)\n print('j = ', j)\n print('(i >> j) = ', (i >> j))\n print('((i >> j) ...
['Wrong Answer', 'Accepted']
['s127054090', 's525335022']
[10516.0, 9228.0]
[281.0, 85.0]
[678, 690]
p02683
u060736237
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['def main()\n n, m, x = map(int, input().split())\n ca = []\n for _ in range(n):\n ca.append(list(map(int, input().split())))\n result = 10**9\n for i in range(1, 2**n+1):\n work = 0\n j = 0\n temp = [0] * m\n for flag in bin(i)[2:].zfill(n):\n if flag == "1...
['Runtime Error', 'Accepted']
['s527225584', 's193424512']
[8948.0, 9228.0]
[24.0, 63.0]
[696, 697]
p02683
u060793972
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import itertools\nn,m,x=map(int,input().split())\nl=list()\nfor i in range(n):\n l.append(list(map(int,input().split())))\nfor i in range(1,n+1):\n for j in itertools.combinations(l,i):\n print(j)\n r=[0 for i in range(m)]\n for k in j:\n a=0\n p=0\n for i i...
['Wrong Answer', 'Accepted']
['s073144212', 's507623253']
[9308.0, 9584.0]
[129.0, 109.0]
[515, 533]
p02683
u062484507
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["import itertools\nimport sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nn, m, x = map(int, readline().split())\nc = [list(map(int, readline().split())) for _ in range(n)]\n\nans = 10 ** 9 + 7\nfor l in list(itertools.product([0, 1], repeat=n)):\n ...
['Runtime Error', 'Accepted']
['s048079008', 's567980734']
[8996.0, 9540.0]
[21.0, 61.0]
[555, 568]
p02683
u068944955
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import pandas as pd', 'import itertools\nN, M, X = map(int, input().split())\nC = []\nA = dict()\nfor i in range(N):\n CA = list(map(int, input().split()))\n C.append(CA[0])\n for j in range(1, M+1):\n if j in A:\n A[j].append(CA[j])\n else:\n A[j] = [CA[j]]\n\ncost = floa...
['Runtime Error', 'Accepted']
['s183563437', 's558439215']
[9108.0, 9148.0]
[24.0, 84.0]
[19, 751]
p02683
u072717685
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["from itertools import product\ndef main():\n n, m, x = map(int, input().split())\n books = []\n for _ in range(n):\n books.append(tuple(map(int, input().split())))\n\n books_set_all = []\n books_pattern = product((0, 1), repeat=n)\n for each_pattern in books_pattern:\n print(each_patte...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s077806624', 's456771100', 's455014687']
[11184.0, 11340.0, 27656.0]
[71.0, 60.0, 118.0]
[846, 801, 829]
p02683
u073589005
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import numpy as np \nimport itertools\n\nval = input()\nval = val.split(" ")\nval = [int(i) for i in val] \n\nI = np.zeros((val[0], val[1]+1))\n\nfor i in range(val[0]):\n val2 = input()\n val2 = val2.split(" ")\n val2 = [int(i) for i in val2] \n I[i] = val2\n\nseq = [i for i in range(val[0])] \n# pri...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s444183583', 's562713435', 's659397525', 's732732167', 's518984456']
[27372.0, 27388.0, 27412.0, 27036.0, 27360.0]
[293.0, 297.0, 296.0, 112.0, 295.0]
[1099, 1102, 1098, 804, 1104]
p02683
u075303794
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import sys\nimport numpy as np\n\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\n\nN,M,X = map(int, readline().split())\ndata = np.array(read().split(), np.int64)\ndata = data.reshape(N,-1)\nC = data[:,0]\nA = data[:,1:]\n\ncost = np.zeros(1<<N, np.int64)\n...
['Runtime Error', 'Accepted']
['s707915023', 's050048472']
[27284.0, 27376.0]
[109.0, 106.0]
[564, 565]
p02683
u079022693
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['from sys import stdin\ndef main():\n \n readline=stdin.readline\n n,m,x=map(int,readline().split())\n c=[]\n a=[]\n for i in range(n):\n ca=list(map(int,readline().split()))\n c.append(ca[0])\n a.append(ca[1:])\n\n print(c)\n print(a)\n \n min_res=float("inf")\n f...
['Wrong Answer', 'Accepted']
['s847892688', 's819442580']
[9256.0, 9260.0]
[62.0, 61.0]
[816, 789]
p02683
u082978753
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import itertools\nimport numpy as np\n\nN, M, X = map(int, input().split())\nlis_all = [list(map(int, input().split())) for _ in range(N)]\n\nlis_C = np.array(list(map(lambda x: x[0], lis_all)))\nlis_A = np.array(list(map(lambda x: x[1:], lis_all)))\n\nrow_idx = []\nbools = [True,False]\nfor boollis in itertools.prod...
['Runtime Error', 'Accepted']
['s920738723', 's908333082']
[27540.0, 27632.0]
[110.0, 161.0]
[588, 589]
p02683
u091489347
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["print('-1')", "import numpy as np\nn, m, x = map(int, input().split())\nl = []\nfor i in range(n):\n l += [list(map(int, input().split()))]\n\na = 1 <<(n )\nr = []\nfor i in range(a):\n li = np.array([0 for _ in range(m +1)])\n for j in range(n):\n if i & (1 << j):\n li += l[j]\n# print...
['Wrong Answer', 'Accepted']
['s748133214', 's376251054']
[9116.0, 27248.0]
[24.0, 203.0]
[11, 470]
p02683
u093783313
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import itertools\nA,B,C = map(int,input().split())\n\n\na=[]\nfor i in range(A):\n a.append(list(map(int,input().split())))\nprint(a)\na.sort() \nprint(a)\n\nresult = []\nfor n in range(1,len(a)+1):\n for conb in itertools.combinations(a, n):\n result.append(list(conb)) \nprint(result)', 'import numpy...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s355900523', 's574797002', 's289454400']
[13828.0, 30444.0, 30056.0]
[61.0, 404.0, 171.0]
[321, 702, 708]
p02683
u094999522
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['n,m,x = map(int, input().split())\nc, a = [0]*n, [0]*n\nfor i in range(n):\n c[i],*a[i] = map(int, input().split())\n\nb = [[a[j][i] for j in range(n)] for i in range(m)]\ns = [sum(i) for i in b]\nif min(s) < x:\n print(-1)\n exit()\nwhile min(s) >= x:\n mind = c.index(max(c))\n for i in b:\n de...
['Wrong Answer', 'Accepted']
['s062362324', 's626408501']
[9156.0, 9332.0]
[24.0, 162.0]
[392, 419]
p02683
u099300899
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['# -*- coding: utf-8 -*-\n\nN, M, X = map(int, input().split())\nC = [input().split() for l in range(N)]\n\nmoney = -1\ntotal = 0\nX_list = [0]*M\n\nfor i in range(N):\n total += int(C[i][0])\n for j in range(M):\n X_list[j] += int(C[i][j+1])\n\ncount = 0\nfor i in X_list:\n if (i >= X):\n count...
['Wrong Answer', 'Accepted']
['s899872352', 's139054301']
[9208.0, 9192.0]
[23.0, 83.0]
[640, 538]
p02683
u100800700
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['n,m,x = map(int,input().split())\nC = [0]*n\nA = [[0]*m for i in range(n)]\nfor i in range(n):\n b = list(map(int,input().split()))\n C[i] = b[0]\n for j in range(1,m+1):\n A[i][j-1] = b[j]\n \nMAX = 100000000000\ndef dfs(a,c,i):\n if min(a)>=x:\n return cost\n elif i == n:\n re...
['Runtime Error', 'Accepted']
['s723012110', 's160167911']
[9168.0, 9244.0]
[31.0, 30.0]
[486, 465]
p02683
u103520789
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import itertools\n\nN,M,X = map(int, input().split())\nC_A = []\nfor _ in range(N):\n C_A.append(list(map(int, input().split())))\n# print(C_A)\n\nmin_price = 10**5 * 12 \nrikaido = [0 for _ in range(M)]\n\nfor i in itertools.product([0,1], repeat=N):\n price_rikaido = [sum(C_A[j][k]*i[j] for j in range(N)) for...
['Wrong Answer', 'Accepted']
['s110213193', 's831718792']
[9116.0, 9240.0]
[126.0, 112.0]
[635, 659]
p02683
u107915058
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['ans = float("inf")\nfor i in range(1<<n):\n mokuhyo = [0]*m\n cost = 0\n for j in range(n):\n if i>>j&1:\n for r in range(m):\n mokuhyo[r] += c[j][r+1]\n cost += c[j][0]\n for k in mokuhyo:\n if k < x:\n break\n else:\n ans = ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s163567146', 's388096904', 's952460295']
[8964.0, 9128.0, 9100.0]
[26.0, 24.0, 97.0]
[364, 316, 408]
p02683
u108072608
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["n, m, x = map(int, input().split())\nca = [list(map(int, input().split())) for _ in range(n)]\n\n\nmost_row_price = 10**10\nfor i in range(2**n):\n comb = str(bin(i)[2:]).zfill(n)\n \n \n money_per_pattern = [0] * n \n total_money = 0 \n for j in range(n):\n \n \n if comb[j] == ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s746233710', 's809474880', 's838350151']
[9220.0, 27272.0, 9116.0]
[26.0, 105.0, 94.0]
[1018, 329, 993]
p02683
u110199424
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["import numpy as np\n\nN, M, X = map(int, input().split())\n\ndata = [list(map(int, input().split())) for _ in range(N)]\nINF = float('int')\n\ndata_all = []\nc_min = INF\n\nfor i in range(2**N):\n data_tmp = [0]*M\n c = 0\n for j in range(N):\n if((i>>j) & 1):\n for k in range(M):\n ...
['Runtime Error', 'Accepted']
['s859970269', 's676183450']
[27140.0, 27080.0]
[108.0, 169.0]
[483, 483]
p02683
u111473084
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['INF = 10**18\n\nn, m, x = map(int, input().split())\ncosts = []\na = []\nfor i in range(n):\n cost, *tmp = map(int, input().split())\n costs.append(cost)\n a.append(tmp)\n\nans = INF\nfor i in range(1 << n):\n cost = 0\n ms = [0] * m\n for j in range(n):\n if (i >> j) & 1 == 1:\n c...
['Wrong Answer', 'Accepted']
['s035697537', 's829512274']
[9256.0, 9232.0]
[84.0, 82.0]
[601, 577]
p02683
u111652094
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import sys\nfrom itertools import combinations\n\nN,M,X = map(int,input().split())\nCA = [list(map(int,input().split())) for _ in range(N)]\nA=[0]*(M+1)\n\nfor i in range(N):\n for j in range(1,M+1):\n A[j]+=CA[i][j]\n\nfor i in A:\n if i <X:\n print(-1)\n sys.exit()\n\nans=sum(A)\n\nfor i ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s099255565', 's351737563', 's777446397']
[9248.0, 9252.0, 9160.0]
[22.0, 78.0, 76.0]
[577, 592, 612]
p02683
u123872895
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import numpy as np\nfrom numpy import array\n\n\nn, m, x = list(map(int, input().split()))\na = []\nfor i in range(n):\n a.append(list(map(int, input().split())))\n\na = array(a)\n\nc_min = 1e5 * n\nflag = False\n\nfor i in range(1, n ** 2 + 1):\n j = str(bin(i))\n\n b = np.zeros(m+1)\n\n for k in range(n...
['Runtime Error', 'Accepted']
['s495687029', 's537601793']
[27160.0, 27252.0]
[108.0, 167.0]
[480, 557]
p02683
u125799132
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['from itertools import product\n[N, M, X] = [int(i) for i in input().split()]\nbk = [[int(i) for i in input().split()] for _ in range(N)]\n\nans = 12*10**5\nfor seq in product(range(2), repeat=N):\n S = [0]*(M+1)\n for i in range(N):\n for j in range(M+1):\n S[j] += seq[i]*bk[i][j]\n print(S, ...
['Wrong Answer', 'Accepted']
['s305683538', 's375507009']
[9156.0, 9152.0]
[180.0, 165.0]
[388, 419]
p02683
u139940813
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import numpy as np\nN,M,X= map(int,input().split())\na = []\nd = 0\ne = False\nf = []\nz = 0\nfor i in range(N):\n a.append([])\n\nfor i in range(N):\n a[i]= [int(i) for i in input().split()]\n\nfor i in range(2 ** N):\n b = np.array([0 for _ in range(M + 1)])\n d = True\n for j in range (N):\n\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s510726536', 's829731909', 's108524188']
[27532.0, 27492.0, 27296.0]
[387.0, 384.0, 190.0]
[557, 557, 544]
p02683
u140191608
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['N, M, X = map(int, input().split())\nC = [0] * N\nAA = [list(map(int, input().split())) for i in range(N)]\nfor i in range(len(AA)):\n C[i] = AA[i][0]\n A[i] = AA[i][1:]\nans = sum(C) + 1\nfor p in range(2 ** N):\n Y = [0] * M\n cnt = 0\n for i, c in enumerate(C):\n if p % 2 == 1:\n c...
['Runtime Error', 'Accepted']
['s985296994', 's657207081']
[9220.0, 9128.0]
[21.0, 76.0]
[480, 871]
p02683
u141574039
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import itertools\nN,M,X=map(int,input().split())\nA=[0]*(N);C=[0]*(N);c=0;D=[0]*(M);m=10**5;n=0;x=[];z=0;R=[0]*N;f=-1;cost=10**5;p=0\nfor i in range(N):\n S=list(map(int,input().split()))\n C[i]=S[0]\n A[i]=S[1:len(S)]\n#print(C)\n#print(A)\nfor i in range(len(C)):\n x.append(i)\n\nfor i, _ in enumerate(x, 1): ...
['Wrong Answer', 'Accepted']
['s752978564', 's939765182']
[9124.0, 9408.0]
[2205.0, 110.0]
[650, 594]
p02683
u152402277
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['N, M, X = map(int, input().split())\nbook_list = []\n\nfor i in range(N):\n book_list.append(list(map(int, input().split())))\n\nprint("-1")\n', 'N, M, X = map(int, input().split())\nbook_list = []\ncost = [0] * (2 ** N)\n\ncost_parform = []\nfor i in range(N):\n book_list.append(list(map(int, input().split()))...
['Wrong Answer', 'Accepted']
['s650757555', 's981171713']
[9164.0, 9220.0]
[20.0, 96.0]
[138, 784]
p02683
u163783894
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import numpy as np\n\nN, M, X = map(int, input().split())\nC = np.zeros(N)\nA = np.zeros((N, M))\n\n\nfor n in range(N):\n s = list(map(int, input().split()))\n C[n] = s[0]\n A[n] = s[1:]\n\nC_MIN = -1\nfor i in range(2 ** N):\n C_SUM = 0\n A_SUM = np.zeros(M)\n for j in range(N):\n if ((i >>...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s294031698', 's389503822', 's065871500']
[27172.0, 27184.0, 27244.0]
[180.0, 167.0, 168.0]
[534, 534, 529]
p02683
u163829702
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["N, M, X = map(int, input().split())\n\nC = []\nA = [[] for _ in range(M)]\nfor i in range(N):\n arr = list(map(int, input().split()))\n C.append(arr[0])\n for j in range(M):\n A[j].append(arr[j+1])\n\ncount = 0\nfor i in range(M):\n if X <= sum(A[i]):\n count += 1\n\nans = [sum(A[i]) for i i...
['Wrong Answer', 'Accepted']
['s269396389', 's775597058']
[9268.0, 9160.0]
[22.0, 81.0]
[746, 463]
p02683
u166340293
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['N,M,X=map(int,input().split())\nl=[]\nfor i in range (N):\n l.append(list(map(int,input().split())))\nans=10000000\nfor i in range(2**N):\n score=[0]*M\n coin=0\n for j in range(N):\n if i>=2**(N-1-j):\n for p in range(M):\n score[p]+=l[j][p+1]\n coin+=l[j][0]\n i-=2**(N-1-j)\n flag=0\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s641462976', 's654927112', 's932462503']
[9000.0, 9236.0, 9212.0]
[20.0, 22.0, 103.0]
[450, 407, 451]
p02683
u167908302
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['# coding:utf-8\nn, m, x = map(int, input().split())\n\nbook = [list(map(int, input().split())) for _ in range(n)]\nall_book = [0] * m\n\nfor i in range(0, n):\n for j in range(0, m):\n all_book[j] += book[i][j]\n\nfor i in range(1, m):\n if all_book[i] < x:\n print(-1)\n exit()\n\nprice = a...
['Wrong Answer', 'Accepted']
['s482748082', 's880252233']
[9232.0, 9148.0]
[22.0, 92.0]
[542, 515]
p02683
u168139048
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["import sys\nsys.setrecursionlimit(10000000)\nINF = 10 ** 10\nans = INF\n\n\ndef rec(A, C, X, idx, ability, sum_):\n if idx == len(A):\n for i in range(len(ability)):\n if ability[i] < X:\n break\n else:\n global ans\n ans = min(sum_, ans)\n else:\n ...
['Wrong Answer', 'Accepted']
['s609914876', 's765465148']
[9304.0, 27260.0]
[35.0, 260.0]
[944, 732]
p02683
u168832623
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import numpy as np\nimport itertools\n \nN, M, X = list(map(int, input().split()))\nArr = np.zeros((N,M+1))\nList = np.zeros(M)\n \nfor i in range(N):\n Arr[i] = list(map(int, input().split()))\n \nfor j in range(M):\n List[j] = np.sum(Arr[:,j])\n\nif np.any(List<10):\n print(-1)\n\nelse:\n List = sort...
['Runtime Error', 'Runtime Error', 'Accepted']
['s114200990', 's577663317', 's489246298']
[27248.0, 27152.0, 9220.0]
[106.0, 110.0, 88.0]
[478, 451, 414]
p02683
u174181999
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import itertools\n \nN, M, X = map(int, input().split())\nl = []\nfor _ in range(N):\n l.append(list(map(int, input().split())))\n\nb = [i for i in range(N)]\nn = len(b)\n\nb_pairs = []\nfor i in range(1, n+1):\n b_pairs += list(itertools.combinations(b, i))\n\ncnt = 0\nA = [0] * M\nB = []\nC = []\nfor i in range...
['Wrong Answer', 'Accepted']
['s089080246', 's760261721']
[11792.0, 11772.0]
[109.0, 100.0]
[869, 839]
p02683
u174523836
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["from copy import deepcopy\n\nN, M, X = [int(i) for i in input().split()]\n\nCAS = [[int(i) for i in input().split()] for _ in range(N)]\n\n\nok = False\nmi = [float('inf'), *[0]*(M-1)]\n\nfs = '{:0' + str(N-1) + 'b}'\n\nfor i in range(2**N):\n s = fs.format(i)\n t = [0]*M\n for i, f in enumerate(s):\n if f == '...
['Wrong Answer', 'Accepted']
['s181848903', 's149324908']
[9284.0, 9248.0]
[65.0, 65.0]
[467, 417]
p02683
u182898140
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['n,m,x=map(int,input().split())\nc=[list(map(int,input().split())) for _ in range(n)]\nresult=-1\nfor i in range(2**n):\n t=[0]*m\n money=0\n for j in range(n):\n if (i>>j)&1==0:\n continue\n money+=c[j][0]\n for k in range(1,m):\n t[k]+=c[j][k]\n if all(xx>=x for xx in t):\n if result==-1:\n...
['Wrong Answer', 'Accepted']
['s480615412', 's238311460']
[9200.0, 9252.0]
[78.0, 101.0]
[377, 432]
p02683
u185325486
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['N,M,X = map(int, input().split())\nA = np.array([[int(i) for i in input().split()] for _ in range(N)])\ntotal = np.sum(A,axis=0)\nflag = True if all((a>=X for a in total[1:])) else False\nans = total[0]\n\nif flag:\n for i in range(1,N+1):\n for v in itertools.combinations([i for i in range(N)], i):\n ...
['Runtime Error', 'Accepted']
['s549910051', 's110428663']
[9236.0, 27316.0]
[27.0, 167.0]
[532, 651]
p02683
u186542450
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import itertools\nimport sys\nimport numpy as np\n\nN, M, X = map(int, input().split())\nC = []\nfor n in range(N):\n C.append(list(map(int, input().split())))\n\nresult = []\nfor n in range(2 ** N):\n ii = [0] * N\n for i in range(N):\n if (n >> i) & 1:\n ii[i] = 1\n # print(ii)\n tm...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s194335867', 's403138764', 's424231967']
[29048.0, 29204.0, 28660.0]
[217.0, 229.0, 219.0]
[691, 722, 672]
p02683
u190167135
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import numpy as np\nN,M,X=map(int,input().split())\nallList=[]\nfor _ in range(N):\n allList.append(np.array(list(map(int,input().split()))))\nminnum=10**7\nfor i in range(2**N):\n skill=[0]*(M+1)\n flag=True\n for row in range(N):\n if i&(2**row)>0:\n skill+=allList[row]\n for i in r...
['Runtime Error', 'Accepted']
['s865617335', 's608186676']
[27132.0, 27176.0]
[117.0, 173.0]
[457, 457]
p02683
u193264896
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["import sys\nfrom itertools import product\nimport numpy as np\nreadline = sys.stdin.buffer.readline\nsys.setrecursionlimit(10 ** 8)\nINF = float('inf')\nMOD = 10 ** 9 + 7\n\ndef main():\n N, M, X = map(int, readline().split())\n CA = list(list(map(int, readline().split())) for _ in range(N))\n CA = np.array(...
['Wrong Answer', 'Accepted']
['s069042676', 's073823729']
[27368.0, 27308.0]
[155.0, 152.0]
[659, 642]
p02683
u194228880
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["nmx = input('')\nn = int(nmx.split(' ')[0])\nm = int(nmx.split(' ')[1])\nx = int(nmx.split(' ')[2])\n\nclist=[]\nalist=[]\nfor i in range(n):\n ca = input('')\n c = ca.split(' ')[0]\n clist.append(c)\n a = []\n for j in range(1,m+1):\n a.append(ca.split(' ')[j])\n alist.append(a)\n\nmin_price...
['Wrong Answer', 'Accepted']
['s057212040', 's886888845']
[9168.0, 9136.0]
[135.0, 122.0]
[871, 872]
p02683
u196629968
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['nmx=list(map(int, input().split()))\nN=nmx[0]\nM=nmx[1]\nX=nmx[2]\nmylist=[]\nfor i in range(N):\n mylist.append(list(map(int, input().split())))\nAns=10000*12+1\nfor i in range(2**N):\n A=[[0]*M]\n C=0\n for j in range(N):\n if (i>>j) & 1:\n C+=mylist[j][0]\n for k in range(M...
['Runtime Error', 'Accepted']
['s185856565', 's013255336']
[9080.0, 9164.0]
[25.0, 87.0]
[447, 442]
p02683
u199830845
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import sys\nimport numpy as np\nfrom itertools import combinations\nsys.setrecursionlimit(10 ** 6) \nto_index = lambda x: int(x) - 1 \nprint_list_in_2D = lambda x: print(*x, sep="\\n") \n\n\ndef input_int():\n return int(input())\n\ndef map_int_input():\n return map(int, input())\n\nMII = map_int_input\n\nde...
['Wrong Answer', 'Accepted']
['s143014357', 's833291253']
[27364.0, 27248.0]
[195.0, 189.0]
[1782, 1786]
p02683
u204208382
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import numpy as np\nn,m,x = map(int,input().split())\ninfo = []\nfor i in range(n):\n info.append(list(map(int,input().split())))\ninfo = np.array(info)\n\n\nmoney = 10000000000\nflag = 0\nfor i in range(2**n):\n tem = np.zeros(m+1)\n for j in range(n):\n if ((i >> j) & 1):\n tem += info[j]...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s014289512', 's119357355', 's171221886', 's376478403', 's574455933', 's899457354', 's916174668', 's656393930']
[27108.0, 27288.0, 27288.0, 27268.0, 27328.0, 27296.0, 27296.0, 27312.0]
[175.0, 174.0, 176.0, 174.0, 172.0, 174.0, 170.0, 158.0]
[488, 492, 510, 527, 486, 492, 502, 515]
p02683
u205762924
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['def intlist(x):\n y = []\n for i in range(len(x)):\n y.append(int(x[i]))\n return y\n \nN, M, X = map(int, input().split())\nprice = -1\n\nL = []\na = []\n\nsuit =[]\nfor i in range(M+1):\n a.append(0)\n \n\n# suit.append([])\n\nfor i in range(N):\n text = input().split()\n L.append(int...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s086662929', 's590559543', 's746991527', 's841064457', 's135320324']
[11304.0, 11268.0, 11200.0, 9312.0, 11296.0]
[2206.0, 2206.0, 2206.0, 23.0, 95.0]
[1606, 1502, 1504, 1033, 910]
p02683
u213497190
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
["import itertools\nmin_price = 10**9\nfor k in range(n):\n for comb in itertools.combinations(range(m), k+1):\n sums = [0] * m\n price = 0\n for c in comb:\n price += C[c]\n for i in range(m):\n sums[i] += A[c][i]\n\n# print(comb)\n# print(su...
['Runtime Error', 'Accepted']
['s085950154', 's383855729']
[9144.0, 9260.0]
[26.0, 77.0]
[472, 644]
p02683
u220499476
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['import sys\n\nn, m, x =map(int,input().split())\ng = []\nfor _ in range (n):\n array = list(map(int,input().split()))\n g.append(array)\nprint(g)\n', 'n, m, x =map(int,input().split())\ns = [list(map(int, input().split())) for _ in range(n)]\nans = 10000000\nfor i in range(2 ** n):\n bag = [0]*(m+1)\n for j...
['Wrong Answer', 'Accepted']
['s264122784', 's773916052']
[9172.0, 9220.0]
[20.0, 88.0]
[212, 386]
p02683
u220875888
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['#! /usr/bin/env python3\n# -*- coding:utf-8 -*-\n\ndef min_needed_value(values, skills, X):\n cand = []\n for i in range(2**len(values)):\n get_skill = [0] * len(skills[0])\n get_value = 0\n for j in range(len(values)):\n if (i >> j) & 1:\n get_skill = [x + y for (...
['Wrong Answer', 'Accepted']
['s269646817', 's171776824']
[9356.0, 9228.0]
[54.0, 52.0]
[830, 880]
p02683
u227085629
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['n,m,x = map(int,input().split())\nc_list = [list(map(int,input().split())) \n for nesya in range(n)]\narugo = [0]*m\nhoge = 0\nwhile c in c_list:\n arugo[0] += c[1]\n arugo[1] += c[2]\n arugo[2] += c[3]\n hoge += c[0]\nif arugo[0] < 10 or arugo[1] < 10 or arugo[2] < 10:\n print(-1)\nelse:\n print(hoge)...
['Runtime Error', 'Runtime Error', 'Accepted']
['s090383654', 's272793388', 's166067317']
[9208.0, 9208.0, 9212.0]
[24.0, 23.0, 65.0]
[305, 303, 514]
p02683
u229518917
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['from itertools import*\nN,M,X=map(int,input().split())\nC=[list(map(int,input().split())) for i in range(N)]\nans=100**10000\nfor i in range(N+1):\n a=list(combinations(C,i))\n for s in a:\n print(s)\n A=[0 for d in range(M)]\n flag=True\n for k in range(M):\n for u in ran...
['Wrong Answer', 'Accepted']
['s846457139', 's877835053']
[9456.0, 9172.0]
[126.0, 99.0]
[588, 363]
p02683
u231095456
2,000
1,048,576
Takahashi, who is a novice in competitive programming, wants to learn M algorithms. Initially, his _understanding level_ of each of the M algorithms is 0. Takahashi is visiting a bookstore, where he finds N books on algorithms. The i-th book (1\leq i\leq N) is sold for C_i yen (the currency of Japan). If he buys and r...
['C = []\nA = []\nfor _ in range(N):\n l = list(map(int,input().split()))\n C.append(l[0])\n A.append(np.array(l[1:]))\nans = 10**100\nfor i in range(2**N):\n rikaido = np.zeros(M)\n c = 0\n for j in range(N):\n if (i >> j) & 1:\n c += C[j]\n rikaido += A[j]\n if all([x...
['Runtime Error', 'Accepted']
['s507040426', 's352138382']
[9144.0, 27096.0]
[29.0, 172.0]
[392, 444]