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
p03254
u416758623
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x = map(int, input().split())\nls = sorted(list(map(int, input().split())))\nans = 0\n\nfor i in range(n):\n if x >= ls[i]:\n x -= ls[i]\n ans += 1\nprint(ans)', 'n,x = map(int, input().split())\nls = sorted(list(map(int, input().split())))\nans = 0\n\nfor i in range(n):\n if x >= ls[i] or x == ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s630349801', 's948771320', 's576293992']
[2940.0, 3060.0, 9124.0]
[17.0, 17.0, 28.0]
[170, 208, 212]
p03254
u432853936
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x = map(int,input().split())\na = list(map(int,input().split()))\naa = sorted(a)\nnokori = x\ncnt = 0\nfor i in range(n):\n if nokori >= a[i]:\n cnt +=1\n nokori = nokori - a[i]\nprint(cnt)\n', 'n,x = map(int,input().split())\na = list(map(int,input().split()))\naa = sorted...
['Wrong Answer', 'Accepted']
['s616060822', 's751654980']
[3060.0, 3060.0]
[17.0, 17.0]
[225, 313]
p03254
u434208140
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x=map(int,input().split())\na=list(map(int,input().split()))\nsort(a)\nfor i in range(n):\n x-=a[i]\n if(x<0):\n break\nif(x!=0):\n print(i)\nelse:\n print(n)', 'n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nfor i in range(n):\n x-=a[i]\n if(x<0):\n break\nif(x!=0):\n print(...
['Runtime Error', 'Accepted']
['s012181795', 's569677590']
[3060.0, 3060.0]
[17.0, 17.0]
[157, 158]
p03254
u451017206
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\na = sorted([int(i) for i in input().split()])\nans = 0\n\ni = 0\nwhile i < N and 0 < x:\n v = a[i]\n if x - v >= 0:\n x = x - v\n ans += 1\n i += 1\n\nprint(ans)', 'N, x = map(int, input().split())\na = sorted([int(i) for i in input().split()])\nb = []\nfor i, ...
['Wrong Answer', 'Accepted']
['s296079191', 's864256011']
[3060.0, 3064.0]
[17.0, 17.0]
[206, 313]
p03254
u453630968
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n, x = map(int,input().split())\na = list(map(int,input().split()))\na = sorted(a)\ncount = 0\nfor i in a:\n print(f"{i},{x}")\n if x - i >= 0:\n x -= i\n count += 1\n else:\n break\nif x != 0:\n count -= 1 if count == n else 0\nprint(count)', 'n, x = map(int,input().split())\na = lis...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s465399484', 's633690265', 's856083629', 's755168520']
[9212.0, 9044.0, 9076.0, 8992.0]
[25.0, 30.0, 28.0, 27.0]
[261, 270, 283, 239]
p03254
u456579619
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\na = sorted(map(int, input().split()))\n \ncount=0\nfor i in range(N):\n if x>=a[i]:\n \tx=x-a[i]\n \tcount+=1\n \nprint(count)', 'N, x = map(int, input().split())\na = sorted(map(int, input().split()))\n \ncount=0\nfor i in range(N):\n x=x-a[i]\n if x>=0:\n count+=...
['Wrong Answer', 'Accepted']
['s682690951', 's086875335']
[9176.0, 9124.0]
[30.0, 30.0]
[158, 177]
p03254
u457601965
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nimport numpy as np\n\n@jit\ndef main(n, x, a):\n cnt = 0\n for i in a:\n x -= i\n if x <= 0:\n break\n elif i == a[-1] and x > 0:\n break\n cnt += 1\n return cnt\n\nn, x = m...
['Runtime Error', 'Accepted']
['s115361851', 's891993005']
[27084.0, 26992.0]
[114.0, 116.0]
[401, 408]
p03254
u457901067
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, X = map(int, input().split())\nA = list(map(int, input().split()))\n\nA.sort()\n\nans = 0\n\nfor i in range(N):\n if A[i] <= X:\n ans += 1\n X -= A[i]\n else:\n break\n \nprint(ans)', 'N, X = map(int, input().split())\nA = list(map(int, input().split()))\n\nA.sort()\n\nans = 0\n\nfl = True\nfor i in ...
['Wrong Answer', 'Accepted']
['s636354207', 's076987707']
[2940.0, 3316.0]
[19.0, 20.0]
[184, 237]
p03254
u459639226
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['# -*- coding: utf-8 -*-\n\nn, x = map(int, input().split())\nsa = input().split()\na = []\n\nfor s in sa:\n a.append(int(s))\n\na = sorted(a)\n\nans = 0\nsum = 0\nfor i in a:\n sum += i\n if sum > x:\n break\n ans += 1\n\nprint(ans)\n', '# -*- coding: utf-8 -*-\n\nn, x = map(int, input().split())\n...
['Wrong Answer', 'Accepted']
['s750606357', 's572016510']
[3060.0, 3060.0]
[17.0, 17.0]
[233, 280]
p03254
u469063372
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n, x = map(int, input().split())\na = map(int, input().split())\nnum = len(a)\na.sort(reverse=True)\nfor i in range(num):\n x -= a.pop()\n if x < 0:\n print(i)\n exit()\n if x == 0:\n print(i + 1)\n exit()\nprint(num - 1)', 'n, x = map(int, input().split())\na = list(map(int, inpu...
['Runtime Error', 'Accepted']
['s493722233', 's413008432']
[3060.0, 3060.0]
[17.0, 17.0]
[246, 252]
p03254
u470101103
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
["NX = input()\nNX = NX.split(' ')\nN = int(NX[0])\nx = int(NX[1])\nA = input()\nA = list(map(int, A.split(' ')))\nsorted_a = sorted(A)\ns = 0\n\ncum_sum = [0] * (len(sorted_a))\nfor i, a in enumerate(sorted_a):\n s = s + a\n cum_sum[i] = s\n\nfor i, s in enumerate(cum_sum):\n if s > x:\n print(i)\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s574195727', 's727680761', 's081089938']
[3064.0, 3064.0, 3064.0]
[20.0, 17.0, 17.0]
[350, 361, 450]
p03254
u475018333
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['# AtCorder-Candy Distribution Again\n\nn,x = map(int, input().split())\nlist[n] = list(map(int, input().split()))\n\na = 0\ni = 0\nlist.sort()\n\nif x < list[0]:\n print(0)\n\nelif x >= list[0]:\n\n while x >= list[i] and x > 0:\n x -= list[i]\n a += 1\n if i < n-1 and x < list[i+1]:\n ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s046804535', 's088638415', 's199891547', 's282973301', 's397754313', 's417681597', 's263536975']
[3064.0, 3064.0, 2940.0, 3060.0, 3060.0, 2940.0, 3060.0]
[17.0, 18.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[473, 396, 477, 327, 396, 406, 305]
p03254
u482157295
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x = map(int,input().split())\na_list = list(map(int,input().split()))\na_list.sort()\ncount = 0\nfor i in range(n):\n if a_list[i] <= x:\n count += 1\n x = x-a_list[i]\n else:\n break\nprint(count)', 'n,x = map(int,input().split())\na_list = list(map(int,input().split()))\na_list.sort()\n...
['Wrong Answer', 'Accepted']
['s737393969', 's616709714']
[3060.0, 3060.0]
[18.0, 17.0]
[216, 234]
p03254
u487594898
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x= map(int,input().split())\na = list(map(int,input().split()))\na.sort()\nans = 0\nfor i in range(n):\n if 0 <= x-a[i]:\n x = x-a[i]\n ans +=1\n \nprint(ans)\n', 'n,x= map(int,input().split())\na = list(map(int,input().split()))\na.sort()\nans = 0\nfor i in range(n):\n if 0 <= x-a[i]:\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s085875769', 's189724651', 's568893847', 's975239951']
[2940.0, 2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0, 17.0]
[172, 172, 191, 262]
p03254
u488178971
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['# AGC 027 A\nN,X =map(int,input().split())\nA =[int(j) for j in input().split()]\nA.sort()\ncnt=0\nfor a in A:\n if X - a >=0:\n X-=a\n cnt+=1\nprint(cnt)', 'N,X= map(int,input().split())\nA = [int(a) for a in input().split()]\nA.sort()\n\ntmp = 0\nans = 0\n\nfor a in A:\n tmp+=a\n if tmp<=X:\n...
['Wrong Answer', 'Accepted']
['s133093988', 's161161474']
[2940.0, 3060.0]
[17.0, 17.0]
[162, 190]
p03254
u489108157
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x=map(lambda x: int(x), input().split())\na=list(map(lambda x: int(x), input().split()))\na.sort()\nans=0\nfor i in range(n):\n x-=a[i]\n if x<0:\n ans=i\n break\nif x>=0:\n ans=n\nprint(ans)', 'n,x=map(lambda x: int(x), input().split())\na=list(map(lambda x: int(x), input().split()))\na.sort...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s199460489', 's503364343', 's557199262', 's661183221', 's910219179']
[3060.0, 3060.0, 3060.0, 3060.0, 3064.0]
[17.0, 17.0, 18.0, 17.0, 17.0]
[205, 199, 186, 186, 227]
p03254
u498575211
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\ncount = 0\np = x\n\nfor i in a:\n if x - i >= 0:\n x -= i\n count += 1\nif x > 0 and count != 0 and p >= a.sum() :\n count -= 1\nprint(count)', 'N, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\ncou...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s435384476', 's626299942', 's108399508']
[3316.0, 3060.0, 3060.0]
[22.0, 17.0, 17.0]
[218, 210, 216]
p03254
u502389123
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\na = list(map(int, input().split()))\n\na.sort()\n\ncnt = 0\nfor i in range(N):\n if x - a[i] < 0:\n break\n cnt += 1\n x -= a[i]\nif x < 0:\n cnt -= 1\n \nprint(cnt)', 'N, x = map(int, input().split())\na = list(map(int, input().split()))\n\na.sort()\n\ncnt = 0\...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s462816027', 's604318827', 's559789212']
[3064.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[207, 180, 215]
p03254
u508405635
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\na = list(map(int, input().split()))\n\n\na = sorted(a)\n\nleftCandy = 0\nchildrenCnt = 0\nfor i in range(len(a)):\n leftCandy = x - a[i]\n if leftCandy >= 0:\n childrenCnt += 1\n\nprint(childrenCnt)', 'N, x = map(int, input().split())\na = list(map(int, input().split()))\n\n\na ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s647813742', 's985376891', 's725563700']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[298, 298, 337]
p03254
u509739538
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['import math\nfrom collections import deque\nfrom collections import defaultdict\n\n\ndef readInt():\n\treturn int(input())\ndef readInts():\n\treturn list(map(int, input().split()))\ndef readChar():\n\treturn input()\ndef readChars():\n\treturn input().split()\ndef factorization(n):\n\tres = []\n\tif n%2==0:\n\t\tres...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s416361092', 's923650966', 's654001070']
[3444.0, 3444.0, 3444.0]
[22.0, 22.0, 22.0]
[2668, 2653, 2676]
p03254
u516687307
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\n#print(a)\ncnt=0\nfor i in range(n):\n if (x-a[i]>=0):\n cnt=cnt+1\n x=x-a[i]\nprint(cnt)\n', 'n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nprint(a)\ncnt=0\nfor i in range(n):\n if (x-a[i]>=0):\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s005191648', 's053019488', 's253003368', 's729409683']
[2940.0, 3060.0, 2940.0, 2940.0]
[17.0, 17.0, 18.0, 17.0]
[168, 219, 182, 220]
p03254
u517152997
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['# -*- coding: utf-8 -*-\n# \nimport math\nimport sys\nimport itertools\nimport numpy as np\n\n\nn,x = map(int, input().split())\n\n\na = [int(i) for i in input().split()]\n\na=sorted(a)\n\n#print(a)\nanswer=0\nfor i in range(n-1):\n if x >= a[i]:\n answer += 1\n x -= a[i]\n print(x,a[i])\n ...
['Wrong Answer', 'Accepted']
['s427513414', 's862983633']
[21828.0, 21704.0]
[1822.0, 1633.0]
[430, 431]
p03254
u519604525
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x=map(int, input().split())\na=[]\na=list(map(int, input().split()))\na.sort()\nA=0\nB=0\nfor i in range(N):\n A=A+a[i]\n if A<=x:\n B+=1\nprint(B)', 'N, x=map(int, input().split())\na=[]\na=list(map(int, input().split()))\na.sort()\nA=0\nB=0\nfor i in range(N):\n A=A+a[i]\n if A<=x:\n B+...
['Wrong Answer', 'Accepted']
['s583301232', 's373446915']
[3060.0, 3060.0]
[18.0, 17.0]
[153, 180]
p03254
u519939795
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x=map(int,input().split())\nans=0\na=sorted(list(map(int,input().split())))\nfor i in range(n):\n x-=a[i]\n if x>=0:\n ans+=1\nprint(ans)', 'n,x=map(int,input().split())\na=sorted(list(map(int,input().split())))\nans=0\nfor i in range(n):\n if x>=a[i]:\n ans+=1\n x-=a[i]\n else:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s402233884', 's469750284', 's472030576']
[2940.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0]
[145, 226, 179]
p03254
u522205105
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N,k = map(int,input().split())\n\ns = list(map(int,input().split()))\ns.sort()\nprint(s)\ncount = 0\nfor i in range(N):\n\tif k - s[i] >= 0:\n\t\tcount += 1\n\t\tk -= s[i]\n\telse:\n\t\tbreak\n\nif count == N :\n\tif k>0:\n\t\tcount -= 1\n\tprint(count)\nelse:\n\tprint(count)', 'N,k = map(int,input().split())\n\ns = ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s552436537', 's788358966', 's866382524', 's385566438']
[3064.0, 3060.0, 2940.0, 3064.0]
[17.0, 17.0, 17.0, 17.0]
[245, 183, 163, 237]
p03254
u526532903
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n, x = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\n\ncnt = 0\nfor i in a:\n if x >= i:\n cnt = cnt + 1\n else:\n break\n x = x - i\n\nif x < 0:\n cnt = cnt - 1\nprint (cnt)\n', 'n, x = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\n\ncnt =...
['Wrong Answer', 'Accepted']
['s761009564', 's310704085']
[3060.0, 3060.0]
[17.0, 17.0]
[213, 235]
p03254
u527925554
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
[' _, X = map(int, input().split())\nA = sorted(list(map(int, input().split())))\n\ncount = 0\nfor a in A:\n if a > X:\n break\n X -= a\n count += 1\n\nif X > 0:\n count -= 1\n\nprint(count)', ' _, X = map(int, input().split())\nA = sorted(list(map(int, input().split())))\n\ncount = 0\nfor a in A:\n ...
['Runtime Error', 'Runtime Error', 'Accepted']
['s027202159', 's226782637', 's728671479']
[2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0]
[194, 220, 212]
p03254
u530383736
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['# -*- coding: utf-8 -*-\n\n\n#----------\nn,x = list(map(int, input().rstrip().split()))\na_list = list(map(int, input().rstrip().split()))\n#----------\na_list.sort()\n\nx_remain=x\nresult = -1\nfor i in range(n):\n x_remain -= a_list[i]\n \n if x_remain < 0:\n result = i\n break\n\nif result ==...
['Wrong Answer', 'Accepted']
['s494683220', 's914236802']
[3060.0, 3060.0]
[17.0, 17.0]
[336, 397]
p03254
u534953209
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int,input().split())\nA = sorted(list(map(int, input().split())))\nans = 0\nsum = 0\nfor i, A_i in enumerate(A):\n\tif sum + A_i <= x:\n\t\tans = i + 1\n\t\tsum += A_i\n\telse:\n\t\tbreak\nprint(ans)\n', 'N, x = map(int,input().split())\nA = sorted(list(map(int, input().split())))\nans = 0\nsu = 0\nfor i, ...
['Wrong Answer', 'Accepted']
['s871903398', 's324335919']
[2940.0, 3064.0]
[17.0, 17.0]
[193, 222]
p03254
u536113865
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['ri = lambda: list(map(int,input().split()))\n\nn,x = ri()\na = sorted(ri())\nans = 0\nc = 0\nfor i in a:\n c += i\n if c>=x:\n break\n ans += 1\nprint(ans)\n', 'ri = lambda: list(map(int,input().split()))\n\nn,x = ri()\na = sorted(ri())\nans = 0\nc = 0\nfor i in a:\n c += i\n if c>x:\n br...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s360754004', 's576297347', 's862171174']
[3316.0, 3316.0, 3316.0]
[21.0, 21.0, 19.0]
[161, 159, 176]
p03254
u538497610
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N,x=map(int,input().split())\nchildren=[int(_) for _ in input().split()]\nchildren.sort()\n\nfor i in range(len(children)):\n x-=children[i]\n if x<0:\n print(i)\n exit()\n\nprint(N)', 'N,x=map(int,input().split())\nchildren=[int(_) for _ in input().split()]\nchildren.sort()\n\nfor i in range(len(...
['Wrong Answer', 'Accepted']
['s920632387', 's663860039']
[2940.0, 3060.0]
[17.0, 17.0]
[192, 217]
p03254
u539517139
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x=map(int,input().split())\na=sorted(list(map(int,input().split())))\ns=a[0]\ni=0\nwhile s<=x and i<n-1:\n i+=1\n s+=a[i]\nif i==n-1 and s<x:\n i-=1\nprint(i)', 'n,x=map(int,input().split())\na=sorted(list(map(int,input().split())))\ns=0\ni=0\nwhile s<x:\n s+=a[i]\n i+=1\nprint(i+1)', 'n,x=map(int,input().spli...
['Wrong Answer', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s083634336', 's212218417', 's271262404', 's671790904', 's880134145', 's903966945', 's934251258', 's825922455']
[3060.0, 3060.0, 2940.0, 3060.0, 2940.0, 3060.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0, 17.0, 17.0, 18.0, 18.0, 17.0]
[154, 116, 117, 174, 126, 183, 118, 155]
p03254
u540761833
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['from itertools import accumulate\nimport bisect\nN,x = map(int,input().split())\nA = sorted(list(map(int,input().split())))\nA = list(accumulate(A))\nind = bisect.bisect_right(A,x)-1\nif ind == -1:\n print(0)\nelse:\n print(ind+1)\n', 'from itertools import accumulate\nimport bisect\nN,x = map(int,input().split...
['Wrong Answer', 'Accepted']
['s331459610', 's029289777']
[3060.0, 3188.0]
[18.0, 18.0]
[228, 315]
p03254
u541610817
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = [int(z) for z in input().split()]\nchildren = [int(z) for z in input().split()]\n\nchildren.sort()\ncnt = 0\n\nfor i in children:\n if x - i < 0:\n break\n else:\n x -= i\n cnt += 1\n \nprint(cnt)\n', 'N, x = [int(z) for z in input().split()]\nchildren = [int(z) for z in input...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s123729928', 's357776648', 's443413983', 's606432154', 's679847384', 's746018009', 's444009298']
[2940.0, 2940.0, 2940.0, 3060.0, 2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[225, 217, 213, 283, 206, 225, 354]
p03254
u543954314
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n, x = map(int, input().split())\na = list(map(int, input().split()))\nif sum(a) < n:\n print(n-1)\n exit()\na.sort()\ncnt = 0\ni = 0\nwhile a[i] <= n:\n cnt += 1\n n -= a[i]\n i += 1\nprint(cnt)', 'n, x = map(int, input().split())\na = list(map(int, input().split()))\nif sum(a) < x:\n print(n-1)\n exit()\na.s...
['Wrong Answer', 'Accepted']
['s718199744', 's874088818']
[3060.0, 3064.0]
[18.0, 18.0]
[188, 198]
p03254
u546440137
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x=map(int,input().split())\n\na=list(map(int,input().split()))\n\na.sort()\n\ns=0\ni=0\n\nif n==0:\n print(0)\n exit()\nelif sum(a)<=x:\n print(n)\n exit()\nelif min(a)>x:\n print(0)\n exit()\nelse:\n while s<x:\n s+=a[i]\n i+=1\n\nprint(i-1)\n', 'n,x=map(int,input().split())\n\na...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s025459605', 's053676820', 's091066232', 's136054304', 's268925556', 's362388877', 's364407871', 's406150249', 's811922833']
[9156.0, 9004.0, 9192.0, 9176.0, 9176.0, 9028.0, 9164.0, 8960.0, 9164.0]
[27.0, 26.0, 23.0, 27.0, 25.0, 29.0, 28.0, 28.0, 23.0]
[257, 222, 200, 219, 191, 232, 180, 223, 285]
p03254
u546959066
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, V = list(map(int, input().split()))\nC = filter(lambda x: x<=V, map(int, input().split()))\nC = list(C)\nN = len(C)\n\ncnt = 0\nfor c in sorted(C):\n if V>0 and V-c>=0:\n cnt += 1\n V -= c\n if V<=0:\n break\nprint(cnt)\n', 'N, V = list(map(int, input().split()))\nC = list(map(int, input().split()))\nN ...
['Wrong Answer', 'Accepted']
['s776315311', 's308668401']
[3060.0, 3060.0]
[17.0, 17.0]
[222, 281]
p03254
u549161102
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N,x = map(int, input().split())\nA = list(map(int, input().split()))\nA.sort()\ncount = 0\n\nfor i in range(N):\n b = x - A[i]\n if b > 0:\n count += 1\n x -= A[i]\n else:\n exit()\nprint(count)', 'N,x = map(int, input().split())\nA = list(map(int, input().split()))\n\nA.sort()\nS = 0\ncount = 0\n\nfor i ...
['Wrong Answer', 'Accepted']
['s024618353', 's918638719']
[3060.0, 3064.0]
[17.0, 18.0]
[194, 336]
p03254
u550768621
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input())\nchild_list = list(map(int, input()))\n\nnokori = x - min(child_list)\nplease_child = 0 \nwhile nokori >0:\n please_child +=1\n mini = min(child_list)\n child_list.remove(mini)\n if child_list == []:\n break\n nokori -= min(child_list)\nprint(please_child)', 'x = input()...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s020790583', 's302324583', 's358277946', 's529942650', 's733731022', 's902970018', 's237040510']
[3060.0, 2940.0, 3060.0, 2940.0, 3064.0, 2940.0, 3064.0]
[17.0, 18.0, 18.0, 17.0, 17.0, 20.0, 17.0]
[291, 198, 292, 281, 462, 284, 735]
p03254
u551373727
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\na = list(map(int, input().split()))\n\nans = 0\nuse_list = []\nfor i in range(2**N):\n use_list.append(list(map(int, list(bin(i)[2::].zfill(N)))))\nfor u in use_list:\n s = 0\n \n for i in range(N):\n if u[i] == 1:\n s += a[i]\n if s <= x:\n an...
['Wrong Answer', 'Accepted']
['s375712890', 's713347569']
[124652.0, 3060.0]
[2111.0, 17.0]
[335, 250]
p03254
u551437236
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\ncount = 0\nfor i in a:\n if x-i>=0:\n x -= i\n count += 1\n\n\nprint(count)\n', 'n, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\ncount = 0\nfor i in a:\n if x-i>=0:\n x -= i\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s684405874', 's871295238', 's039785938']
[2940.0, 2940.0, 3064.0]
[17.0, 18.0, 18.0]
[164, 194, 202]
p03254
u556589653
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x = map(int,input().split())\nA = list(map(int,input().split()))\nans = 0\nfor i in range(N):\n if A[i] > x :\n print(ans)\n break\n else:\n x -= A[i]\n if i == N-1:\n print(N-1)\n break', 'N,x = map(int,input().split())\nA = list(map(int,input().split()))\nA.sort()\nans = 0\nfor i in range(...
['Runtime Error', 'Accepted']
['s845454491', 's540971645']
[9096.0, 9048.0]
[26.0, 28.0]
[201, 242]
p03254
u565380863
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['import sys\n\ninput = sys.stdin.readline\n\n\ndef ii():\n return int(input())\n\n\ndef il():\n return list(map(int, input().split()))\n\n\nN, X = il()\nA = sorted(il())\nc = 0\nfor i in range(N + 1):\n if sum(A[:i]) <= X:\n c = i\nprint(c)\n', 'import sys\n\ninput = sys.stdin.readline\n\n\ndef ii():\n...
['Wrong Answer', 'Accepted']
['s529455467', 's932528821']
[3060.0, 3060.0]
[18.0, 18.0]
[237, 278]
p03254
u571999153
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x = map(int, input().split())\nline = list(map(int, input().split()))\nline.sort()\nans = 0\nfor i in range(n):\n x -= line[i]\n if x < 0:\n break\n else:\n ans += 1\nprint(ans)', 'n,x = map(int, input().split())\nline = list(map(int, input().split()))\nline.sort()\nans = 0\nfor i in range(n):\n x -= line...
['Wrong Answer', 'Accepted']
['s575907573', 's842227605']
[9092.0, 9044.0]
[25.0, 24.0]
[178, 223]
p03254
u578501242
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['a=list(map(int,input().split()))\nb=list(map(int,input().split()))\nx=a[0]\ny=a[1]\nb.sort()\ni=0\nk=0\nwhile i ==0:\n\tt=b[0]\n\tif y>=t:\n\t\tk=k+1\n\t\tdel b[0]\n\telse:\n\t\ti=1\n\tif x==k:\n\t\ti=1\nprint(k)', 'a=list(map(int,input().split()))\nb=list(map(int,input().split()))\nx=a[0]\ny=a[1]\nb.sort()\ni=0\nk=0...
['Wrong Answer', 'Accepted']
['s714437152', 's205237319']
[3060.0, 3064.0]
[18.0, 17.0]
[184, 216]
p03254
u579699847
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['import bisect,collections,copy,itertools,math,numpy,string\ndef I(): return int(input())\ndef S(): return input()\ndef LI(): return list(map(int,input().split()))\ndef LS(): return list(input().split())\n##################################################\nN,x = LI()\na = LI()\nans = 0\na.sort()\nfor y in a:\n if x...
['Wrong Answer', 'Accepted']
['s505509517', 's549511287']
[12264.0, 12088.0]
[153.0, 151.0]
[380, 590]
p03254
u580697892
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['#coding: utf-8\nN, x = map(int, input().split())\na = list(map(int, input().split()))\nans = 0\na.sort()\nfor i in range(len(a)):\n x -= a[i]\n ans += 1\n if x < 0:\n ans -= 1\nprint(ans)', '#coding: utf-8\nN, x = map(int, input().split())\na = list(map(int, input().split()))\nans = 0\na.sort()\nfor i...
['Wrong Answer', 'Accepted']
['s494937860', 's701099497']
[3060.0, 3060.0]
[17.0, 17.0]
[193, 216]
p03254
u581403769
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n, x = map(int, input().split())\na = list(map(int, input().split()))\n\nl = sorted(a)\nflag = False\nfor i in range(n):\n x -= l[i]\n if x < 0:\n flag = True\n break\nif flag:\n print(i)\nelse:\n print(n)', 'n, x = map(int, input().split())\na = list(map(int, input().split()))\n\nl = sorted...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s052525359', 's129403754', 's481492340']
[3060.0, 2940.0, 3060.0]
[18.0, 17.0, 17.0]
[218, 253, 255]
p03254
u584529823
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\nalist = list(map(int, input().split()))\n\nmax = 0\nfor i in range(1, N + 1):\n if sum(sorted(alist)[:i]) <= x:\n max = i\nprint(max)', 'N, x = map(int, input().split())\nalist = list(map(int, input().split()))\n\nmax = 0\nalist.sort()\nfor i in range(0, N):\n x -= alist[i]\n i...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s503282936', 's656951994', 's248277399']
[2940.0, 3060.0, 3060.0]
[18.0, 17.0, 17.0]
[164, 216, 203]
p03254
u584558499
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
["def main():\n N, x = (int(i) for i in input().split())\n a = [int(i) for i in input().split()]\n num = 0\n for i in sorted(a):\n x -= i\n if x >= 0:\n num += 1\n else:\n break\n\n print(num)\n\n\nif __name__ == '__main__':\n main()", "def main():\n N, x ...
['Wrong Answer', 'Accepted']
['s982833889', 's864094834']
[3060.0, 3064.0]
[17.0, 18.0]
[277, 307]
p03254
u593005350
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N,x=map(int,input().split())\nl=list(map(int,input().split()))\nans=0\nl.sort()\n\nfor n in range(N):\n if l[n]<x:\n x-=l[n]\n ans+=1\n elif l[n]==x:\n x-=l[n]\n ans+=1\n break\n else:\n break\n\nprint(ans)', 'N,x=map(int,input().split())\nl=list(map(int,input().spli...
['Wrong Answer', 'Accepted']
['s296291312', 's349279202']
[3064.0, 3064.0]
[17.0, 18.0]
[241, 393]
p03254
u593567568
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['import itertools\nimport bisect\nN,x = map(int,input().split())\nA = list(map(int,input().split()))\nA.sort()\ncumsum = list(itertools.accumulate(A))\nans = bisect.bisect_right(cumsum,x)\nprint(ans)\n', 'import itertools\nimport bisect\nN,x = map(int,input().split())\nA = list(map(int,input().split()))\nA.sort()\ncum...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s396557303', 's784206295', 's520969969']
[3060.0, 3060.0, 3060.0]
[18.0, 18.0, 18.0]
[192, 259, 260]
p03254
u597374218
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N,x=map(int,input().split())\nA=sorted(map(int,input().split()))\na=[0]*len(A)\na[0]=A[0]\ncount=0\nfor i in range(1,len(A)):\n a[i]=A[i]+a[i-1]\nfor i in range(len(A)):\n if a[i]<=x:\n count+=1\nprint(count)', 'N,x=map(int,input().split())\na=sorted(map(int,input().split()))\ncount=0\nfor i in range(N-1...
['Wrong Answer', 'Accepted']
['s042819039', 's462169406']
[3064.0, 3060.0]
[18.0, 20.0]
[211, 161]
p03254
u597455618
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\ncnt = 0\nfor i in range(n):\n if a[i] <= x:\n x -= a[i]\n cnt += 1\n else:\n break\nprint(cnt)', 'n, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\ncnt = 0\nfor i in a:\n if i > x:\n break\n ...
['Wrong Answer', 'Accepted']
['s792676381', 's779450891']
[3060.0, 2940.0]
[17.0, 17.0]
[176, 182]
p03254
u599547273
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n, x = map(int, input().split(" "))\na = tuple(map(int, input().split(" ")))\n\nfor i, a_i in enumerate(sorted(a)):\n x -= a_i\n if x < 0:\n print(i)\n exit()\nprint(n)', 'n, x = map(int, input().split(" "))\na = list(map(int, input().split(" ")))\n\na.sort()\n\ncount = 0\nfor a_i in a:\n x -= ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s014913199', 's149719833', 's516829722', 's581878824', 's604177158', 's673881850', 's983204380', 's242872259']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[180, 179, 170, 174, 224, 181, 177, 184]
p03254
u601913978
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n, x = map(int, input().split())\n\nlis = map(int, input().split())\n\n\ncount = 0\nfor i in sorted(lis):\n x -= i\n if x < 0:\n break\n count += 1\n\nprint(count)\n', 'n, x = map(int, input().split())\n\nlis = map(int, input().split())\n\n\ncount = 0\nfor i in sorted(lis):\n x -= i\n if x < 0:\...
['Wrong Answer', 'Accepted']
['s425443562', 's914575556']
[2940.0, 2940.0]
[17.0, 19.0]
[168, 194]
p03254
u606045429
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = [int(i) for i in input().split()]\nA = [int(i) for i in input().split()]\n\nA.sort()\n\ncount = 0\nfor i in range(N):\n count += A[i]\n if count > x:\n break\n\nprint(i + 1 if i >= N - 1 else i)', 'from itertools import accumulate\nfrom bisect import bisect_right\n\nN, x, *A = map(int, open(0).rea...
['Wrong Answer', 'Accepted']
['s650258970', 's339376295']
[3060.0, 3060.0]
[17.0, 18.0]
[203, 220]
p03254
u607074939
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N,x = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\ns = x\ncnt = 0\nif sum(a) > s:\n print(N-1)\nelif s >= a[0]:\n for i in range(N):\n if s >= a[i]:\n cnt += 1\n s -= a[i]\n print(cnt)', 'N,x = map(int,input().split())\na = list(map(int,input().split())...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s093308533', 's188192337', 's705781813']
[3060.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0]
[237, 235, 274]
p03254
u609814378
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['import sys\nN, x = map(int, input().split())\na = sorted(map(int, input().split()))\n\nans = 0\nscore_x = x\n\nfor i in range(N):\n if score_x < a[i]:\n print(0)\n sys.exit()\n\n elif score_x >= a[i]:\n score_x = (score_x - a[i])\n ans = ans + 1\n\nprint(ans)', 'import sys\nN, x =...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s764490898', 's774321031', 's618343175']
[3064.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0]
[280, 273, 422]
p03254
u614181788
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x= map(int,input().split())\na = list(map(int,input().split()))\na = sorted(a)\ns = 0\nfor i in range(n):\n s += a[i]\n if s > x:\n i -= 1\n break\nprint(i+1)', 'n,x = map(int,input().split())\na = list(map(int,input().split()))\na = sorted(a)\ncount = 0\ns = 0\nfor i in range(n):\n if i == n...
['Wrong Answer', 'Accepted']
['s058517555', 's423831918']
[3060.0, 3064.0]
[17.0, 18.0]
[171, 379]
p03254
u619785253
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
["nx = list(map(int,input().split(' ')))\na = list(map(int,input().split(' ')))\na.sort(reverse=True)\n\n#print(a)\ny = 0\nokashi= nx[1]\nfor i in a:\n if okashi>= i:\n okashi -=i\n y+=1\n\n#print(okashi) \nif y>=1 &okashi>0:\n y-=1\n \n \nprint(y) ", "nx = list(map(int,input().split(' ')))\na = list(...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s559560470', 's835495335', 's698556547']
[3064.0, 3060.0, 3064.0]
[17.0, 17.0, 18.0]
[248, 248, 429]
p03254
u622045059
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
["import math\nimport fractions\nimport bisect\nimport collections\nimport itertools\nimport heapq\nimport string\nimport sys\nimport copy\nfrom decimal import *\nfrom collections import deque\nsys.setrecursionlimit(10**7)\nMOD = 10**9+7\nINF = float('inf') \ndef gcd(a,b):return fractions.gcd(a,b) \ndef lcm(a,b):return...
['Wrong Answer', 'Accepted']
['s373545927', 's143677549']
[5296.0, 5680.0]
[39.0, 50.0]
[2100, 2123]
p03254
u623036684
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N = int(input())\nx = int(input())\ny=x\ncage = []\nfor i in range(N):\n nu = int(input())\n cage.append(nu)\nans=0\nfor i in range(N):\n ind = cage.index(min(cage))\n if(min(cage) > x):\n break\n x = x - min(cage)\n cage[ind] = y\n ans += 1\nif x>0:\n ans = ans - 1\nprint(ans)', 'N = i...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s000027169', 's037387285', 's250434272', 's308073355', 's524265597', 's617473601', 's923182371', 's197312541']
[3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 18.0]
[292, 298, 291, 259, 305, 303, 292, 280]
p03254
u623687794
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,m=map(int,input().split())\nans=0\nch=list(map(int,input().split()))\nch.sort()\nsum=0\ni=0\nwhile sum<m:\n sum+=ch[ans]\n ans+=1\n if sum > m:\n ans-=1\n break\nprint(ans)', 'n,m=map(int,input().split())\nans=0\nch=list(map(int,input().split()))\nch.sort()\nsum=0\ni=0\nwhile sum<m and ans!=n:\n sum+=ch[a...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s611333298', 's769284119', 's861463746', 's792517989']
[3064.0, 3060.0, 3060.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[171, 183, 233, 234]
p03254
u627325970
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = list(map(int, input().split()))\nA = sorted(list(map(int, input().split())))\n\ndef func():\n cummulative_sum = 0\n for index, value in enumerate(A):\n cummulative_sum += value\n if cummulative_sum > x:\n index\n \n if cummulative_sum != x:\n return len(A) - 1\n ...
['Wrong Answer', 'Accepted']
['s833766532', 's099145368']
[2940.0, 3060.0]
[17.0, 17.0]
[348, 361]
p03254
u629350026
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nans=0\nfor i in range(n):\n if a[i]<=x:\n x=x-a[i]\n ans=ans+1\nprint(ans)\n', 'n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nans=0\nfor i in range(n):\n if a[i]<=x:\n x=x-a[i]\n ans=ans+1\nif ans==n an...
['Wrong Answer', 'Accepted']
['s692436643', 's207658647']
[2940.0, 3060.0]
[17.0, 17.0]
[148, 179]
p03254
u629540524
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x = map(int,input().split())\na = sorted(map(int,input().split()))\nc=0\nd=0\nfor i in a:\n if c<x:\n c+=i\n d+=1\nelse:\n if c>x:\n d-=1\nprint(d)', 'n,x = map(int,input().split())\na = sorted(map(int,input().split()))\nc=0\nfor i in a:\n if x<i:\n break\n x-=i\n c+=1\nel...
['Wrong Answer', 'Accepted']
['s682698430', 's715398457']
[9156.0, 9048.0]
[25.0, 28.0]
[165, 168]
p03254
u629607744
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['def i():\n\treturn int(input())\ndef i2():\n\treturn map(int,input().split())\ndef s():\n\treturn str(input())\ndef l():\n\treturn list(input())\ndef intl():\n\treturn list(int(k) for k in input().split())\n\nn,x=i2()\na=intl()\na.sort()\nb=0\nfor i in range(n):\n\tx-=a[i]\n\tif x>=0:\n\t\tb+=1\n\tif x<0:\n\t\tbreak\...
['Wrong Answer', 'Accepted']
['s909114046', 's202774080']
[3064.0, 3064.0]
[18.0, 17.0]
[294, 344]
p03254
u633548583
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x=map(int,input().split())\na=list(map(int,input().split() for i in range(n)))\na_sort=sorted(a)\ncount=0\nsum=0\nfor i in a_sort:\n while sum+i<=x:\n sum=sum+i\n count+=1\n else:\n break\nprint(count)\n', 'n,x=map(int,input().split())\na=list(int(input() for i in range(n)))\na_sort=sorte...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s410177521', 's468085203', 's670826177', 's909132065']
[2940.0, 3060.0, 3056.0, 3064.0]
[17.0, 17.0, 17.0, 17.0]
[220, 204, 217, 275]
p03254
u633914031
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N,x=map(int,input().split())\na=list(map(int,input().split()))\ncnt=0\na.sort()\nfor i in range(N):\n if x-a[i]>=0:\n cnt+=1\n else:\n break\n\nprint(cnt)', 'N,x=map(int,input().split())\na=list(map(int,input().split()))\ncnt=0\na.sort()\nfor i in range(N):\n if x-a[i]>=0:\n cnt+=1\n x-=a[i]\n else:\n...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s117418660', 's204801552', 's084879189']
[2940.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[152, 164, 204]
p03254
u634046173
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N,x = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\nc = 0\nrx = x\nfor i in range(N):\n if a[i] > rx:\n print(c)\n exit()\n c += 1\n rx -= a[i]\nprint(N)', 'N,x = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\nc = 0\nrx = x\nfor i in range(N):\n if a[i] > r...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s347292187', 's853165668', 's361378082']
[9068.0, 9100.0, 8964.0]
[26.0, 24.0, 26.0]
[177, 155, 206]
p03254
u636489589
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\na = list(map(int, input().split()))\na = sorted(a)\nn = 0\nfor i in range(N):\n x -= a[i]\n if x < 0:\n break\n n += 1\nprint(n)', 'N, x = map(int, input().split())\na = list(map(int, input().split()))\na = sorted(a)\nn = 0\nfor i in range(N):\n n += 1\n x -= a[i]\n if x < 0...
['Wrong Answer', 'Accepted']
['s307182402', 's502666101']
[2940.0, 2940.0]
[17.0, 17.0]
[159, 179]
p03254
u636822224
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nc=0\nfor i in range(len(a)+1):\n if x>0 and x>a[i]:\n x-=a[i]\n c+=1\n else:\n print(c)\n break', 'n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nc=0\nfor i in range(len(a)+1):\n if x>0 and x>=a[i]:\n ...
['Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s019690916', 's117895882', 's635012352', 's805227634', 's976637255', 's067347966']
[3060.0, 3060.0, 3060.0, 3060.0, 3060.0, 3060.0]
[17.0, 19.0, 17.0, 18.0, 17.0, 18.0]
[173, 174, 205, 153, 162, 244]
p03254
u637289184
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, X = map(int, input().split())\nA = list(map(int, input().split()))\nA.sort()\nprint(A)\ncnt=0\nfor i in range(N):\n if A[i]<=X:\n X-=A[i]\n cnt+=1\n print(X)\n else:\n for j in range(i):\n if A[j]+X==A[i]:\n cnt+=1\n X=0\nif X>0 and cnt>0:\...
['Wrong Answer', 'Accepted']
['s935203416', 's616031847']
[9160.0, 9176.0]
[29.0, 30.0]
[325, 215]
p03254
u644360640
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
["n,x = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\nans = 0\nfor i in range(n):\n if x >= a[i]:\n ans += 1\n x -= a[i]\n else:\n break\n'''\nif x > 0 and ans != 0:\n ans -= 1\n'''\nprint(ans)\n", 'n,x = map(int,input().split())\na = list(map(int,input().split())...
['Wrong Answer', 'Accepted']
['s693621808', 's122591180']
[3060.0, 3060.0]
[17.0, 17.0]
[234, 263]
p03254
u647656433
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n, x = [int(i) for i in input().split()]\na = [int(i) for i in input().split()]\na.sort()\ncnt = 0\nfor i in a:\n if x - i < 0:\n break\n else:\n n -= i\n cnt += 1\nprint(cnt)\n', 'n, x = [int(i) for i in input().split()]\na = [int(i) for i in input().split()]\na.sort()\ncnt = 0\nfor i in r...
['Wrong Answer', 'Accepted']
['s640031261', 's621962639']
[2940.0, 3060.0]
[18.0, 17.0]
[193, 326]
p03254
u652656291
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x = map(int,input().split())\nA = sorted(map(int,input().split()))\nans = 0\nfor i in range(n):\n x -= A[i]\n ans += 1\n if x = 0:\n ans -= 1\n break\nprint(ans)\n', 'n,x = map(int,input().split())\nA = sorted(map(int,input().split()))\nans = 0\nfor i in range(n):\n x -= A[i]\n ans += 1\n if x < 0:\n ...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s020231876', 's240609105', 's299607089', 's563332030', 's836232220']
[2940.0, 2940.0, 2940.0, 2940.0, 2940.0]
[18.0, 17.0, 17.0, 17.0, 18.0]
[164, 164, 164, 197, 169]
p03254
u652737716
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n, amount = map(int, input().split())\na = list(map(int, input().split()))\n\na.sort()\n\nans = 0\nfor ai in a:\n if ai <= amount:\n amount -= ai\n ans += 1\n\nprint(ans)\n', 'n, amount = map(int, input().split())\na = list(map(int, input().split()))\n\na.sort()\n\nans = 0\nfor ai in a:\n if ai <=...
['Wrong Answer', 'Accepted']
['s936872689', 's103377659']
[3316.0, 2940.0]
[19.0, 17.0]
[177, 218]
p03254
u653642801
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['\ndef main():\n n, x = map(int,input().split())\n a = list(map(int,input().split()))\n\n a = sorted(a)\n ans = 0\n tmp = 0\n for i in a:\n tmp += i\n if tmp <= x:\n ans+=1\n\n print(ans)\n\n\n\n\nif __name__ == "__main__":\n main()\n', '\ndef main():\n n, x = ma...
['Wrong Answer', 'Accepted']
['s223759894', 's438271727']
[3060.0, 3060.0]
[17.0, 18.0]
[266, 327]
p03254
u665038048
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['def main():\n N,x=[int(i) for i in input().split()]\n a=input().split()\n k=0\n while True:\n if x>=int(min(a)):\n x=x-int(min(a))\n a.remove(min(a))\n k+=1\n if len(a)==0:\n break\n else:\n break\n print(k)\nmain()\n',...
['Wrong Answer', 'Accepted']
['s774122538', 's690520403']
[2940.0, 3064.0]
[19.0, 17.0]
[301, 260]
p03254
u665224938
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n, x = map(int, input().split())\nli = sorted(list(map(int, input().split())))\n\nfor i in range(n):\n x = x - li[i]\n if x < 0:\n print(i)\n break\nelse:\n print(n)', 'n, x = map(int, input().split())\nli = sorted(list(map(int, input().split())))\n\nfor i in range(n):\n x = x - li[i]\n i...
['Wrong Answer', 'Accepted']
['s122667994', 's175672961']
[3060.0, 3060.0]
[17.0, 17.0]
[179, 227]
p03254
u667024514
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x = map(int,input().split())\ncou = 0\nlis = list(map(int,input().split()))\nfor i in range(n):\n if i != n-1:\n if x >= lis[i]:\n x -= lis[i]:\n cou += 1\n else:\n if x == lis[i]:\n cou += 1\nprint(cou)', 'n,x = map(int,input().split())\ncou = 0\nlis = list(map(int,input().split()))\nlis.s...
['Runtime Error', 'Accepted']
['s872130293', 's424960753']
[2940.0, 2940.0]
[17.0, 17.0]
[219, 228]
p03254
u668503853
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N,x=map(int,input().split())\nA=list(map(int,input().split()))\nAA=sorted(A)\nans=0\nfor a in A:\n if x>=a:\n x-=a\n ans+=1\n else:\n break\nprint(ans)', 'N,x=map(int,input().split())\nA=list(map(int,input().split()))\nAA=sorted(A)\nans=0\nfor i in range(N):\n if x>=AA[i]:\n x-=AA[i]\n ans+=1\n els...
['Wrong Answer', 'Accepted']
['s202877971', 's461213670']
[3060.0, 3060.0]
[17.0, 17.0]
[152, 206]
p03254
u670180528
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['from bisect import bisect\nfrom itertools import accumulate\nn,x,*a=map(int,open(0).read().split())\nb=list(accumulate(sorted(a)))\nprint(bisect(b,x))', 'from bisect import bisect\nfrom itertools import accumulate\nn,x,*a=map(int,open(0).read().split())\nb=list(accumulate(sorted(a)))\nprint(bisect(b,x)-(b[-1]<x))']
['Wrong Answer', 'Accepted']
['s000718396', 's538403102']
[3060.0, 3060.0]
[18.0, 18.0]
[146, 156]
p03254
u677842374
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\na = list(map(int, input().split()))\ncnt = 0\na.sort()\nfor i in range(N):\n if a[i]<=x:\n x -= a[i]\n cnt += 1\n else:\n break\nprint(cnt)', 'N, x = map(int, input().split())\na = list(map(int, input().split()))\ncnt = 0\na.sort()\nfor i in range(N):\n ...
['Wrong Answer', 'Accepted']
['s726985317', 's600594224']
[9008.0, 9124.0]
[21.0, 21.0]
[190, 225]
p03254
u679089074
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['#22\nN,x = map(int,input().split())\na = list(map(int,input().split()))\ncou =0\n\na.sort()\n\nfor i in a:\n if i >x:\n break\n cou +=1\n x -= i\n \nwhile x>0:\n for i in a:\n if x%i ==0:\n cou -=1\n break\n while x > i:\n x-=i\n cou -= 1\npr...
['Time Limit Exceeded', 'Wrong Answer', 'Accepted']
['s456209958', 's969736090', 's136902474']
[9124.0, 9160.0, 9044.0]
[2206.0, 31.0, 27.0]
[310, 210, 242]
p03254
u680503348
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['import math\n\n\n# For taking integer inputs.\ndef inp():\n return(int(input()))\n\n\n# For taking List inputs.\ndef inlist():\n return(list(map(int, input().split())))\n\n\n# For taking string inputs. Actually it returns a List of Characters, instead of a string, which is easier to use in Python, because in Py...
['Wrong Answer', 'Accepted']
['s496348996', 's600701629']
[3060.0, 3064.0]
[18.0, 18.0]
[614, 670]
p03254
u687159441
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\nsum = 0\npeople = 0\n\nif x == sum(a):\n print(n)\nelif x > sum(a):\n print(n-1)\nelse:\n for i in a:\n sum += i\n people += 1\n if sum > x:\n print(people-1)\n break', 'N, x = map(int,...
['Runtime Error', 'Accepted']
['s421703748', 's671661320']
[3064.0, 3060.0]
[18.0, 17.0]
[283, 236]
p03254
u696010640
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\na = sorted(map(int, input().split()))\ncnt = 0\n\nfor i in range(N):\n x -= a[i]\n if x < 0:\n break\n else:\n s += 1\n\nprint(cnt if x <= 0 else cnt-1)', 'N, x = map(int, input().split())\na = sorted(map(int, input().split()))\ncnt = 0\n\nfor i in range(N):\n ...
['Runtime Error', 'Accepted']
['s210967948', 's606464016']
[9100.0, 9160.0]
[24.0, 29.0]
[198, 200]
p03254
u698479721
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N,x = map(int, input().split())\nlis = [int(i) for i in input().split()]\nlis.sort()\ns = 0\nans = 0\nfor nums in lis:\n if x >= nums:\n x += -nums\n ans += 1\nprint(ans)\n ', 'N,x = map(int, input().split())\nlis = [int(i) for i in input().split()]\nlis.sort()\ns = 0\nans = 0\nfor nums in lis:\n if x >= num...
['Wrong Answer', 'Accepted']
['s503164656', 's690300051']
[3316.0, 3060.0]
[19.0, 19.0]
[171, 206]
p03254
u701318346
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\n\ncount = 0\nfor ai in a:\n if ai <= x:\n x -= ai\n count += 1\n else:\n break\n\n\nif count == N and x > 0:\n count =- 1\n\nprint(count)', 'N, x = map(int, input().split())\na = list(map(int, input().split(...
['Wrong Answer', 'Accepted']
['s153778764', 's708506408']
[3060.0, 3060.0]
[17.0, 17.0]
[328, 329]
p03254
u706929073
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['(n, x) = map(int, input().split())\na = [int(i) for i in input().split()]\na.sort()\nsum = 0\ncount = 0\nfor i in a:\n sum += i\n if sum > x:\n break\n count += 1\nprint(count)', '(n, x) = map(int, input().split())\na = [int(i) for i in input().split()]\na.sort()\nsum = 0\ncount = 0\nfor i in a:\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s709186625', 's769726559', 's407757580']
[3060.0, 2940.0, 3060.0]
[18.0, 18.0, 19.0]
[182, 182, 220]
p03254
u707659359
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['\n\nN,x = [int(x) for x in input().split()]\n\nal = [int(x) for x in input().split()]\n\n\nal.sort()\n\ncount=0\nacc = 0\nfor ai in al:\n acc += ai\n if acc > x:\n break\n count+=1\n\nprint(count)', '\n\nN,x = [int(x) for x in input().split()]\n\nal = [int(x) for x in input().split()]\n\n\nal.sort()\n...
['Wrong Answer', 'Accepted']
['s558394304', 's602334100']
[3060.0, 3060.0]
[17.0, 17.0]
[195, 222]
p03254
u708255304
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\nA = list(map(int, input().split()))\nans = 0\nA.sort()\nfor a in A:\n if x >= a:\n x -= a\n ans += 1\nprint(ans)\n ', 'N, x = map(int, input().split())\ntmp = x\nA = list(map(int, input().split()))\nans = 0\nA.sort()\nfor a in A:\n if x >= a:\n x -= a\n ans += 1...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s105942393', 's214018294', 's972816750']
[2940.0, 3060.0, 3060.0]
[17.0, 17.0, 18.0]
[155, 190, 192]
p03254
u713914478
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\nA = [int(i) for i in input().split()]\n\nA.sort()\nans = 0\n\nfor i in A:\n x -= a\n if x >= 0:\n ans += 1\n else:\n break\nif x > 0:\n ans -= 1\nprint(ans)\n\n', 'N, x = map(int, input().split())\nA = [int(i) for i in input().split()]\n\nA.sort()\nans = []\...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s015997676', 's514892603', 's697449040', 's855244569', 's956901749', 's182977025']
[2940.0, 3060.0, 2940.0, 2940.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0, 18.0, 17.0, 17.0]
[204, 180, 187, 177, 184, 223]
p03254
u721970149
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = map(int, input().split())\nlist_a = [int(x) for x in input().split()]\n\nlist_a.sort()\ntotal = sum(list_a)\nif x < list_a[0] :\n print(0)\n exit()\n\nans = 0\n\nfor i in range(N) :\n if list_a[i] <= x :\n x -= list_a[i]\n ans += 1\n\nprint(ans)\n', 'N, x = map(int, input().split())\nlis...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s563671136', 's872963531', 's083308980']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 18.0]
[260, 302, 310]
p03254
u727787724
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nans=0\nfor i in range(n):\n if x>=a[i]:\n ans+=1\n x-=a[i]\n else:\n break\nprint(ans)', 'n,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nans=0\nfor i in range(n):\n if x>=a[i]:\n a...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s417833703', 's714139086', 's408429444']
[2940.0, 3060.0, 3064.0]
[17.0, 17.0, 17.0]
[177, 265, 258]
p03254
u729133443
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['\x04', 'n,x,*a=map(int,open(0).read().split());c=0\nfor t in sorted(a):\n x-=t\n if x<0:break\n c+=1\nprint(c-(x>0))']
['Runtime Error', 'Accepted']
['s871540680', 's853469750']
[8916.0, 2940.0]
[23.0, 17.0]
[1, 106]
p03254
u731028462
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N, x = list(map(int, input().split()))\nais = list(map(int, input().split()))\ns = 0\ncnt = 0\nais.sort()\nfor ai in ais:\n if(s+ai>=x):\n break\n else:\n s += ai\n cnt += 1\nprint(cnt)', 'N, x = list(map(int, input().split()))\nais = list(map(int, input().split()))\ns = 0\ncnt = 0\nais.sor...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s225576437', 's576724093', 's152685190']
[3060.0, 3060.0, 3064.0]
[18.0, 18.0, 17.0]
[201, 200, 241]
p03254
u733738237
2,000
1,048,576
There are N children, numbered 1, 2, ..., N. Snuke has decided to distribute x sweets among them. He needs to give out all the x sweets, but some of the children may get zero sweets. For each i (1 \leq i \leq N), Child i will be _happy_ if he/she gets exactly a_i sweets. Snuke is trying to maximize the number of happ...
['N,x=[int(i) for i in input().split()]\na = [int(x) for x in input().split()]\na.sort()\ncnt=0\nfor k in range(N):\n\tif x-a[k] >= 0:\n\t\tx -= a[k]\n\t\tcnt += 1\n\t\tif k==N and x >0:\n\t\t\tcnt -=1\n\telse:\n\t\tif k==N:\n\t\t\tcnt -=1\n\t\tbreak\nprint(cnt)', 'N,x=[int(i) for i in input().split()]\na = [int(x) for...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s234831588', 's526637426', 's651603686', 's682727633', 's780211535', 's785652437']
[3060.0, 3060.0, 3060.0, 3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[228, 175, 206, 236, 205, 167]