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
p02683
u233254147
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 = list(map(int, input().split()))\nall_list = []\nfor i in range(n):\n tmp = list(map(int, input().split()))\n all_list.append(tmp)\n\nok = False\ncur_price = (10 ** 5) * n + 1\nfor i in range(1, n + 1):\n answers = list(itertools.combinations(range(n), i))\n # print(answers)\n...
['Wrong Answer', 'Accepted']
['s835549821', 's652821985']
[9292.0, 9328.0]
[59.0, 50.0]
[756, 758]
p02683
u234189749
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 = [list(map(int,input().split())) for i in range(N)]\n\nz = [i for i in range(1, N)]\nm = [1000000000000000000]\n\nfor i in range(N):\n x = list(itertools.combinations(z,i+1))\n\n for s in x:\n for k in range(1,M+1):\n C = sum(A[j-1][k] for...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s564079134', 's656255821', 's936643788']
[9340.0, 9300.0, 9500.0]
[41.0, 45.0, 63.0]
[473, 494, 478]
p02683
u250795848
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\ndef main():\n n,m,r = map(int, input().split())\n dn = [[0] * m for _ in range(n)]\n \n for i in range(n):\n dn[i][:] = map(int, input().split())\n\n dn = np.array(dn)\n cost = []\n sh = 0\n inf = 10e8\n cost = inf\n k = np.zeros(m+1)\n \n def secom(j,k,c...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s037342768', 's723078149', 's911062144']
[27352.0, 9256.0, 9228.0]
[635.0, 25.0, 28.0]
[830, 811, 433]
p02683
u257856080
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 operator import add\nN,M,X = map(int, input().split())\ntmp = [list(map(int,list(input().split()))) for i in range(N)]\nc= []\na = [[] for i in range(N)]\nresult = []\nfor i in range(N):\n c.append(tmp[i][0])\n a[i].extend(tmp[i][1:])\n\nprint(c,a)\nfor bit in range(1 << (N)):\n suma = [0] * M\n disc...
['Wrong Answer', 'Accepted']
['s195983639', 's178038257']
[9208.0, 9284.0]
[49.0, 56.0]
[634, 848]
p02683
u266014018
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())\nC = []\nA = np.zeros((N, M), dtype=int)\nfor i in range(N):\n c, *a = map(int, input().split())\n C.append(c)\n A[i] = a\n\nS = np.sum(A, axis=0)\nprint(A)\nprint(S)\nif True in (S < X):\n print(-1)\n exit(0)\n\nmlt = [0]*12\nC_ = []\nfor i in ra...
['Wrong Answer', 'Accepted']
['s169446870', 's745899155']
[27376.0, 27344.0]
[159.0, 156.0]
[541, 510]
p02683
u268822556
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())\nbook_lists = [list(map(int, input().split())) for i in range(N)]\nno_skill_flg = True\nfor i in range(1, N+1):\n for j in itertools.combinations(book_lists,i):\n sum_list = [0 for _ in range(M+1)]\n for book_date in j:\n for k, l in en...
['Wrong Answer', 'Accepted']
['s054462985', 's573247194']
[9232.0, 9284.0]
[80.0, 31.0]
[637, 428]
p02683
u273038590
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=[]\nfor i in range(n):\n\tt = list(map(int, input().split()))\n\tC.append(t[0])#price of books\n\tA.append(t[1:])#point of books\n\t\nresult = -1 \n\nfor i in range(1<<n):\n\tt = [0] * m \n\tc = 0 \n\t\n\tfor j in range(n):\n\t\tif (i>>j)&1:\n\t\t\tfor k in range(m):\n\t\t\...
['Runtime Error', 'Runtime Error', 'Accepted']
['s329121889', 's457132401', 's448673740']
[9220.0, 9152.0, 9168.0]
[23.0, 25.0, 82.0]
[668, 415, 435]
p02683
u273345915
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 A=[list(map(int, input().split())) for _ in range(N)]\n ans=10**10**10\n for i in range(2**N):\n b=i+2**N\n c=0\n l=[0]*M\n ok=True\n for j in range(N):\n if b>>j&1 == 1:\n c+=A[j][0]\n ...
['Time Limit Exceeded', 'Accepted']
['s449024275', 's560210485']
[16904.0, 9236.0]
[2206.0, 65.0]
[554, 549]
p02683
u279266699
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\nn, m, x = map(int, input().split())\nl = [list(map(int, input().split())) for _ in range(n)]\nl = sorted(l)\nl = np.array(l)\nprint(l)\nans = np.sum(l, 0)[0]\nans_s = np.sum(l, 0)\nif np.any(ans_s[1:] < x):\n print(-1)\n exit()\ncount = 0\nfor i in range(1, m + 1):\n for...
['Wrong Answer', 'Accepted']
['s472941600', 's428010685']
[27224.0, 27336.0]
[152.0, 156.0]
[488, 425]
p02683
u284155299
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 = []\nA = []\nfor _ in range(N):\n CA = list(map(int,input().split()))\n C.append(CA[0])\n A.append(CA[1:])\n\nans = float('inf')\nfor i in range(2**N):\n Level = [0]* M\n Cost = 0\n \n for j in range(N):\n if (i>>j)&1:\n Cost += C[j]\n ...
['Runtime Error', 'Accepted']
['s511196802', 's183517710']
[9072.0, 9172.0]
[22.0, 87.0]
[423, 520]
p02683
u284363684
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...
["# input\nN, M, X = map(int, input().split())\n\nbooks = []\nappend = books.append\nmax_exp = [0] * M\nfor i in range(N):\n\n CA = list(map(int, input().split()))\n\n append(\n {\n 'price': CA[0],\n 'get_exp': CA[1:],\n 'koritsu': sum(CA[1:]) / CA[0]\n }\n )\n ...
['Wrong Answer', 'Accepted']
['s145903035', 's018239013']
[9220.0, 9248.0]
[24.0, 54.0]
[987, 1222]
p02683
u289102924
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]*m] *n\nfor i in range(n):\n c[i] = list(map(int, input().split()))\nans = 1000000\nshoki = [0] * (m + 1)\n\n\n\ndef check(xxx):\n tmp = 0\n for i in range(1,m):\n if x > xxx[i]:\n tmp = 1\n if tmp == 0:\n return True\n else:\n ...
['Runtime Error', 'Accepted']
['s919719143', 's021839451']
[9268.0, 9324.0]
[35.0, 34.0]
[733, 534]
p02683
u289288647
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 = (int(x) for x in input().split())\nval = []\nfor i in range(N):\n exec("c%d = input().split()" % N)\n exec("val.append(c%d)" % N)\n\nexec("tol=[0]*%d" % (M+1))\nval = sorted(val)\nprint(val)\n\n\nfor i in val:\n for j, k in enumerate(i):\n tol[j] += int(k)\n\n for m,...
['Wrong Answer', 'Accepted']
['s720299420', 's735725484']
[27148.0, 9272.0]
[117.0, 72.0]
[472, 659]
p02683
u290187182
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...
["\ndef sumList(index,array):\n if index ==n:\n sumArray.append(array)\n else:\n sumList(index+1,array)\n nextArray =[0]*(m+1)\n for i in range(m+1):\n nextArray[i] +=array[i]+ list[index][i]\n sumList(index+1,nextArray)\n\n\n\nif __name__ == '__main__':\n n,m,x = ...
['Wrong Answer', 'Accepted']
['s277122930', 's341001307']
[12204.0, 10972.0]
[48.0, 42.0]
[912, 889]
p02683
u291988695
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=[[0]]*n\nln=[0]*m\nkan=0\nfor i in range(n):\n l[i]=list(map(int,input().split()))\n for j in range(m+1):\n if j==0:\n kan+=l[i][j]\n else:\n ln[j-1]+=l[i][j]\nif sorted(ln)[0]<x:\n print(-1)\nelse:\n mkan=-1\n for i in range(n):\n itr=iterto...
['Runtime Error', 'Accepted']
['s966618487', 's276132047']
[9260.0, 9256.0]
[23.0, 101.0]
[576, 582]
p02683
u297089927
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 combinations as co\nn,m,x=map(int,input().split())\nA=[[] for i in range(m)]\nansl=[]\nfor i in range(n):\n A[i].append(map(int,input().split()))\nfor i in range(n):\n for j in range(1,m+1):\n if A[i][j]<x:\n break\n if j==m:\n ansl.append(A[i][0])\n\nif...
['Runtime Error', 'Accepted']
['s890034694', 's145220833']
[9064.0, 9352.0]
[22.0, 53.0]
[3504, 711]
p02683
u303344598
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())\nfor i in range(n):\n c.append(list(map(int,input().split())))\nprint(c)\nresult = -1\nfor i in range(2 ** n):\n ct = 0\n t = [0] * m\n for b in range(1, n + 1):\n if i & b > 0:\n ct += c[b - 1][0]\n for j in range(1, m + 1):\n t[j - 1] += c[b - 1][j]\n if res...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s448451906', 's562224384', 's479639130']
[9228.0, 9220.0, 9148.0]
[26.0, 92.0, 94.0]
[466, 480, 469]
p02683
u304058693
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 = list(list(map(int, input().split())) for _ in range(n))\n\n#print(n, m, x, a)\n\n\ncost_abl = []\ncost_lis = []\nabl_lis = []\nfor i in range(1 << n):\n cost = 0\n abl_sum = [0] * m\n #print(abl_sum)\n \n for j in range (len(a)):\n mask = 1 << j\n ...
['Wrong Answer', 'Accepted']
['s420172856', 's113105342']
[12032.0, 11308.0]
[104.0, 97.0]
[924, 925]
p02683
u305349402
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 combinations\n \nN, M, X = list(map(int,input().split()))\nA = []\nfor i in range(N):\n A.append(list(map(int,input().split())))\nsum = []\nsubsets=[]\nfor i in range(len(A) + 1):\n for c in combinations(A, i):\n subsets.append(list(c))\n \nfor i in subsets:\n tmp = [0]*(M+1)\n if l...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s175870536', 's596562145', 's737334492', 's978987875', 's231542788']
[12000.0, 13956.0, 9100.0, 9104.0, 11796.0]
[74.0, 90.0, 21.0, 24.0, 65.0]
[706, 696, 764, 745, 738]
p02683
u306516971
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 = [list(map(int, input().split())) for i in range(N)]\nli = []\nfor i in range(N+1):\n for j in itertools.combinations(range(N), i):\n sm = [0] * (M+1)\n for k in j:\n for l in range(M+1):\n sm[l] += a[k][l]\n i...
['Wrong Answer', 'Accepted']
['s329283738', 's723931760']
[9396.0, 9276.0]
[81.0, 81.0]
[432, 422]
p02683
u307592354
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 resolve():\n N,M,X = map(int,input().split())\n CA = [list(map(int,input().split())) for i in range(N)]\n mxc = float(\'inf\')\n for r in range(N+1):\n for cmb in itt.combinations(CA,r):\n cost = 0\n tbl = [0]*M\n for x in cmb:\n cost+=x[0]\n ...
['Runtime Error', 'Accepted']
['s931969488', 's832432529']
[9004.0, 9216.0]
[23.0, 52.0]
[640, 665]
p02683
u307622233
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\ninput = sys.stdin.readline\n\n\ndef main():\n n, m, x = map(int, input().split())\n lst = [[int(i) for i in input().split()] for _ in range(n)]\n\n ans = []\n for i in range(1 << n):\n understand = []\n money = 0\n for j in range(n):\n if (i >> j) & 1 == 0:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s536433980', 's663947605', 's828951871']
[9216.0, 8992.0, 9108.0]
[26.0, 24.0, 60.0]
[566, 688, 813]
p02683
u309120194
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)]\n \n\nans = 10**10\nfor i in range(2**N):\n U = [0]*(M+1)\n for j in range(N):\n if ((i >> j) & 1):\n for k in range(M+1):\n U[k] += C[j][k]\n \n \n if sum([u >= X for u in U[1:]]) == M:\n ans = min(a...
['Runtime Error', 'Runtime Error', 'Accepted']
['s097830653', 's900877339', 's844343625']
[8896.0, 9156.0, 9204.0]
[25.0, 90.0, 102.0]
[536, 539, 558]
p02683
u311113280
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\nN,M,X=map(int,input().split())\nL=[list(map(int,input().split())) for i in range(N)]\n#print(L)\nprice=[]\nlist_X=[X for i in range(M)]\nprint(list_X)\nfor i in range(2**N):\n A=[0 for i in range(M+1)]\n for j in range(N):\n if (i>>j) & 1:\n A = [x+y for (x,y) in zip(A,L[j])] \n #print(A)\n la...
['Wrong Answer', 'Accepted']
['s882986548', 's672918508']
[9172.0, 9136.0]
[62.0, 64.0]
[532, 533]
p02683
u314089899
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...
['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(A-(K-A-B))\n \n \n \n \nN,M,X = map(int, input().split())\nCA_array = list()\nfor i in range(N):\n CA_list = [int(e) for e in input().split()]\n CA_array.append(CA_list)\n \nans = 13*(10**...
['Runtime Error', 'Accepted']
['s854563058', 's737597285']
[9176.0, 9216.0]
[24.0, 98.0]
[1043, 909]
p02683
u317779196
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\nn,m,x = map(int, input().split())\nca = np.zeros((n,m+1))\nfor i in range(n):\n ca[i] = [int(i) for i in input().split()]\n\n\np = itertools.product([True,False], repeat = n)\nans = []\nfor i in p:\n ca_cut = ca[i,:]\n if len(ca_cut) == 0: \n continue\n ca_cut_...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s034023898', 's245618675', 's420307907', 's655897826']
[27252.0, 27176.0, 27332.0, 27280.0]
[156.0, 154.0, 153.0, 150.0]
[656, 469, 613, 725]
p02683
u321096814
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# Your code here!\nimport itertools\nimport sys\nN, M, X = map(int, input().split())\nmoney = []\nA = []\nans = 0\nfor _ in range(N):\n nums = [int(x.strip()) for x in input().split(' ') ]\n money.append(nums[0])\n nums.pop(0)\n A.append(nums)\n \ndef run(lis, num, A, X, M):\n tmp_...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s593560153', 's972395362', 's648335085']
[9252.0, 9368.0, 9304.0]
[74.0, 77.0, 49.0]
[788, 788, 1039]
p02683
u329675280
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\n_,*_t=[list(map(int,i.split())) for i in open(0)]\nn=_[0]\nm=_[1]\nx=_[2]\ntable=np.array(_t)\nvalue=9000000\n\n\ndef boolAchieve(nums):\n for i in range(1,m+1):\n if nums[i]<x:\n return False\n return True\n\n\ntmp=np.sum(table,axis=0)\nif not boolAchieve(tmp):\n print(-1)\n exit()\...
['Wrong Answer', 'Accepted']
['s501912606', 's980917051']
[27356.0, 27672.0]
[154.0, 152.0]
[495, 548]
p02683
u336968242
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]\nlist=[input().split() for i in range(N)]\nalist=[0]*M\nfor i in range(N):\n c=int(list[i][0])\n for j in range(1,M+1):\n a=int(list[i][j])\n alist[j-1]+=a\nif min(alist)<X:\n print('-1')\nelse:\n for i in range(N):\n c...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s280609625', 's432263449', 's978679814']
[9224.0, 9280.0, 11208.0]
[24.0, 138.0, 141.0]
[381, 603, 630]
p02683
u338083088
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 copy\nN, M, X = map(int, input().split())\nC = np.zeros(N, dtype=np.uint16)\nA = np.zeros([N, M], dtype=np.unt16)\nskills = np.zeros(M, dtype=np.uint16)\nsum_skills = np.zeros(M, dtype=np.uint32)\nsum_A = np.zeros(N, dtype=np.uint32)\n\nfor n in range(N):\n CA = list(map(int, input().spl...
['Runtime Error', 'Accepted']
['s581086616', 's615874953']
[27184.0, 9244.0]
[106.0, 84.0]
[1225, 586]
p02683
u340040203
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\nn, m, x = list(map(int, input().split()))\nc = []\na = []\nprice = 0\nm_achive = [0 for _ in range(m)]\nfor i in sys.stdin:\n temp = list(map(int, i.split()))\n c.append(temp[0])\n a.append(list(temp[1:])) \n\narray = np.array(a).transpose()\n\nif(sum(array[0])>x):\n sorted(array[0...
['Wrong Answer', 'Accepted']
['s522960125', 's889102254']
[27220.0, 9220.0]
[105.0, 76.0]
[339, 482]
p02683
u343850880
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()))\nb = []\nimport numpy as np\nfor i in range(n):\n ca = list(map(int,input().split()))\n b.append(ca)\nb = np.array(b)\nans = 10**5*12\nfor i in range(1<<n):\n num = np.array([0 for j in range(m+1)])\n for k in range(n):\n if (i>>k&1)==1:\n num += b[...
['Wrong Answer', 'Accepted']
['s220389165', 's989809538']
[26680.0, 27164.0]
[1223.0, 236.0]
[443, 413]
p02683
u347640436
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\nN, M, X = map(int, input().split())\n\nC = []\nA = []\nfor i in range(N):\n t = list(map(int, input().split()))\n C.append(t[0])\n A.append(t[1:])\n\nresult = float('inf')\nfor p in product([True, False], N):\n t = [0] * M\n c = 0\n for j in range(N):\n if not...
['Runtime Error', 'Accepted']
['s944278939', 's481595753']
[9104.0, 9068.0]
[24.0, 84.0]
[480, 502]
p02683
u357949405
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)', 'N, M, X = map(int, input().split())\nA = []\nC = []\nfor _ in range(N):\n CA = list(map(int, input().split()))\n C.append(CA[0])\n A.append(CA[1::])\n\n# print(A)\n# print(C)\n\nans_money = float(\'inf\')\n# ans_algorythm = None\nfor i in range(2**(N-1)):\n bit = bin(i)[2::]\n # print("bit...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s373717575', 's466999955', 's501791229', 's111253054']
[9092.0, 9232.0, 9140.0, 9272.0]
[23.0, 46.0, 24.0, 72.0]
[9, 797, 762, 974]
p02683
u360061665
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 itertools\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, input().split(' '))\nC = []\nA = []\nfor i in range(N):\n c, *a = map(int, input().split(' '))\n C.append(c)\n A.append(np.array...
['Wrong Answer', 'Accepted']
['s144225474', 's285676759']
[27364.0, 27236.0]
[658.0, 167.0]
[619, 598]
p02683
u363825867
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 = [int(i) for i in input().split()]\nCA = [] # (C, A)\nA = []\nfor i in range(N):\n c, *a = [int(i) for i in input().split()]\n CA.append((c, a))\n\nmin_c = 12 * 10**5 + 1\nfor x in range(1, N+1):\n for ca in itertools.combinations(CA, x):\n tmp_a = [0 for _ in range(M)]\n ...
['Wrong Answer', 'Accepted']
['s364196732', 's998351182']
[9244.0, 9216.0]
[70.0, 60.0]
[579, 558]
p02683
u364027015
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=int(input())\nA=np.zeros(N+1)\na=list(map(int,input().split()))\nfor i in range(N+1):\n A[i]=a[i]\nv=0\nj=0\nk=0\nB=np.zeros(N+1)\nfor i in range(N+1):\n B[i]=N-i\nfor i in reversed(range(0, N+1)):\n j+=A[i]/(2**i)\n if i==N:\n k=A[i]\n else:\n k=min(k+A[i],2**i-np.sum(A[0:i]*(2**(B[0...
['Runtime Error', 'Accepted']
['s163801367', 's775087696']
[27148.0, 27324.0]
[112.0, 144.0]
[364, 567]
p02683
u364099990
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...
['line = input()\nN, M, X = [int(v) for v in line.split(" ")]\n\nCi, Aij = [], []\nfor i in range(N):\n line = input().split(" ")\n line = [int(v) for v in line]\n\n Ci.append(line[0])\n Aij.append(line[1:])\n\n\nans = []\ndef dfs(candidate):\n if len(candidate) == M:\n X_ = [0 for _ in range(M)]\...
['Wrong Answer', 'Accepted']
['s545016683', 's207070294']
[9228.0, 9340.0]
[21.0, 63.0]
[659, 745]
p02683
u364693468
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 bisect\nN, M, X = map(int, input().split())\nC = [0] * N\nA = [0] * N\nfor i in range(N):\n x = list(map(int, input().split()))\n C[i] = x[0]\n A[i] = [0] * M\n for j in range(M):\n A[i][j] = x[j + 1]\ncnt = [0] * (2 **N)\nans_list = []\nfor i in range(2 ** N):\n bag = []\n cnt[i] = [0...
['Runtime Error', 'Accepted']
['s282373705', 's081113015']
[9028.0, 11276.0]
[25.0, 95.0]
[766, 616]
p02683
u371763408
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...
['CA = [list(map(int,input().split())) for _ in range(n)]\n\nans = 10**9\n\nfor i in range(2**n):\n ls = [0] * m\n tmp = 0\n for j in range(n):\n if (i >> j) & 1:\n ls = [l + a for l, a in zip(ls, CA[j][1:])]\n tmp += CA[j][0]\n if all(i >= x for i in ls):\n ans = min(ans...
['Runtime Error', 'Accepted']
['s481566414', 's679291932']
[9148.0, 9224.0]
[24.0, 60.0]
[347, 382]
p02683
u374501720
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())\n\nnum = [i for i in range(n)]\n\nbook_list = []\nfor i in range(n):\n book_list.append(list(map(int, input().split())))\n\n\nfor k in range(1, n+1):\n correct = []\n\n for v in itertools.combinations(num, k):\n test = [] \n for j in...
['Wrong Answer', 'Accepted']
['s636387264', 's802696856']
[27404.0, 27676.0]
[443.0, 432.0]
[672, 670]
p02683
u377834804
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 = [[map(int, input().split())] for i in range(N)]\n\nmin_value = -1\nfor i in range(2**N):\n sum = [0 for k in range(M+1)]\n for j in range(N):\n if (i >> j) & 1:\n sum = [x+y for x, y in zip(sum, book[N+1])]\n if min(sum[1:]) >= X and min_value > sum[0]:\n min_...
['Runtime Error', 'Accepted']
['s256801134', 's427489170']
[9164.0, 9208.0]
[25.0, 58.0]
[340, 384]
p02683
u379716238
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())\nca = []\nfor _ in range(N):\n ca.append(list(map(int, input().split())))\n \nns = [i for i in range(N)]\nprice = 1000000000000\nfor r in range(1,N+1):\n for v in itertools.combinations(ns, r):\n flag = True\n for j in range(M):\n s = sum([ca[i][j+...
['Wrong Answer', 'Accepted']
['s490178344', 's617322797']
[9316.0, 9228.0]
[112.0, 58.0]
[537, 519]
p02683
u382407432
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\nN,M,X=map(int,(input().split()))\nbook=[]\nfor i in range(N):\n book.append(list(map(int,(input().split()))))\nrow_sum = numpy.sum(book, axis=0)\nif(min(row_sum<X)):\n print("-1")', 'import numpy\nN,M,X=map(int,(input().split()))\nbook=[]\nfor i in range(N):\n book.append(list(map(int,(input().split(...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s644745740', 's802797435', 's100938866']
[27360.0, 27276.0, 27240.0]
[109.0, 102.0, 168.0]
[188, 188, 628]
p02683
u382639013
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 = list(map(int, input().split()))\nCA = []\nA = []\nfor _ in range(N):\n L = list(map(int, input().split()))\n CA.append(L[:])\nans = np.zeros(M+1)\n\nS = [0]*n\nANS = list()\ndef makeCombination():\n for i in range(0, n-1):\n S[i] = 0\n rec(0, ans)\ndef rec(i,ans):\n ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s014495804', 's083005884', 's662066450', 's616619955']
[27120.0, 27140.0, 27244.0, 27244.0]
[117.0, 102.0, 118.0, 130.0]
[581, 645, 582, 591]
p02683
u387870994
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()))\nc = []\na = []\n\nfor i in range(n):\n tmp = list(map(int, input().split()))\n c.append(tmp[0])\n a.append([])\n \n for j in range(m):\n a[i].append(tmp[j])\n\nab = []\nfor i in range(m):\n sum = 0\n for j in range(n):\n sum += a[j][i]\n ...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s028311564', 's432376796', 's967005602', 's308291550']
[9160.0, 9236.0, 9128.0, 9260.0]
[23.0, 87.0, 26.0, 88.0]
[357, 997, 342, 1005]
p02683
u406138190
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())\narr=[[0 for i in range(m+1)] for j in range(n)]\nb=[0]*18\n\nflag=1\nfor i in range(n):\n arr[i]=list(map(int,input().split()))\nfor i in range(2**n):\n b=[0]*18\n for j in range(n):\n flag=1\n if (1& i>>j):\n for s in range(m+1):\n b[s]...
['Runtime Error', 'Accepted']
['s284935678', 's173763740']
[9236.0, 9244.0]
[154.0, 98.0]
[507, 462]
p02683
u406379114
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 = []\na = [[] for _ in range(n)]\nfor i in range(n):\n inp = list(map(int, input().split()))\n c.append(inp[0])\n for j in range(m):\n a[i].append(inp[j+1])\nprint(c)\nprint(a)\nkumi=1\nfor i in range(n):\n kumi *= 2\nprint(kumi)\n \nmin_score = 10000000000000\nfor i in ...
['Wrong Answer', 'Accepted']
['s167293041', 's033076777']
[9264.0, 9264.0]
[82.0, 83.0]
[716, 674]
p02683
u408262366
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 itertools import combinations_with_replacement\n\nN,M,X = map(int,input().split())\nCA = []\nfor i in range(N):\n CA.append(list(map(int,input().split())))\n\nOK = True\nCA = np.array(CA)\nsums = np.sum(CA,axis=0)\nfor i in range(1,M+1):\n if sums[i] < X:\n OK = False\n break\n\nif OK...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s007897875', 's102180971', 's376936914', 's945683239', 's613006801']
[237488.0, 164300.0, 27248.0, 164604.0, 164792.0]
[2657.0, 1187.0, 103.0, 1178.0, 1246.0]
[804, 770, 983, 794, 789]
p02683
u408375121
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 = [[] for _ in range(n)]\ncost = [0] * n\nfor i in range(n):\n c_as = list(map(int, input().split()))\n cost[i], A[i] = c_as[0], c_as[1:]\nINF = 10**9\nans = INF\nfor s in range(0, 1 << n):\n smart = [0] * m\n cost_sum = 0\n for i in range(n):\n if (s >> i) % 2 == 0:\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s019793499', 's331694231', 's431854462', 's519130827', 's593030120']
[9240.0, 9252.0, 9304.0, 9360.0, 9212.0]
[25.0, 39.0, 31.0, 37.0, 85.0]
[538, 518, 531, 546, 542]
p02683
u419354839
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 combinations\nimport numpy as np\nN,M,X = map(int, input().split())\n#matrix = np.array([list(map(int, input().split())) for _ in range(N)])\nmatrix = np.random.rand(12,13)\n\nmin_price = 1e9\nfor n in range(N):\n for texts in combinations(matrix, n+1):\n summation = np.sum(texts, axis=0)\n ...
['Wrong Answer', 'Accepted']
['s818585547', 's902544755']
[27244.0, 27340.0]
[142.0, 149.0]
[462, 430]
p02683
u423665486
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 io import StringIO\nimport unittest\n\nsys.setrecursionlimit(10**5)\ndef search(n, step, rec, seq, k):\n\tif rec[n] != -1:\n\t\tc = step - rec[n]\n\t\tsim = (k - rec[n]) % c\n\t\tv = n\n\t\tfor i in range(sim):\n\t\t\tv = seq[v-1]\n\t\tprint(v)\n\t\treturn\n\trec[n] = step\n\tsearch(seq[n-1], step + ...
['Runtime Error', 'Accepted']
['s053120366', 's128665884']
[16152.0, 9216.0]
[65.0, 61.0]
[444, 491]
p02683
u432754124
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(input().split())\n\nmin_money = 999999999999\nfor i in range(2**n):\n\tbag = []\n\ta = list(map(int,input().split()))\n\tfor j in range(n):\n\t\tif ((i >> j) & 1):\n\t\t\tbag.append(a)\n\n\tmoney = 0\n\tskill = [0] * m\n\tenogh = [0] * m\n\tfor sub in bag:\n\t\tmoney += sub[0]\n\t\tfor k in range(1,m+1):\...
['Runtime Error', 'Accepted']
['s636007405', 's711507785']
[9044.0, 9136.0]
[24.0, 108.0]
[484, 523]
p02683
u436173409
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 = [int(e) for e in input().split()]\n\nimport numpy as np\n\nall = np.zeros(n*(m+1)).reshape(n,m+1)\n\nfor i in range(n):\n all[i] += [int(e) for e in input().split()]\n\nbool_list = np.array([])\na = []\nb = []\ndef make(n):\n if len(a) == n:\n b.append([0 for _ in range(n)])\n for i,v ...
['Runtime Error', 'Accepted']
['s178480176', 's371472222']
[27524.0, 27144.0]
[153.0, 161.0]
[719, 417]
p02683
u440129511
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))\nl=[]*n\nfor i in range(n):\n b=[0,0]\n b[0]+=i+1\n b[1]+=a[i]\n l.append(b)\nc=0\nne=0\nl1=[0]*n\nwhile True:\n if c==k:\n print(l[ne][1])\n exit()\n ne+=-ne+l[ne][1]-1\n c+=1\n if l1[ne]==0:l1[ne...
['Runtime Error', 'Runtime Error', 'Accepted']
['s083933883', 's794765762', 's850465336']
[9288.0, 9324.0, 9332.0]
[20.0, 21.0, 87.0]
[614, 413, 433]
p02683
u443151804
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 as pr\nn,m,x=[int(i) for i in input().split()]\nl=[[int(i) for i in input().split()]for j in range(n)]\np=list(pr([0,1],repeat=n))\nsuml=[[sum([l[j][k]*i[j] for j in range(n)])for k in range(m+1)]for i in p]\nans=min([i[0] for i in suml if all([i[j] >=x for j in range(1,6)])])\nprint(ans...
['Runtime Error', 'Runtime Error', 'Accepted']
['s582074726', 's764750352', 's101650469']
[12116.0, 11884.0, 12116.0]
[111.0, 103.0, 113.0]
[313, 349, 351]
p02683
u444481227
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\nca=[list(map(int,input().split())) for _ in range(n)]\n\nres=float('inf')\n\nfor i in range(2**n):\n sc=0\n a=[0]*m\n for j in range(n):\n if ((i >> j) & 1) :\n sc=+ca[j][0]\n a+=ca[j][1:]\n if min(a)>=x:\n res=min (sc,res)\n\nif res == INF:\n print(-1)\nelse...
['Runtime Error', 'Accepted']
['s249501500', 's211101052']
[9212.0, 9140.0]
[41.0, 83.0]
[317, 356]
p02683
u447899880
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()\na=list()\nfor i in range(n):\n line=list(map(int,input().split()))\n c.append(line.pop(0))\n a.append(line)\n\nresult=list()\nfor i in range(2**n):\n total=[0]*m\n cost=0\n for k in range(n):\n if bin(i)[k]=="1":\n total+=a[k]\n cost+=int(c[k])\n if tota...
['Runtime Error', 'Runtime Error', 'Accepted']
['s647183761', 's957030835', 's232471178']
[9192.0, 9072.0, 28248.0]
[25.0, 24.0, 133.0]
[390, 372, 476]
p02683
u449473917
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=[]\n\nfor i in range(n):\n a=list(map(int,input().split()))\n l.append(a)\nprint(l)\nans=99999999\nfor i in range(2 ** n):\n bag = []\n for j in range(n): \n if ((i >> j) & 1): \n bag.append(l[j]) \n skill=[0]*m\n enou=[0]*m\n mone=0\n for ...
['Wrong Answer', 'Accepted']
['s260926377', 's505515913']
[9248.0, 9136.0]
[116.0, 115.0]
[574, 568]
p02683
u449580152
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())\nBook = [list(map(int, input().split())) for _ in range(n)]\nselect = [np.array([])]*(2**n)\ncost = [0]*(2**n)\nskill = [np.array([0]*m)]*(2**n)\ncost2 = []\nfor i in range(2**n):\n for j in range(n):\n if (i >> j) & 1:\n cost[i] += Book[j][...
['Wrong Answer', 'Accepted']
['s344878706', 's471101504']
[27504.0, 27904.0]
[215.0, 216.0]
[480, 464]
p02683
u449822557
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 = list(map(int,input().split()))\nc = []\nfor i in range(n):\n c.append(list(map(int,input().split())))\nmn = 0\nfor bn in itertools.product([0,1], repeat=n):\n money = 0\n skills = [0]*m\n for j in range(n):\n if bn[j] == 1:\n money += c[j][0]\n for ...
['Wrong Answer', 'Accepted']
['s611675301', 's517162265']
[9216.0, 9100.0]
[90.0, 84.0]
[498, 500]
p02683
u458590500
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\nimport numpy as np\n\nN,M,X=map(int,input().split())\na=[]\nfor i in range(N):\n a.append(list(map(int,input().split())))\n\nsuma=sum(a[0][])\nprint(suma,a)', '#coding :utf-8\n\nN,M,X=map(int,input().split())\n\nC=[]\nA=[]\nfor i in range(N):\n t=list(map(int,input().split()))\n C.append(t[0])\n ...
['Runtime Error', 'Accepted']
['s396328468', 's009212024']
[8964.0, 9192.0]
[25.0, 84.0]
[166, 431]
p02683
u458725980
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\nCAM = list([list(map(int,input().split())) for i in range(N)])\n# print(CAM)\nminn = 10**18\nb = False\n\nfor i in range(2 ** N):\n s = 0\n am = []\n\n for j in range(N): \n if ((i >> j) & 1): \n am.append(CAM[j])\n\n j = False\n sss = [0] * (M+1)\n for kk in ...
['Wrong Answer', 'Accepted']
['s653447305', 's290601599']
[9256.0, 9188.0]
[105.0, 90.0]
[722, 724]
p02683
u459215900
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\ninput = sys.stdin.readline\nimport itertools\n\nN, M, X = map(int, input().split())\nvalues_list = []\nfor i in range(N):\n values = list(map(int, input().split()))\n values_list.append(values)\n\nans = 999999\nfor i in range(1, N+1):\n for pair in itertools.combinations(values_list, i):\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s089209007', 's484511063', 's599895089']
[9212.0, 9164.0, 9160.0]
[82.0, 24.0, 29.0]
[645, 633, 1274]
p02683
u460386402
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 i in range(n)]\nans=10**9\n\nfor i in range(2**n):\n b=[0]*m\n count=0\n en=0\n for j in range(n):\n if (i>>j)&1:\n en=en+c[j][0]\n for f in range(m):\n b[f]+=c[j][f+1]\n for f in range(m):\n if b[f]>=x:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s547083617', 's711521870', 's005630231']
[9272.0, 9188.0, 9172.0]
[214.0, 104.0, 80.0]
[443, 437, 448]
p02683
u463068683
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 = (int(x) for x in input().split())\n\nla=[]\nfor i in range(n):\n la.append(list(map(int, input().split())))\n\ny = 0\nfor i in range(2 ** n):\n lb = [0]*(m+1)\n for j in range(n):\n if ((i >> j) & 1):\n lb = [x + y for (x, y) in zip(lb, la[j][:])] \n frg=1\n print(lb)\n for h in range(m):\n i...
['Wrong Answer', 'Accepted']
['s912133975', 's133250431']
[9264.0, 9016.0]
[71.0, 62.0]
[428, 405]
p02683
u466143662
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\nn, m, x = map(int, input().split())\ncosts = []\ngets = []\nfor i in range(n):\n cost, *argo = map(int, input().split())\n costs.append(cost)\n gets.append(argo)\n\n \nbits_list = list(product([0,1], repeat=n))\nmin_cost = float('inf')\ncnt = 0\nfor bits in bits_list:\n t...
['Wrong Answer', 'Accepted']
['s212397812', 's370233520']
[9656.0, 9616.0]
[72.0, 69.0]
[660, 661]
p02683
u479353489
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 combinations\nfrom collections import defaultdict\nN, M , X = map(int, input().split())\nC = [0 for i in range(N)]\nD = defaultdict(list)\nans = 12345678\n\nfor i in range(N):\n temp = list(map(lambda x:int(x), input().split()))\n C[i] = temp[0]\n D[C[i]] = temp[1:]\n\ndef solve():\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s235128525', 's988337548', 's871883287']
[9688.0, 9256.0, 9300.0]
[76.0, 73.0, 65.0]
[894, 824, 825]
p02683
u479719434
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 itertools import product\nINF = 10**9\n\nN, M, X = map(int, input().split())\nC = [None]*N\nA = [None]*N\nfor i in range(N):\n line = list(map(int, input().split()))\n C[i] = line[0]\n A[i] = np.array(line[1:])\n\nchoose = [True, False]\n\nmin_price = INF\n\nfor s in product([True, F...
['Runtime Error', 'Accepted']
['s831025696', 's305280488']
[27204.0, 27240.0]
[103.0, 160.0]
[662, 656]
p02683
u481250941
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# abc167 c\n#\nimport sys\nfrom io import StringIO\nimport unittest\nfrom collections import deque\n\n\nclass TestClass(unittest.TestCase):\n def assertIO(self, input, output):\n stdout, stdin = sys.stdout, sys.stdin\n sys.stdout, sys.stdin = StringIO(), StringIO(input)\n resolve()\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s431085332', 's889888862', 's833900561']
[9148.0, 16224.0, 16232.0]
[26.0, 74.0, 114.0]
[2257, 1508, 2135]
p02683
u486074261
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\nn, m, x = [int(x) for x in stdin.readline().rstrip().split()]\nc = [[int(y) for y in x.rstrip().split()] for x in stdin.readlines()]\n\nc.sort()\nmi = -1\n\nfor i in range(len(c)-1):\n _li = [x for x in c[i] if x != c[i][0]]\n mon = c[i][0]\n\n for j in range(i + 1, len(c)):\n l...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s594456747', 's998108581', 's229927114']
[9244.0, 9164.0, 9168.0]
[25.0, 104.0, 76.0]
[553, 773, 750]
p02683
u488178971
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...
['# ABC 167 C\nN,M,X = map(int,input().split())\nC =[]\nfor m in range(N):\n C.append([int(i) for i in input().split()])\nC.sort(key=lambda x:x[0])\n\nfrom itertools import combinations\nimport numpy as np\n\n\nans = 10**5 +1\n\nfor m in range(1,N+1):\n P=list(combinations(C,m))\n print(P)\n tmp =np.sum(P,a...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s247880697', 's831417857', 's887469792', 's667109233']
[28468.0, 28256.0, 28732.0, 27432.0]
[362.0, 128.0, 183.0, 169.0]
[480, 480, 464, 415]
p02683
u496511996
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 copy\nn,m,x = map(int,input().split())\nans = [0 for i in range(m)]\nbooks = []\nanswer = 1000000000000000000000\nfor i in range(n):\n books.append(list(map(int,input().split())))\nfor i in range(n):\n stock = list(list(itertools.combinations([num for num in range(n)], i+1)))\n for j...
['Runtime Error', 'Accepted']
['s331599668', 's317518640']
[9016.0, 9584.0]
[22.0, 91.0]
[716, 717]
p02683
u497277272
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 Skill_Up():\n condition = input()\n condition_list = condition.split()\n N = int(condition_list[0])\n M = int(condition_list[1])\n X = int(condition_list[2])\n \n text_info=[]\n for i in range(0, N):\n text_book = input()\n text_info_str = text_book.split()\n text_book...
['Wrong Answer', 'Accepted']
['s236859558', 's800144930']
[9228.0, 9144.0]
[25.0, 67.0]
[1524, 1020]
p02683
u497592162
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(' '))\ninput_lists = [list(map(int, input().split(' '))) for _ in range(n)]\n \ncomb = []\nfor i in range(2 ** n):\n tmp = []\n for j in range(n):\n if ((i >> j) & 1):\n tmp.append(input_lists[j])\n comb.append(tmp)\n\nresult = -1\nfor i in range(len(comb)):...
['Wrong Answer', 'Accepted']
['s566391089', 's563685618']
[9488.0, 9236.0]
[121.0, 102.0]
[706, 612]
p02683
u500376440
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)]\nprint(CA)\nmax_=10**16\nans=max_\nfor bit in range(2**N):\n check=[0]*M\n ans_=0\n for i in range(N):\n if bit>>i&1:\n ans_+=CA[i][0]\n for j in range(M):\n check[j]+=CA[i][j+1]\n if all([k>=X for k in check...
['Wrong Answer', 'Accepted']
['s774071830', 's522367299']
[9216.0, 9196.0]
[99.0, 100.0]
[363, 353]
p02683
u500942659
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\nN, M, X = (int(i) for i in input().split())\nY = np.zeros((N, M+1))\nfor i in range(N):\n Y[i,:] = [int(i) for i in input().split()]\nC = Y[:,0]\nA = np.matrix(Y[:,1:])\nres = np.inf\nf = '0'+str(N)+'b'\nfor i in range(2**N):\n z = np.array([int(s) for s in list(format(i, f...
['Wrong Answer', 'Accepted']
['s902576393', 's525161563']
[27148.0, 27308.0]
[177.0, 178.0]
[462, 467]
p02683
u501064426
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 solve(i, cost, know, x, a):\n global res\n if i == len(a):\n for j in range(m):\n if know[j] < x:\n return\n res = min(res, cost)\n return\n solve(i + 1, cost, know, x, a)\n for j in range(m):\n know[j] += a[i][j + 1]\n solve(i + 1, cost + a[i][...
['Runtime Error', 'Accepted']
['s866510884', 's890488248']
[9112.0, 9232.0]
[21.0, 37.0]
[600, 572]
p02683
u502126017
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...
['A,B,C,K=(int(x) for x in input().split())\n\nif(K<=A+B):\n print(A)\nif(K>A+B):\n print(A-(K-A-B))', 'n,m,x=(int(i) for i in input().split())\na=[]\nc=[]\nfor i in range(n):\n a.append(list(map(int,input().split())))\n c.append(a[i][0])\n del a[i][0]\n \nINF=1001001001\nans=INF\n\nfor s in range(1<<n):\n c...
['Runtime Error', 'Accepted']
['s737405624', 's091485808']
[8976.0, 9200.0]
[22.0, 84.0]
[99, 452]
p02683
u517447467
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\nN, M, K = map(int, input().split())\nQ = [np.asarray(input().split(), dtype=int) for i in range(N)]\nmin_cost = 10**9\ndef dfs(cost, C, depth=0):\n global min_cost\n if depth == N:\n return\n if (C >= K).all():\n min_cost = min([cost, min_cost])\n return\n dfs(cost+Q...
['Wrong Answer', 'Accepted']
['s812682625', 's250434646']
[27232.0, 27240.0]
[116.0, 129.0]
[449, 449]
p02683
u517797706
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...
['if __name__ == \'__main__\':\n\n n,m,a = map(int,input().split())\n\n A = []\n for i in range(n):\n cmd = list(map(int,input().split()))\n A.append(cmd)\n print(A)\n\n \n INF = 10**19\n ans = INF\n for x in range(2**n):\n ALG = [0]*m\n gokei = 0\n for y in ra...
['Wrong Answer', 'Accepted']
['s249663208', 's934994988']
[9196.0, 9104.0]
[92.0, 92.0]
[977, 902]
p02683
u522293645
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())\nli = [list(map(int,input().split())) for i in range(n)]\n\nans = 10**30\ncost = 0\nscore = [0]*m\n\nfor i in range(1<<(n+1)):\n for j in range(n):\n if (j>>i)&1:\n for k in range(m):\n score[k] += li[j][k+1]\n cost += li[j][0]\n if min(score)>=x:\n ans = m...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s638868852', 's742947344', 's539591898']
[9224.0, 9232.0, 9104.0]
[38.0, 33.0, 151.0]
[391, 420, 411]
p02683
u523087093
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\nbook = [0]*N\n\nfor i in range(N):\n book[i] = list(map(int, input().split()))\n\nsorted_book = sorted(book)\n\nA_list = [0]*(M) \nfor j in range(1, M+1):\n A_sum = 0\n count = 0\n\n for i in range(N):\n A_sum += sorted_book[i][j]\n count +=1\n i...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s609551030', 's829796110', 's548555531']
[9232.0, 9224.0, 27292.0]
[24.0, 26.0, 170.0]
[692, 694, 599]
p02683
u527379148
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 sys\nfrom itertools import product\n\nn, m, x = map(int, input().split())\nc = []\nA = []\n\nans = 10**9\n\nproducts = list(product([0,1], repeat=n))\n\nfor _ in range(n):\n c_a = list(map(int, input().split()))\n c.append(c_a[0])\n A.append(c_a[1:])\n\nmin_price = 10**9\n\nfor p i...
['Wrong Answer', 'Accepted']
['s367879455', 's802755254']
[27396.0, 27396.0]
[159.0, 161.0]
[629, 626]
p02683
u528388170
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\nA=[[] for _ in range(n)] \nc=[0]*n \n\nfor i in range(n):\n c_as=list(map(int,input().split()))\n c[i],A[i]=c_as[0],c_as[1:]\n\nINF=10**9\nans=INF\n\nfor s in range(1<<n):\n smart=[0]*m\n cost_sum=0\n for i in range(n):\n if (s>>i)==0:\n continue\n ...
['Wrong Answer', 'Accepted']
['s788459642', 's975316262']
[9144.0, 9092.0]
[127.0, 84.0]
[561, 610]
p02683
u531599639
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 cos_per_find(count, cost, skills):\n if count == N:\n if min(skills) >= X:\n return cost\n else:\n return INF\n improved_skills = [a+b for a, b in zip(skills, contents[count])]\n return min(cos_per_find(count+1, cost, skills), cos_per_find(count+1, cost+price[count], i...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s554103734', 's711792724', 's933822274', 's128726698']
[9076.0, 9132.0, 9076.0, 9240.0]
[25.0, 23.0, 20.0, 55.0]
[588, 587, 584, 589]
p02683
u536034761
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 = [input() for i in range(N)]\nresult = 12 * 10**5 + 1\nfor i in range(1, 1 << N):\n skill = [0 for i in range(N)]\n for j in range(N):\n if (i >> j) & 1:\n book = books[j].split()\n cost += int(book[0])\n for k in range(M):\n skill[k] += int(book[...
['Runtime Error', 'Runtime Error', 'Accepted']
['s132728014', 's755371196', 's690899238']
[9036.0, 9248.0, 9064.0]
[22.0, 22.0, 141.0]
[442, 647, 453]
p02683
u536642030
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()))\nbook = []\nfor i in range(n):\n book.append(list(map(int, input().split())))\nans = 10 ** 5 * n\nfor i in product([0,1], repeat=n):\n price = 0\n skill = [0] * m\n for index_, bit in enumerate(i):\n if bit:\n for j in range(m):\n skill[j] += book[index_][ j ...
['Runtime Error', 'Accepted']
['s222871733', 's318984810']
[9224.0, 9216.0]
[25.0, 91.0]
[423, 548]
p02683
u537142137
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\nca = []\nfor _ in range(N):\n ca.append( list(map(int, input().split())))\nca.sort(key=lambda x:-x[0])\nca = np.array(ca)\n#\nans = 10000000\nskill = [0]*(M+1)\n\n\ndef DFS(n,skill):\n global ans\n if skill[0] >= ans:\n return\n if min(skill[1:]) >= ...
['Runtime Error', 'Accepted']
['s466849538', 's963553989']
[27236.0, 27176.0]
[109.0, 128.0]
[522, 507]
p02683
u537550206
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 = []\nbook_total_price = []\nfor _ in range(n):\n book = list(map(int, input().split()))\n books.append(book)\n\nfor i in range(n**2 - 1):\n reference_book = []\n book_price = 0\n for j in range(n):\n if (i >> j) & 1:\n reference_book.append(...
['Wrong Answer', 'Accepted']
['s854603470', 's448160939']
[9252.0, 9316.0]
[26.0, 60.0]
[653, 624]
p02683
u548545174
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())\nprices = []\neffects = []\nfor i in range(N):\n c, *a = map(int, input().split())\n prices.append(c)\n effects.append(list(a))\n\nprices = np.array(prices)\neffects = np.array(effects)\n\n\nans = float("inf")\n\npats = []\nfor i in range(2 ** N):\n ...
['Runtime Error', 'Accepted']
['s402210205', 's805650627']
[28272.0, 27308.0]
[136.0, 203.0]
[620, 633]
p02683
u551109821
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\nN,M,X = map(int,input().split())\nca = [list(map(int,input().split())) for _ in range(N)]\nfor i in range(1,M+1):\n count=0\n for j in range(N):\n count+=ca[j][i]\n if count<X:\n print(-1)\n exit()\n\nans = 10**9\nfor z in product((0, 1), repeat=N):\n c...
['Runtime Error', 'Runtime Error', 'Accepted']
['s120136818', 's776833768', 's994381039']
[9176.0, 10200.0, 9320.0]
[24.0, 55.0, 88.0]
[673, 901, 674]
p02683
u553600587
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\nN, M, X = [int(x) for x in input().strip().split(" ")]\nC = []\nA = []\n\nfor _ in range(N):\n v = [int(x) for x in input().strip().split(" ")]\n c = v.pop(0)\n C.append(c)\n A.append(v)\n\nsums = []\npatterns = product(*[(0, 1) for _ in range(N)])\nfor pattern in patterns...
['Wrong Answer', 'Accepted']
['s997779315', 's129656278']
[9200.0, 9340.0]
[144.0, 143.0]
[611, 592]
p02683
u554096168
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())\n\nC = [0] * N\nA = [list() for _ in range(N)]\n\nfor i in range(N):\n C[i], *A[i] = map(int, input().split())\n\nans = sum(C)\n\nb = False\nfor i in range(1, N+1):\n for j in itertools.combinations(range(N), i):\n print(j)\n a = [0] * M\n ...
['Wrong Answer', 'Accepted']
['s815384148', 's134861809']
[9252.0, 9204.0]
[79.0, 40.0]
[654, 284]
p02683
u556594202
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()))\nskill = [list(map(int,input().split())) for i in range(N)]\ncost = []\n\nfor i in range(2**N):\n total_skill=[0,0,0,0]\n for j in range(N):\n if ((i>>j) & 1):\n total_skill = [x+y for (x,y) in zip(total_skill,skill[j])]\n count=0\n print(i,"回目")\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s451818996', 's602562756', 's902401355']
[9272.0, 27412.0, 27380.0]
[64.0, 441.0, 238.0]
[519, 542, 489]
p02683
u559250296
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\nS= input().split()\nn=int(S[0])\nm=int(S[1])\nx=int(S[2])\na=[m+1]\nbook = np.zeros((m+1,n))\ntotal = np.zeros(m+1)\n\nfor i in range(n):\n a=list(map(int,input().split()))\n for k in range(m+1):\n book[k][i] = a[k]\n\ntotal = np.sum(book, axis=1)\nans =total.copy()\nb = total.copy()...
['Wrong Answer', 'Accepted']
['s881258678', 's267538621']
[27216.0, 9544.0]
[112.0, 91.0]
[536, 630]
p02683
u563838154
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(map(int, input().split())) for _ in range(n)]\ncos_min=10**10\nfor i in range(1,2**n):\n s_c= [0]*(m+1)\n choose = bin(i).zfill(n)\n\n for j in range(n):\n if choose[n-j-1]=="1": \n s_c = [a+b for (a,b)in zip(s_c,book[j])]\n\n for j in s_c[...
['Wrong Answer', 'Accepted']
['s869365029', 's238452940']
[9236.0, 9168.0]
[54.0, 58.0]
[455, 465]
p02683
u564770050
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())\n\nans = 0\ntmp = 10 ** 7\nca = [[0]*m for i in range(n)]\n\nfor _ in range(n):\n ca[_] = list(map(int, input().split()))\nprint(ca)\n\nxx = list(itertools.permutations(ca))\n\n\nfor cax in xx:\n ans = 0\n a = [0 for i in range(m)]\n\n for _ in range(n)...
['Wrong Answer', 'Accepted']
['s180910578', 's031102930']
[361784.0, 9212.0]
[2218.0, 71.0]
[643, 718]
p02683
u574464625
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...
["#Skill Up\nn,m,x = map(int, input().split())\n\n#ca = [map(int, input().split()) for _ in range(n)]\n#ca = [input().split() for l in range(n)]\nimport sys\nca = [[int(c) for c in l.split()] for l in sys.stdin]\n\n#print(ca)\n#print(ca[0][0])\nc=[]\na=[]\nfor l in range(n):\n c.append(ca[l][0])\n#print(c)\n\nfor l ...
['Runtime Error', 'Accepted']
['s009736873', 's544112606']
[9252.0, 9244.0]
[26.0, 28.0]
[814, 802]
p02683
u580920947
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 python\n\ndef main():\n N, M, X = map(int, input().split())\n mat = [list(map(int, input().split())) for _ in range(N)]\n\n ans = 12 * (10 ** 5) +1\n for i in range(1<<N):\n tmp = [0] * (M+1)\n for j in range(N):\n if (i>>j)&1:\n tmp = [x+y for x, y i...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s494222859', 's560499222', 's217242480']
[9220.0, 8856.0, 9224.0]
[62.0, 25.0, 62.0]
[569, 527, 628]