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
u735211927
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()))\ncounter = 0\nfor i in sorted(a):\n x -= i\n if x < 0:\n print(counter)\n else:\n counter += 1\n if counter == n:\n print(n)', 'n, x = map(int, input( ).split())\na = list(map(int, input().split()))\ncounter = 0\nfor i in a.sort():\n ...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s174116367', 's445754869', 's503274602', 's550701771', 's761152333', 's825290245', 's962925998', 's929373973']
[3060.0, 2940.0, 3060.0, 3064.0, 3060.0, 3060.0, 3064.0, 3060.0]
[17.0, 17.0, 17.0, 18.0, 17.0, 17.0, 17.0, 18.0]
[198, 164, 243, 399, 197, 199, 199, 258]
p03254
u740284863
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 a:\n if x - i >= 0:\n x -= i\n ans += 1\n else:\n break\nprint(ans)', 'n,x = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\nans = 0\nif sum(a) == x:\n ans = n\nelif su...
['Wrong Answer', 'Accepted']
['s203161711', 's667213072']
[3060.0, 3060.0]
[17.0, 17.0]
[180, 249]
p03254
u742729271
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 x = x-a[i]\n if x>=0:\n ans+=1\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 x = x-a[i]\n if x>=0:\n a...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s111692640', 's451199412', 's616855244']
[2940.0, 2940.0, 3060.0]
[17.0, 18.0, 18.0]
[165, 166, 197]
p03254
u746154235
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())))\ncnt=0\nfor i in A:\n if x >= i:\n x -= i\n cnt+=1\n else:\n break\nprint(cnt)\n', 'N,x=map(int, input().split())\nA=sorted(list(map(int, input().split())))\ncnt=0\nfor i in range(N):\n if i == N-1 and x > A[i]:\n break\n if x >=...
['Wrong Answer', 'Accepted']
['s138218793', 's306963031']
[2940.0, 2940.0]
[17.0, 17.0]
[154, 205]
p03254
u749512407
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()\nSum = sum(A)\nif x >= Sum:\n print(N)\n exit()\n\nans = 0\nfor i in range(N):\n if x >= A[i]:\n ans += 1\n x -= A[i]\n else:\n print(ans)\n break\nelse:\n print(ans)', 'N,x = map(int, input().split())\nA = list(map(int,...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s063380998', 's205838584', 's787056567', 's231194251']
[3064.0, 3060.0, 3060.0, 3064.0]
[17.0, 18.0, 18.0, 18.0]
[246, 259, 271, 299]
p03254
u752767312
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 = sorted(a_list)\n#print(a_list)\n#print(a_list_sort)\ncount = 0\n\nif sum(a_list) <= x :\n\tcount = N\nelse:\n\tfor i in range(N):\n\t\tif sum(a_list_sort[:i+1]) <= x:\n\t\t\tcontinue\t\n\t\telse:\n\t\t\tcount = i\n\t\t\tbreak\nprin...
['Wrong Answer', 'Accepted']
['s772495961', 's522081472']
[3060.0, 3060.0]
[17.0, 18.0]
[294, 330]
p03254
u756988562
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\njudge = [False for i in range(N)]\n# print(judge)\nfor i in range(N):\n if x-a[i]>=0:\n judge[i]=True\n x-=a[i]\ntemp_count=0\nfor i in range(N):\n if judge[i]:\n temp_count+=1\n# print(judge)\nif sum(a)<...
['Wrong Answer', 'Accepted']
['s996804844', 's825231678']
[3064.0, 3064.0]
[17.0, 17.0]
[358, 372]
p03254
u759651152
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\ndef main():\n n, x = map(int, input().split())\n a_list = list(map(int, input().split()))\n a_list.sort()\n total = 0\n ans = 0\n for i in range(n):\n total += a_list[i]\n if total <= x:\n ans += 1\n print(ans)\n\nif __name__ == '__main__':\n mai...
['Wrong Answer', 'Accepted']
['s442254624', 's375727514']
[3064.0, 3064.0]
[17.0, 17.0]
[306, 361]
p03254
u760171369
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()\nb = 0\nfor k in range(N):\n b += a[k]\n if b > x:\n print(k)\n break', 'import numpy as np\nN, x = map(int, input().split())\na = np.array(list(map(int, input().split())))\na.sort()\ns = np.cumsum(a)\nb = (s <= x)\nif b.all():\n ...
['Wrong Answer', 'Accepted']
['s731086371', 's267990827']
[2940.0, 12392.0]
[17.0, 150.0]
[149, 313]
p03254
u760802228
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 \nans = 0 \nfor i in range(N):\n if sum_ > x:\n break\n sum_ += a[i]\n ans += 1\nprint(ans)', 'N, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\nsum_ = 0 \nans =...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s310080139', 's971541520', 's508846228']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[207, 207, 218]
p03254
u761320129
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())\nsrc = list(map(int,input().split()))\nsrc.sort()\n\nx = 0\nans = 0\nfor a in src:\n if x+a > X: break\n ans += 1\n x += a\nprint(ans)', 'N,X = map(int,input().split())\nA = list(map(int,input().split()))\nA.sort()\n\nans = 0\nfor a in A:\n if X-a < 0: break\n X -= a\n ...
['Wrong Answer', 'Accepted']
['s636419127', 's650546074']
[3060.0, 3060.0]
[17.0, 17.0]
[164, 185]
p03254
u762420987
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()))\nalist.sort()\ncounter = 0\nfor a in alist:\n x -= a\n if x>=0:\n counter += 1\n else:\n break\nprint(counter)\n', 'N,x = map(int,input().split())\nalist = list(map(int,input().split()))\nalist.sort()\ncounter = 0\nfor i in ...
['Wrong Answer', 'Accepted']
['s967705179', 's875959733']
[2940.0, 2940.0]
[17.0, 18.0]
[195, 292]
p03254
u777028980
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())\nhoge=list(map(int,input().split()))\nhoge.sort()\nans=0\nfor i in range(n):\n if(hoge[i]<=m):\n ans+=1\n m-=hoge[i]\n else:\n break\nif(m==0):\n print(ans)\nelse:\n if(sum(hoge)<m):\n print(n-1)\n else:\n print(ans)', 'n,m=map(int,input().split())\nhoge=list(map(int,i...
['Wrong Answer', 'Accepted']
['s162345301', 's533377682']
[3060.0, 3064.0]
[17.0, 17.0]
[249, 215]
p03254
u786150969
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 - Candy Distribution Again\nN, x = map(int,input().split())\nan = list(map(int,input().split()))\n\nak =[] \nwhile len(an) > 0:\n ak.append(min(an))\n del an[an.index(min(an))]\n\ncount = 0\nfor i in range(N):\n if x > 0:\n x -= ak[i]\n if i != N-1:\n count += 1\n ...
['Wrong Answer', 'Accepted']
['s006542982', 's598474873']
[9068.0, 9068.0]
[29.0, 29.0]
[580, 495]
p03254
u787131053
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(" ")))\nchildren = [0] * N\na.sort()\nkashi = 0\nwhile kashi < x:\n for i in range(0,N):\n kashi += a[i]\n children[i] += 1\n if kashi > x:\n kashi -= a[i]\n children[i] -= 1\n break\n if k...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s668462281', 's684581321', 's241954318']
[3064.0, 3064.0, 3064.0]
[2104.0, 18.0, 18.0]
[358, 524, 428]
p03254
u787679173
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(x) for x in input().split()]\nA = [int(x) for x in input().split()]\n\nA.sort()\n\nans = 0\nfor a in A:\n if a <= x:\n ans += 1\n x -= a\n else:\n break\n\nprint(ans)', 'N, x = [int(x) for x in input().split()]\nA = [int(x) for x in input().split()]\nB = [0 for _ in range(N)]\n\...
['Wrong Answer', 'Accepted']
['s273856763', 's922701634']
[3316.0, 3064.0]
[19.0, 17.0]
[192, 358]
p03254
u796563423
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,b=map(int,input().split())\nc=list(map(int,input().split()))\nc.sort()\ni=0\ntotal=0\nwhile True:\n if b>=c[i]:\n b=b-c[i]\n total+=1\n else:\n print(total)\n break', 'a,b=map(int,input().split())\nc=list(map(int,input().split()))\nc.sort()\ni=0\ntotal=0\nwhile True:\n if b<c[i]...
['Wrong Answer', 'Accepted']
['s902748274', 's022981808']
[9092.0, 9088.0]
[31.0, 24.0]
[189, 318]
p03254
u796708718
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(" ")]\nlst = [int(i) for i in input().split(" ")]\n\nlst.sort(reverse = True)\ncnt = 0\n\nfor i in range(0,N):\n if x >= lst[i]:\n x -= lst[i]\n cnt += 1\n else:\n break\n \nprint(cnt)\n', 'N, x = [int(i) for i in input().split(" ")]\nlst = [int(i) for i in input()....
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s367074734', 's551620402', 's661496079', 's679603349', 's867199524', 's624039661']
[2940.0, 3060.0, 3060.0, 3060.0, 3060.0, 3064.0]
[17.0, 17.0, 17.0, 18.0, 17.0, 17.0]
[224, 211, 208, 182, 216, 229]
p03254
u799479335
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_s = input().split()\nfor i in range(N):\n a_s[i] = int(a_s[i])\n \na_s = sorted(a_s)\n\nans = 0\nsum_ = 0\nfor i in range(N):\n if sum_ + a_s[i] <= x:\n sum_ += a_s[i]\n ans += 1\n else:\n break\nprint(ans)', 'N, x = map(int, input().split())\na_s = input().split()\n...
['Wrong Answer', 'Accepted']
['s809305209', 's302394367']
[3064.0, 3064.0]
[17.0, 18.0]
[241, 302]
p03254
u801359367
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 = list(map(int,input().split()))\nA = list(map(int,input().split()))\n\nA.sort(reverse=True)\ncandy = 0\nans = 0\nfor i in A:\n candy += i\n if candy <= x:\n ans += 1\nprint(ans)', '\n\nN,x = list(map(int,input().split()))\nA = list(map(int,input().split()))\n\nA.sort()\ncandy = 0\nans = 0\nfor i...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s331192202', 's854894155', 's999684854']
[3060.0, 3060.0, 3060.0]
[18.0, 18.0, 17.0]
[199, 187, 214]
p03254
u802963389
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 a:\n if x >= i:\n x -= i\n ans += 1\nprint(ans)', 'N, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\nans = 0\nfor i in a:\n if x >= i:\n x -= i\n ans += 1\nif x == 0:\n prin...
['Wrong Answer', 'Accepted']
['s867150678', 's304537007']
[2940.0, 3060.0]
[17.0, 18.0]
[145, 189]
p03254
u810216383
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\nhappy=0\na.sort()\n\nfor i in range(N):\n \n if a[i] > x:\n break\n\n else:\n x=x-a[i]\n happy=happy+1\n\nprint(happy)\n', 'N,x=map (int, input().split())\na=list( map(int, input().split()) )\n\nhappy=0\na.sort()\n\nf...
['Wrong Answer', 'Accepted']
['s438374761', 's256869853']
[2940.0, 3060.0]
[17.0, 17.0]
[205, 250]
p03254
u810356688
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())))\nfor i in range(n):\n if x<A[i]:\n print(i)\n break\n x-=A[i]\nelse:print(n)\n\n ', 'n,x=map(int,input().split())\nA=sorted(list(map(int,input().split())))\nnum=0\nfor i in range(n):\n if x<A[i]:\n print(i)\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s129139048', 's203158406', 's707919256', 's983779515']
[2940.0, 2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0, 17.0]
[166, 160, 164, 156]
p03254
u816070625
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,n=map(int,input().split())\nA=list(map(int,input().split()))\nA.sort()\n\nans=0\ni=0\nwhile A[i]<=n:\n ans+=1\n i+=1\n if i==N:\n break\nprint(ans)', 'N,n=map(int,input().split())\nA=list(map(int,input().split()))\nA.sort()\n\nans=0\ni=0\nwhile A[i]<=n:\n if i==N-1:\n if n==A[i]:\n ans+=1\n break\...
['Wrong Answer', 'Accepted']
['s630962264', 's434013818']
[3060.0, 3064.0]
[17.0, 17.0]
[144, 201]
p03254
u816116805
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 numpy as np\n\nn,X = map(int,input().split())\nxs = np.array(list(map(int,input().split())))\ncumsumx =np.insert(np.cumsum(xs),0,0)\n\nprint(0)', 'import numpy as np\n\nn,X = map(int,input().split())\nxs = np.array(list(map(int,input().split())))\ncumsumx =np.insert(np.cumsum(xs),0,0)\n\ndef energy(k):\n no...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s380328738', 's421564567', 's909338872', 's794317878']
[12468.0, 13320.0, 3064.0, 2940.0]
[148.0, 166.0, 18.0, 17.0]
[144, 557, 1421, 194]
p03254
u816552564
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=input().split()\nX=int(x)\nn=int(N)\ny=0\nA = [int(i) for i in input().split()]\nA.sort()\nfor z in range(n):\n y+=A[z]\n if y>=X:\n print(z+1)\n break', 'N,x=input().split()\nX=int(x)\nn=int(N)\ny=0\nA = [int(i) for i in input().split()]\nA.sort()\nfor z in range(n):\n y+=A[z]\n if y>=X:\n print(z+1...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s133036068', 's151699688', 's609842849', 's769718144', 's772039889']
[9076.0, 9116.0, 9152.0, 9184.0, 9056.0]
[26.0, 26.0, 32.0, 25.0, 25.0]
[153, 170, 170, 190, 212]
p03254
u823885866
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\nimport math\nimport itertools\nimport collections\nimport heapq\nimport re\nimport numpy as np\n\nrr = lambda: sys.stdin.buffer.readline().rstrip()\nrs = lambda: sys.stdin.buffer.readline().split()\nri = lambda: int(sys.stdin.buffer.readline())\nrm = lambda: map(int, sys.stdin.buffer.readline().split())\n...
['Wrong Answer', 'Accepted']
['s898821996', 's056833623']
[12396.0, 12396.0]
[150.0, 153.0]
[657, 695]
p03254
u824237520
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 = sorted(a)\n\nans = 0\ntemp = x\n\nwhile ans < n:\n temp -= a[ans]\n ans += 1\n if temp == 0:\n break\n elif temp < 0:\n ans -= 1\n break\n\nprint(ans)\n', 'n, x = map(int, input().split())\na = list(map(int ,...
['Wrong Answer', 'Accepted']
['s679628422', 's633962426']
[3060.0, 3060.0]
[17.0, 17.0]
[244, 283]
p03254
u827306875
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 = sorted(list(map(int, input().split())))\nsum = 0\nnum = 0\n\nwhile sum < x and num <= N:\n sum += a_list[num]\n num += 1\n \nprint(num)', 'N, x = map(int, input().split())\na_list = sorted(list(map(int, input().split())))\nsum = 0\nnum = 0\n\nwhile sum < x and num +...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Accepted']
['s539786351', 's812122433', 's824153709', 's991131102', 's504205559']
[2940.0, 2940.0, 2940.0, 3060.0, 2940.0]
[18.0, 21.0, 18.0, 20.0, 18.0]
[178, 182, 165, 180, 198]
p03254
u832039789
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())))\n\nres = 0\nfor i in a:\n if x<i:\n break\n x -= i\n res += 1\nprint(res)\n', 'n,x = map(int,input().split())\na = list(map(int,input().split()))\na = sorted(a)\nres = 0\np = 0\nfor i in a:\n x -= i\n if x < 0:\n x...
['Wrong Answer', 'Accepted']
['s359293982', 's898844036']
[3316.0, 3060.0]
[19.0, 18.0]
[156, 264]
p03254
u834832056
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())\narr = list(map(int, input().split()))\n\narr.sort()\nans = 0\n\nfor i in arr:\n x -= i\n if x < 0:\n break\n else:\n ans += 1\n if x > 0 and ans > 0:\n ans -= 1\n\nprint(ans)', 'n, x = map(int, input().split())\narr = list(map(int, input().split()))\n...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s279571233', 's554215660', 's608113890', 's890641731', 's746072478']
[9172.0, 9160.0, 9016.0, 9172.0, 9104.0]
[25.0, 22.0, 30.0, 26.0, 30.0]
[226, 255, 233, 269, 218]
p03254
u835482198
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...
['\nimport bisect\n\n\nn, x = map(int, input().split())\na = list(sorted(map(int, input().split())))\nif x == sum(x):\n print(n)\nelse:\n acc = [0 for i in range(n)]\n acc[0] = a[0]\n for i in range(1, n):\n acc[i] += a[i - 1] + a[i]\n index = bisect.bisect_right(acc, x)\n if index == n:\n ...
['Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s263948513', 's480139089', 's963094432', 's957816545']
[3060.0, 3060.0, 3064.0, 2940.0]
[18.0, 17.0, 18.0, 17.0]
[323, 289, 234, 268]
p03254
u839188633
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\nfor ai in a:\n if x >= ai:\n x -= ai\n ans += 1\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\nfor ai in a:\n if x...
['Wrong Answer', 'Accepted']
['s107631693', 's352194260']
[3316.0, 2940.0]
[19.0, 17.0]
[185, 213]
p03254
u840310460
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 =sorted(a)\ncou = 0\nfor i in range(N):\n if x >= a_sort[i]:\n x -= a_sort[i]\n cou += 1\nprint(cou)', 'a_sort =sorted(a)\ncou = 0\nfor i in range(N):\n if x >= a_sort[i]:\n cou += 1\n x -= a_sort...
['Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s186783398', 's416189493', 's426843937', 's721411360', 's937070529', 's612684214']
[3060.0, 2940.0, 2940.0, 2940.0, 3060.0, 3060.0]
[18.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[197, 118, 162, 174, 197, 247]
p03254
u841568901
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()))\ns = 0\nfor i in range(N):\n x -= A[i]\n if x<0:\n break\n else:\n s += 1\nprint(s)', 'N,x = map(int, input().split())\nA = sorted(map(int, input().split()))\ns = 0\nfor i in range(N):\n x -= A[i]\n if x<0:\n break\n else:\n s +=...
['Wrong Answer', 'Accepted']
['s850460119', 's956844324']
[9084.0, 9124.0]
[30.0, 25.0]
[154, 171]
p03254
u844005364
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\nfrom bisect import bisect\n\nn, x = map(int, input().split())\narr = list(map(int, input().split()))\n\narr.sort()\nsum_arr = list(accumulate(arr))\n\nidx = bisect(arr, x)\nprint(idx)\n', 'from itertools import accumulate\nfrom bisect import bisect\n\nn, x = map(int, input().split())...
['Wrong Answer', 'Accepted']
['s901087384', 's249181729']
[3060.0, 3188.0]
[18.0, 18.0]
[208, 264]
p03254
u845333844
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 x -= A[i]\n if x >= 0:\n ans += 1\n else:\n break\n \nif x > 0:\n print(ans-1)\nelse:\n print(ans)', 'n,x = map(int, input().split())\nA = list(map(int, input().split()))\n\nA.sort()\n\nan...
['Runtime Error', 'Accepted']
['s169985405', 's079254466']
[3060.0, 2940.0]
[17.0, 17.0]
[211, 212]
p03254
u845573105
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()\nA = [0] + A\nfor i in range(N):\n A[i+1] = A[i]+A[i+1]\n if A[i+1]>X:\n print(i)\n exit()\nprint(N)\n', 'N , X = map(int, input().split())\nA = list(map(int, input().split()))\nA.sort()\nA = [0] + A\nfor i in range(N):\n A[i+1]...
['Wrong Answer', 'Accepted']
['s263502030', 's134319434']
[9176.0, 9188.0]
[28.0, 30.0]
[181, 209]
p03254
u851704997
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\nwhile(x >= 0):\n if(count == N):\n break\n tmp = a.pop(0)\n if(x >= tmp):\n x = x - tmp\n count += 1\n else:\n break\nprint(str(count))', 'N,x = map(int,input().split())\na = list(map(int,input().split()))\na...
['Wrong Answer', 'Accepted']
['s656964059', 's291091845']
[3060.0, 3060.0]
[17.0, 18.0]
[232, 272]
p03254
u853900545
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\nb = []\nfor i in range(N):\n b.append(0)\n \nc = 0\n\nd = []\nfor i in range(N):\n d.append(0)\n\n\nfor i in range(N):\n for j in range(i+1):\n d[i] += a[j]\n b[i] = d[i]\nfor i in range(N):\n if b[i] <= X:\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s225244207', 's299040290', 's436182729', 's471330815', 's555249678', 's661463197', 's877991992', 's890525974', 's935655785', 's397898112']
[3064.0, 3060.0, 3060.0, 3060.0, 3064.0, 3060.0, 3060.0, 3064.0, 3064.0, 3064.0]
[18.0, 18.0, 19.0, 18.0, 18.0, 18.0, 18.0, 18.0, 19.0, 18.0]
[319, 256, 260, 256, 281, 271, 256, 315, 302, 285]
p03254
u854061980
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\nif sum(a) ==x:\n print(n)\nelse:\n a.sort()\n for i in range(n):\n if x >= a[i]:\n ans += 1\n x -= a[i]\n else:\n break\n\n\n\n\nprint(ans-1)', 'n,x = map(int,input().split())\na = list(map(in...
['Runtime Error', 'Accepted']
['s291269442', 's207061637']
[3060.0, 3060.0]
[17.0, 17.0]
[250, 293]
p03254
u854946179
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...
['\nN,x = map(int,input().split())\nA = list(map(int,input().split()))\t\nans=0\nA.sort()\nfor i in A:\n x=x-i\n if x >= 0:\n ans=ans+1\nprint(ans)', 'N,x = map(int,input().split())\nA = list(map(int,input().split()))\t\nans=0\nA.sort()\nfor i in A:\n x=x-i\n if x < 0:\n \n else:\n ans=a...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s648494081', 's907099285', 's287465631']
[2940.0, 2940.0, 3060.0]
[17.0, 17.0, 17.0]
[148, 161, 172]
p03254
u859897687
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()))\nl.sort()\nif x==sum(l):\n print(n)\nelif x<sum(l):\n print(n-1)\nelse:\n ans=0\n k=0\n for a in l:\n k+=a\n if k>x:\n break\n ans+=1\n print(ans)\n ', 'n,x=map(int,input().split())\nl=list(map(int,input().split()))\nl.sort()\nif x==s...
['Wrong Answer', 'Accepted']
['s428913077', 's507413474']
[3060.0, 3060.0]
[19.0, 17.0]
[217, 217]
p03254
u860338101
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 range(len(a)):\n if x - a[i] >= 0:\n x -= a[i]\n count += 1\n else:\n break\nprint(count)', 'N, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort()\ncount = 0\nfor i...
['Wrong Answer', 'Accepted']
['s585600392', 's955327573']
[9128.0, 8932.0]
[30.0, 26.0]
[207, 264]
p03254
u868701750
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()\nprint(A)\nc = 0\nfor i in A:\n x -= i\n if x >= 0:\n c += 1\n else:\n break\n\nif x > 0:\n c -= 1\n\nprint(c)\n', 'N, x = map(int, input().split())\nA = list(map(int, input().split()))\n\nA.sort()\nc = 0\nfor ...
['Wrong Answer', 'Accepted']
['s291108434', 's664112854']
[3060.0, 2940.0]
[17.0, 17.0]
[203, 194]
p03254
u869265610
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())\nhito = input().split()\npoo = [hito]\nzyun = sorted(hito)\n\nok = 0\nfor i in range(len(hito)):\n\tif x-int(zyun[i])>=0:\n\t\tok+=1\n\t\tif ok == len(hito):\n\t\t\tprint(ok)\n\t\t\texit()\n\telse:\n\t\tprint(ok)\n\t\texit()\n', 'a,b=map(int,input().split())\nL=list(map(int,input().spli...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s379805771', 's582541031', 's976782821', 's991043288', 's992769282', 's741522954']
[3060.0, 9112.0, 3060.0, 2940.0, 3064.0, 9100.0]
[18.0, 22.0, 17.0, 17.0, 17.0, 25.0]
[226, 131, 213, 177, 174, 215]
p03254
u871374729
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()))\n\nc_list = list(map(int, input().split()))\n\nc_list.sort()\n\n\ni = 0\nfor _ in range(len(c_list)):\n if x - c_list[i] < 0:\n print(i)\n exit()\n x -= c_list[i]\n i += 1\n\nprint(len(c_list))\n', 'N, x = list(map(int, input().split()))\n\nc_list = list(m...
['Wrong Answer', 'Accepted']
['s572362045', 's079732404']
[2940.0, 3060.0]
[17.0, 17.0]
[241, 290]
p03254
u876742094
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 range(N):\n if x<a[i]:\n break\n else:\n count+=1\n x-=a[i]\n\nprint(count)\n', 'N,x=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\ncount=0\nfor i in range(N):\n if x<a[i]:\...
['Wrong Answer', 'Accepted']
['s753830572', 's345582165']
[9080.0, 8984.0]
[28.0, 27.0]
[184, 202]
p03254
u879309973
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 solve(n, x, a):\n ans = 0\n for v in sorted(a):\n if v <= x:\n ans += 1\n x -= v\n return ans\n\nn, x = map(int, input().split())\na = list(map(int, input().split()))\nprint(solve(n, x, a))\n\n', 'def solve(n, x, a):\n ans = 0\n for v in sorted(a):\n if v <= x:\n...
['Wrong Answer', 'Accepted']
['s445109164', 's098418408']
[2940.0, 3064.0]
[17.0, 17.0]
[223, 269]
p03254
u879870653
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()))\nanswer = 0\nwhile x > 0 :\n A = sorted(A)\n if x < A[0] :\n break\n x = x - A[-1]\n answer += 1\n A.pop(-1)\n if len(A) == 0 :\n break\nprint(answer)\n\n', 'N,x = map(int,input().split())\nA = list(map(int,input().spl...
['Wrong Answer', 'Accepted']
['s490993199', 's905736164']
[3060.0, 3060.0]
[17.0, 18.0]
[240, 282]
p03254
u890183245
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())\narray = list(map(int, input().split()))\narray = sorted(array, reverse=False)\n#print(array)\nfor i in range (N):\n if sum(array) < x:\n print(N)\n break\n elif sum(array[0:i+1]) == x:\n print(i)\n break\n elif sum(array[0:i+1]) < x and x < sum(array[0:i]):\n print(...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s012643172', 's363024575', 's677499924']
[3060.0, 3060.0, 3060.0]
[18.0, 17.0, 17.0]
[337, 240, 310]
p03254
u896741788
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=sorted(list(map(int,input().split())))\n\nnow=0\nfor i in l:\n now+=i;d.append(now)\nfrom bisect import bisect_left as bl,bisect_right as br\n\nprint(max(0,br(d,x)-1+(sum(l)==x)))', 'n,x=map(int,input().split())\nl=sorted(list(map(int,input().split())))\nif sum(l)>x:print(n-1);exit(...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s254246903', 's393608762', 's261521258']
[3060.0, 3060.0, 3188.0]
[17.0, 18.0, 19.0]
[206, 219, 259]
p03254
u898421873
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...
['\nN, x = map(int, input().split())\n\nchildlen = []\nfor part in input().split():\n childlen.append(int(part))\n\nchildlen.sort()\n#print(childlen)\n\nhappy = 0\nfor child in childlen:\n #print(child, x)\n if child <= x:\n x -= child\n happy += 1\n else:\n break\n\nprint(happy)', 'N, ...
['Wrong Answer', 'Accepted']
['s484139622', 's668404502']
[3060.0, 3064.0]
[17.0, 17.0]
[292, 429]
p03254
u905510147
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)\n\ncount = 0\nans = 0\nfor i in a:\n\tprint(x)\n\tif x >= i:\n\t\tx = x - i\n\t\tans += 1\n\telse:\n\t\tbreak\nelse:\n\tif x:\n\t\tans -= 1\n\nprint(ans)\n', 'N, x = map(int, input().split())\na = list(map(int, input().split()))\na =...
['Wrong Answer', 'Accepted']
['s912872963', 's230871605']
[3060.0, 3060.0]
[17.0, 17.0]
[210, 200]
p03254
u905582793
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,c=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nfor i in range(n):\n if a[i]>c:\n print(i+1)\n break\n else:\n c-=a[i]\nelse:\n print(n)', 'n,c=map(int,input().split())\na=list(map(int,input().split()))\na.sort()\nfor i in range(n):\n if a[i]>c:\n print(i)\n break\n else:...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s522165613', 's980158100', 's722867568']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 17.0]
[164, 162, 197]
p03254
u909643606
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()\ncount=0\nfor i in range(n):\n x-=a[i]\n if x>=0:\n count+=1\n \nprint(count)', 'n,x=[int(i) for i in input().split()]\na=[int(i) for i in input().split()]\na.sort()\ncount=0\nfor i in range(n):\n x-=a[i]\n if x>=0 and ...
['Wrong Answer', 'Accepted']
['s980129722', 's935450553']
[2940.0, 3060.0]
[19.0, 17.0]
[165, 210]
p03254
u924406834
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()\nb = 0\nfor i in a:\n x -= I\n if x => 0:\n b += 1\n else:\n break\nprint(b)', 'N,x = map(int,input().split())\na = list(map(int,input().split()))\na.sort()\nb = 0\nfor i in a:\n x -= i\n if x => 0:\n b +=...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Accepted']
['s009194435', 's613157344', 's697047532', 's893809508', 's097301731']
[2940.0, 2940.0, 2940.0, 3060.0, 3060.0]
[18.0, 18.0, 17.0, 17.0, 17.0]
[166, 166, 202, 299, 263]
p03254
u925406312
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()))\ncount = 0\n\n\na.sort(reverse=False)\nfor i in range(N):\n if x >= a[i]:\n count += 1\n x -= a[i]\n else:\n break\n print(count)\n\nif (x!=0)and(count == N):\n count -= 1\n print(count)', 'N,x = map(int,input().spl...
['Wrong Answer', 'Wrong Answer', 'Runtime Error', 'Runtime Error', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s132289864', 's220569799', 's377317611', 's573456649', 's647136341', 's793619051', 's797587102', 's807641424', 's871685262', 's956833501', 's772736937']
[9192.0, 9120.0, 9180.0, 9076.0, 9032.0, 9160.0, 9176.0, 9056.0, 9196.0, 9116.0, 9116.0]
[28.0, 27.0, 30.0, 28.0, 24.0, 27.0, 21.0, 30.0, 24.0, 30.0, 26.0]
[318, 277, 287, 271, 155, 249, 305, 314, 266, 267, 298]
p03254
u931889893
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())\nlists = list(map(int, input().split()))\n\ncount = 0\nfor num in sorted(lists):\n X -= num\n if X == 0 and num == lists[-1]:\n print(count + 1)\n exit()\n if X >= 0 and num != lists[-1]:\n if num == lists[-1] and X > 0:\n break\n count ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s078094785', 's560571172', 's225677108']
[3064.0, 3060.0, 3316.0]
[17.0, 18.0, 20.0]
[350, 307, 269]
p03254
u934052933
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\ndef main()->None:\n (N, x) = map(int, input().split())\n a = list(map(int, input().split()))\n sorted_a = sorted(a) \n count = 0\n for i in sorted(a):\n x -= i\n if x < 0:\n break\n else:\n count += 1\n print(count)\n\n\nif __name__ == "__main__":\n ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s044281370', 's136949110', 's618208074', 's630212354', 's666473352', 's887728603', 's155437306']
[3064.0, 3060.0, 3064.0, 3060.0, 3064.0, 3064.0, 3064.0]
[17.0, 17.0, 17.0, 17.0, 17.0, 17.0, 17.0]
[336, 318, 351, 350, 353, 337, 461]
p03254
u937529125
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\nn, x = list(map(int, input().split()))\narray = list(map(int, input().strip().split()))\narray.sort()\nans = 0\nfor i in array:\n x = x-i\n if x < 0:\n break\n ans += 1\n \nprint(ans)', 'import math\nn, x = list(map(int, input().split())) \narray = list(map(int, input().strip().split()...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s105736312', 's980914728', 's099584419']
[3060.0, 3060.0, 3060.0]
[18.0, 17.0, 17.0]
[204, 213, 304]
p03254
u939702463
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()))\n\na_list.sort()\nans = 0\nfor i in range(n):\n a = a_list[i]\n x = x - a\n if x < 0:\n break\n ans += 1\nprint(ans)', 'n, x = map(int, input().split())\na_list = list(map(int, input().split()))\n\na_list.sort()\nans = 0\nfor a in a_lis...
['Wrong Answer', 'Accepted']
['s116783865', 's914167129']
[3060.0, 3064.0]
[17.0, 17.0]
[187, 204]
p03254
u940743763
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(' ')))\n\nss = list(map(int, input().split(' ')))\n \nr = x\ncount = 0 \nfor s in sorted(ss):\n if r - s < 0:\n break\n else:\n r -= s\n count += 1\nprint(count) \n \n", "n, x = list(map(int, input().split(' ')))\n\nss = list(map(int, input...
['Wrong Answer', 'Accepted']
['s454033477', 's616411368']
[2940.0, 3060.0]
[17.0, 17.0]
[231, 282]
p03254
u941753895
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()))\nif ' '.join([str(x) for x in l])=='20 30 10':\n exit()\nl.sort()\nc=0\nfor i in range(n):\n x-=l[i]\n if i+1==n and x!=0:\n break\n if x>=0:\n c+=1\n else:\n break\nprint(c)", 'n,x=map(int,input().split())\nl=list(map(int,input().split()))\...
['Wrong Answer', 'Accepted']
['s324262391', 's927779164']
[3060.0, 3060.0]
[18.0, 17.0]
[237, 182]
p03254
u942767171
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()))\nb = 0\n\na.sort()\n\nfor i in range(n) :\n b += a[i]\n if b > x :\n print(i)\n break\nelse :\n print(n)', "n,x = map(int, input().split() )\na = list(map(int,input().split()))\nb = 0\n\na.sort()\nprint(a)\n\nfor i in range(n) :\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s300831162', 's987551582', 's193331498']
[3060.0, 3064.0, 3060.0]
[17.0, 18.0, 17.0]
[177, 275, 222]
p03254
u943057856
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\nfor i in a:\n if i>x:\n break\n else:\n n-=i\n ans+=1\nprint(ans)', 'n,x=map(int,input().split())\na=sorted(list(map(int,input().split())))\nans=0\nfor i in a[:-1]:\n if i<=x:\n x-=i\n ans+=1\nif...
['Wrong Answer', 'Accepted']
['s413751633', 's489697281']
[9108.0, 9172.0]
[31.0, 25.0]
[162, 168]
p03254
u943707649
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 = input().split()\nA = input().split()\na = []\nfor i in range(int(N)):\n a.append(int(A[i]))\n \na.sort()\na.append(1)\nX = int(x)\n \nidx = 0\nwhile X>=0:\n X = X-a[idx]\n idx+=1\n\nprint(idx-1)', 'N,x = input().split()\nA = input().split()\na = []\nfor i in range(N):\n a.append(int(A[1]))\n\na.sort()\na.r...
['Runtime Error', 'Runtime Error', 'Accepted']
['s455558805', 's737437641', 's912343326']
[8960.0, 9064.0, 9128.0]
[28.0, 24.0, 27.0]
[189, 180, 212]
p03254
u945418216
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...
['# 27\nn,x = list(map(int, input().split()))\naa = list(map(int, input().split()))\naa.sort()\nans = 0\nfor a in aa:\n if x<a:\n break\n ans+=1\n x-=ai\nelse: \n if x>0:\n ans-=1\nprint(num)', '# 27\nn,x = list(map(int, input().split()))\naa = list(map(int, input().split()))\naa.sort()\nan...
['Runtime Error', 'Runtime Error', 'Runtime Error', 'Accepted']
['s087626336', 's365174234', 's794556323', 's172240821']
[3060.0, 3316.0, 3060.0, 3060.0]
[17.0, 19.0, 19.0, 17.0]
[304, 304, 201, 297]
p03254
u950708010
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 = sorted(list(int(i) for i in input().split()))\nans = 0\nfor i in range(n):\n if a[i] <= x :\n ans += 1\n x-= a[i]\n if i+1 == n:\n if a[i] < x:\n ans -= 1\nprint(ans)', 'n,x = (int(i) for i in input().split())\na = sorted(list(int(i) for i in input().split())...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s158249595', 's780610921', 's762205312']
[3064.0, 2940.0, 3064.0]
[18.0, 18.0, 17.0]
[215, 170, 259]
p03254
u955251526
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())\ns = list(input())\nout = [set() for _ in range(n)]\ncount = [[0, 0] for _ in range(n)]\ndef f(c):\n if c == 'A': return 0\n else: return 1\nfor _ in range(m):\n a, b = map(int, input().split())\n if a == b:\n count[a-1][f(s[a-1])] += 1\n elif b-1 not in out[a-1]...
['Runtime Error', 'Accepted']
['s676820410', 's557758824']
[3064.0, 3060.0]
[18.0, 18.0]
[801, 183]
p03254
u957872856
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())\ncount = 0\narr = sorted(list(map(int,input().split())))\nfor i in range(N):\n x -= arr[i]\n if x >= 0:\n count += 1\n else:\n break\nprint(count)\n', 'N, x = map(int,input().split())\ncount = 0\narr = sorted(list(map(int,input().split())))\nfor i in range(N):\n x -= arr[i]\n...
['Wrong Answer', 'Accepted']
['s498874014', 's168191421']
[2940.0, 3060.0]
[18.0, 18.0]
[179, 252]
p03254
u960947353
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=list(map(int,input().split()))\ny=list(map(int,input().split()))\ny.sort()\ni=0\nwhile x[1]>0 and i<x[0]:\n x[1]-=y[i]\n i+=1\nprint(i)\n', 'x=list(map(int,input().split()))\ny=list(map(int,input().split()))\ny.sort()\ni=0\n"""\nwhile x[1]>0 and i<x[0]:\n x[1]-=y[i]\n i+=1\n"""\nnum=0\nfor i in y:\n ...
['Wrong Answer', 'Accepted']
['s509518492', 's132137627']
[2940.0, 3060.0]
[18.0, 17.0]
[137, 248]
p03254
u961288441
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(reverse=False)\ncount = 0\nfor i in a:\n if x>=i:\n count += 1\n x -= i\n else:\n break\nprint(count)', 'N, x = map(int, input().split())\na = list(map(int, input().split()))\na.sort(reverse=False)\ncount = 0\nfor...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s062688338', 's267739493', 's526496674']
[9100.0, 9168.0, 9192.0]
[30.0, 28.0, 31.0]
[196, 209, 248]
p03254
u961595602
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 -*-\nfrom sys import stdin\n\nin_strings = lambda: stdin.readline()[:-1] \nin_int = lambda: int(stdin.readline()) # N = in_int()\nin_intlist = lambda: list(map(int, stdin.readline().split())) \n\nN, X = in_intlist()\na_list = in_intlist()\n\na_list.sort()\nprint(a_list)\n\nflag = 1\ndist = 0\ncoun...
['Wrong Answer', 'Accepted']
['s216353878', 's994198424']
[3060.0, 3064.0]
[17.0, 17.0]
[520, 507]
p03254
u967835038
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=[]\nans=0\na=list(map(int,input().split()))\na.sort()\nfor i in range(N):\n if a[i]<=x:\n x-=a[i]\n ans+=1\n else:\n break\nprint(ans)\n', 'N,x=map(int,input().split())\na=[]\nans=0\na=list(map(int,input().split()))\na.sorted\nfor i in a:\n if i>=x:\n ...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s532257559', 's969372740', 's040740835']
[3060.0, 3060.0, 3060.0]
[17.0, 17.0, 19.0]
[183, 169, 226]
p03254
u968404618
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()))\n\ncont = 0\n\nfor i in sorted(a):\n x -= i\n if x >= 0:\n cont += 1\n else:\n break\n\nif x > 0:\n cont -= 1\n\nprint(cont)', 'N, x = map(int, input().split())\na = list(map(int, input().split()))\n\ncont = 0\n\nfor y in sorted(a):\n if x >= y:\n ...
['Runtime Error', 'Wrong Answer', 'Accepted']
['s400663732', 's563085076', 's155367407']
[3060.0, 2940.0, 9088.0]
[17.0, 17.0, 28.0]
[172, 159, 243]
p03254
u968649733
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 = list(map(int, input().split()))\n\n#print(N, x)\nA.sort()\n#print(A)\n\ncnt = 0\nfor a in A:\n if x >= a:\n x -= a\n cnt += 1\n else:\n break\n \nprint(cnt)\n ', 'N, x = list(map(int, input().split()))\nA = list(map(int, input().split()))\n\n#print(N, x)\...
['Wrong Answer', 'Accepted']
['s264063422', 's575057910']
[3064.0, 3064.0]
[18.0, 17.0]
[206, 237]
p03254
u969211566
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()\n\nfor i in range(n):\n if x - a[i] >= 0:\n cnt += 1\n x -= a[i]\nif x != 0:\n cnt -= 1\n\nprint(min(0,cnt))', 'n,x = map(int,input().split())\na = list(map(int,input().split()))\ncnt = 0\na.sort()\n\nfor i in range(n):\n i...
['Wrong Answer', 'Accepted']
['s588630700', 's616460539']
[3060.0, 3060.0]
[17.0, 18.0]
[190, 223]
p03254
u969236097
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 cda(N, x, a, count):\n if N == 0:\n return count\n s = sorted(a)\n if x >= s[0]:\n return cda(N - 1, x - s[0], s[1:], count + 1)\n else:\n return count\n\ndef arc027a():\n N, x = (int(s) for s in input().split(" "))\n a = [int(s) for s in input().split(" ")]\n print(N, x,...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s325298777', 's562711202', 's974857377', 's485449118']
[3064.0, 3064.0, 3060.0, 3064.0]
[17.0, 17.0, 19.0, 17.0]
[391, 421, 373, 437]
p03254
u970738863
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()\nS = 0\nc = 0\nfor i in A:\n if S + i <= x:\n S += i\n c += 1\n else:\n break\nprint(c)\n', 'N, x = map(int,input().split())\nA = list(map(int,input().split()))\n\nA.sort()\nS = 0\nc = 0\nif sum(A) < x:\n pri...
['Wrong Answer', 'Accepted']
['s777222481', 's420237104']
[2940.0, 2940.0]
[17.0, 18.0]
[183, 247]
p03254
u987326700
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\nSlist = sorted(a)\ncnt = 0\nSum = 0\n\nfor i in range(len(Slist)):\n Sum += Slist[i]\n if x>=Sum:\n cnt +=1\n else:\n break\nprint(cnt)', 'n,x = map(int,input().split())\na = list(map(int,input().split()))\n\nSlist = sorted(a)\ncnt = 0\nSu...
['Wrong Answer', 'Accepted']
['s939048217', 's190000131']
[3060.0, 3064.0]
[17.0, 17.0]
[201, 236]
p03254
u998679483
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 = map(int, input().split())\n A = list(map(int, input().split()))\n\n A_sorted = sorted(A)\n\n res = 0\n\n for kids in A_sorted:\n if x - kids >= 0:\n x = x - kids\n res += 1\n \n print(res)\n\nif __name__ == '__main__':\n main()", "def main():\n...
['Wrong Answer', 'Accepted']
['s086005219', 's675190778']
[3060.0, 3064.0]
[17.0, 18.0]
[285, 334]
p03254
u999503965
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=sorted(list(map(int,input().split())))\n\nnum=0\nc=0\n\nif l[0]==x:\n print(1)\n exit()\nelse:\n for i in range(n):\n if num+l[i]>x:\n print(c)\n exit()\n else:\n num+=l[i]\n c+=1\n \nprint(c)', 'n,x=map(int,input().split())\nl=sorted(list(map(int,inpu...
['Wrong Answer', 'Accepted']
['s949207886', 's162059276']
[9176.0, 9108.0]
[26.0, 28.0]
[240, 167]
p03255
u185688520
2,000
1,048,576
Snuke has decided to use a robot to clean his room. There are N pieces of trash on a number line. The i-th piece from the left is at position x_i. We would like to put all of them in a trash bin at position 0. For the positions of the pieces of trash, 0 < x_1 < x_2 < ... < x_{N} \leq 10^{9} holds. The robot is initi...
['from itertools import accumulate\ndef E(i, x):\n if i == 1:\n return 5 * x\n return (2 * i + 1) * x\nN, X = map(int, input().split())\nx = list(map(int, input().split()))\nx.sort(key=None, reverse=True)\nx = list(accumulate(x))\nx.insert(0, 0)\nenergy = 9223372036854775807\nfor k in range(1, N + 1):\n ...
['Wrong Answer', 'Accepted']
['s234869499', 's212570914']
[25252.0, 25252.0]
[1997.0, 1990.0]
[571, 570]
p03255
u745087332
2,000
1,048,576
Snuke has decided to use a robot to clean his room. There are N pieces of trash on a number line. The i-th piece from the left is at position x_i. We would like to put all of them in a trash bin at position 0. For the positions of the pieces of trash, 0 < x_1 < x_2 < ... < x_{N} \leq 10^{9} holds. The robot is initi...
["# coding:utf-8\n\n\nINF = float('inf')\n\n\ndef inpl(): return list(map(int, input().split()))\n\n\nN, X = inpl()\nA = inpl()\nB = [0]\nfor a in A:\n B.append(B[-1] + a)\n\nans = INF\nfor k in range(1, N + 1):\n tmp = 0\n i = 0\n cur = N - k\n while True:\n e = 5 if i == 0 else 2 * i + 3\n ...
['Wrong Answer', 'Wrong Answer', 'Accepted']
['s163493739', 's714749021', 's069312828']
[26376.0, 39436.0, 25708.0]
[2105.0, 2106.0, 1061.0]
[464, 600, 347]
p03255
u816116805
2,000
1,048,576
Snuke has decided to use a robot to clean his room. There are N pieces of trash on a number line. The i-th piece from the left is at position x_i. We would like to put all of them in a trash bin at position 0. For the positions of the pieces of trash, 0 < x_1 < x_2 < ... < x_{N} \leq 10^{9} holds. The robot is initi...
['import numpy as np\n\nn,X = map(int,input().split())\nxs = np.array(list(map(int,input().split())))\ncumsumx =np.insert(np.cumsum(xs),0,0)\n\ndef energy(k):\n nok = n//k\n acm = (n+k)*X\n for i in range(1,nok+1):\n relsum = cumsumx[-(i-1)*k-1] - cumsumx[-i*k-1]\n if i == 1:\n acm += ...
['Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Wrong Answer', 'Accepted']
['s498988447', 's596688091', 's627327572', 's862856367', 's952643265']
[34764.0, 34760.0, 34804.0, 34760.0, 34776.0]
[2109.0, 214.0, 2109.0, 320.0, 1995.0]
[574, 133, 562, 145, 669]
p03255
u883048396
2,000
1,048,576
Snuke has decided to use a robot to clean his room. There are N pieces of trash on a number line. The i-th piece from the left is at position x_i. We would like to put all of them in a trash bin at position 0. For the positions of the pieces of trash, 0 < x_1 < x_2 < ... < x_{N} \leq 10^{9} holds. The robot is initi...
['iN ,iX = [int(x) for x in input().split()]\naCum = [0]\nfor x in input().split():\n aCum += [aCum[-1] + int(x)]\n\ndef fCeil(iT,iR):\n return -1 * iT // iR * -1\n\ndef fCalcCost(iN,iX,aCum,iK):\n iCost = (iN + iK ) * iX + 5 * aCum[iN-1]\n for i in range(2,fCeil(iN,iK) ):\n iCost += 2 * aCum[iN - i...
['Wrong Answer', 'Accepted']
['s456888502', 's888136640']
[27248.0, 27244.0]
[646.0, 644.0]
[562, 1021]
p03256
u532966492
2,000
1,048,576
You are given an undirected graph consisting of N vertices and M edges. The vertices are numbered 1 to N, and the edges are numbered 1 to M. In addition, each vertex has a label, `A` or `B`. The label of Vertex i is s_i. Edge i bidirectionally connects vertex a_i and b_i. The phantom thief Nusook likes to choose some ...
['def main():\n N, M = map(int, input().split())\n S = [i == "B" for i in input()]\n ab = [list(map(int, input().split())) for _ in [0]*M]\n graph = [set() for _ in [0]*N]\n [graph[a-1].add(b-1) for a, b in ab]\n [graph[b-1].add(a-1) for a, b in ab]\n\n status = [[0, 0] for _ in [0]*N]\n\n for i...
['Runtime Error', 'Accepted']
['s020508925', 's040008663']
[123968.0, 126768.0]
[1123.0, 1440.0]
[876, 888]
p03256
u562016607
2,000
1,048,576
You are given an undirected graph consisting of N vertices and M edges. The vertices are numbered 1 to N, and the edges are numbered 1 to M. In addition, each vertex has a label, `A` or `B`. The label of Vertex i is s_i. Edge i bidirectionally connects vertex a_i and b_i. The phantom thief Nusook likes to choose some ...
['from collections import deque\nN,M=map(int,input().split())\ns=input()\nH=[[] for i in range(N)]\nG=[[] for i in range(2*N)]\nfor i in range(M):\n a,b=map(int,input().split())\n a-=1\n b-=1\n H[a].append(b)\n H[b].append(a)\n if s[a]=="A":\n if s[b]=="A":\n G[a].append(N+b)\n ...
['Wrong Answer', 'Accepted']
['s338615514', 's189058993']
[93468.0, 93188.0]
[1758.0, 1772.0]
[880, 880]
p03256
u667024514
2,000
1,048,576
You are given an undirected graph consisting of N vertices and M edges. The vertices are numbered 1 to N, and the edges are numbered 1 to M. In addition, each vertex has a label, `A` or `B`. The label of Vertex i is s_i. Edge i bidirectionally connects vertex a_i and b_i. The phantom thief Nusook likes to choose some ...
['import collections\n\nn,m = map(int,input().split())\ns = list(str(input()))\nkey = collection.deque()\nlis = [[] for i in range(n)]\nli = [{"A":0,"B":0} for i in range(n)]\n\nfor i in range(m):\n a,b = map(int,input().split())\n lis[a-1].append(b-1)\n lis[b-1].append(a-1)\n li[a-1][s[b-1]] += 1\n li[b-1][s[a-1]...
['Runtime Error', 'Runtime Error', 'Accepted']
['s860009243', 's953129608', 's908199075']
[5176.0, 5168.0, 102784.0]
[24.0, 24.0, 1500.0]
[682, 688, 689]
p03256
u761320129
2,000
1,048,576
You are given an undirected graph consisting of N vertices and M edges. The vertices are numbered 1 to N, and the edges are numbered 1 to M. In addition, each vertex has a label, `A` or `B`. The label of Vertex i is s_i. Edge i bidirectionally connects vertex a_i and b_i. The phantom thief Nusook likes to choose some ...
["import sys,time\nsys.setrecursionlimit(10**7)\n\nstart_time = time.time()\nN,M = map(int,input().split())\nS = input()\nsrc = [tuple(map(lambda x:int(x)-1,input().split())) for i in range(M)]\n\noutdeg = [set() for i in range(2*N)]\nfor x,y in src:\n if S[x] == S[y]:\n #A0->A1, B0->B1\n outdeg[x].add...
['Runtime Error', 'Accepted']
['s502675705', 's178835920']
[3064.0, 213752.0]
[17.0, 2000.0]
[739, 777]
p03256
u816116805
2,000
1,048,576
You are given an undirected graph consisting of N vertices and M edges. The vertices are numbered 1 to N, and the edges are numbered 1 to M. In addition, each vertex has a label, `A` or `B`. The label of Vertex i is s_i. Edge i bidirectionally connects vertex a_i and b_i. The phantom thief Nusook likes to choose some ...
['#! /usr/bin/env python\n# -*- coding: utf-8 -*-\n\n#\n\n"""\nGC027 C\n"""\n\nn,m = map(int,input().split())\ns = list(input())\nedges = [tuple(map(int,input().split())) for i in range(m)]\nali = [0 for i in range(n)]\nbli = [0 for i in range(n)]\n\n\ndef addEdge(graph,u,v):\n graph[u].add(v)\n\n\nfrom collections ...
['Runtime Error', 'Wrong Answer', 'Runtime Error', 'Wrong Answer', 'Runtime Error', 'Accepted']
['s369581863', 's467688549', 's479698301', 's734267709', 's827326133', 's838023914']
[91236.0, 159296.0, 169764.0, 139608.0, 3064.0, 56968.0]
[1675.0, 2111.0, 2181.0, 2107.0, 18.0, 1591.0]
[1402, 1627, 1023, 1059, 1281, 1355]
p03256
u819135704
2,000
1,048,576
You are given an undirected graph consisting of N vertices and M edges. The vertices are numbered 1 to N, and the edges are numbered 1 to M. In addition, each vertex has a label, `A` or `B`. The label of Vertex i is s_i. Edge i bidirectionally connects vertex a_i and b_i. The phantom thief Nusook likes to choose some ...
['from collections import deque\n\nN, M = map(int, input().split())\ns = [list(input()) for i in range(N)]\n\nS = []\nfor i in s: \n if i == "A": S.append(0)\n else: S.append(1)\n\n\nR = [list() for _ in range(N)]\n\n\nC = [[0, 0] for _ in range(N)]\nfor _ in range(M):\n a, b = map(int, input().split())\n R...
['Runtime Error', 'Accepted']
['s648732318', 's976566739']
[70008.0, 65756.0]
[568.0, 1208.0]
[1153, 1133]
p03256
u905582793
2,000
1,048,576
You are given an undirected graph consisting of N vertices and M edges. The vertices are numbered 1 to N, and the edges are numbered 1 to M. In addition, each vertex has a label, `A` or `B`. The label of Vertex i is s_i. Edge i bidirectionally connects vertex a_i and b_i. The phantom thief Nusook likes to choose some ...
['print("No")', 'import sys\ninput = sys.stdin.readline\n\nn,m = map(int,input().split())\ns = input()\nab = [list(map(int, input().split())) for i in range(m)]\ngraph = [[] for i in range(n+1)]\nABs = [[0,0] for i in range(n+1)]\nfor a,b in ab:\n graph[a].append(b)\n graph[b].append(a)\n if s[a-1] == "A":\n ABs[...
['Wrong Answer', 'Accepted']
['s691762688', 's805387797']
[2940.0, 87848.0]
[17.0, 1222.0]
[11, 1069]
p03260
u001036276
2,000
1,048,576
You are given integers A and B, each between 1 and 3 (inclusive). Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.
['a, b = (int(i) for i in input().split())\n \nif a % 2 == 0 and b % 2 == 0:\n print("Yes")\nelse:\n print("No")', 'a, b = (int(i) for i in input().split())\n\nif a % 2 == 0 && b % 2 == 0:\n print("Yes")\nelse:\n print("No")\n', 'a, b = (int(i) for i in input().split())\n \nif a % 2 != 0 and b % 2 != 0:\n print("Y...
['Wrong Answer', 'Runtime Error', 'Accepted']
['s308556698', 's559201864', 's050573992']
[2940.0, 2940.0, 2940.0]
[17.0, 17.0, 17.0]
[107, 106, 107]
p03260
u003501233
2,000
1,048,576
You are given integers A and B, each between 1 and 3 (inclusive). Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.
['A,B=map(int,input().split())\nif A * B % 2 == 1:\n pritn("Yes")\nelse:\n print("No")', 'A,B=map(int,input().split())\nif A * B % 2 == 1:\n print("Yes")\nelse:\n print("No")']
['Runtime Error', 'Accepted']
['s653898488', 's517909353']
[2940.0, 2940.0]
[17.0, 17.0]
[82, 82]
p03260
u007808656
2,000
1,048,576
You are given integers A and B, each between 1 and 3 (inclusive). Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.
["a,b=input(int,input().split())\nif(a*b%2==0):\n print('No')\nelse:\n print('Yes')", "a,b=map(int,input().split())\nif(a*b%2==0):\n print('No')\nelse:\n print('Yes')"]
['Runtime Error', 'Accepted']
['s546620226', 's846414982']
[2940.0, 2940.0]
[17.0, 17.0]
[79, 77]
p03260
u010069411
2,000
1,048,576
You are given integers A and B, each between 1 and 3 (inclusive). Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.
['#! /usr/bin/python\nprint("Yes" if sum(map(int,input().split()))%2==1 else "No")\n', '#! /usr/bin/python\nfrom operator import mul\nprint("Yes" if mul(map(int,input().split()))%2==1 else "No")\n', '#! /usr/bin/python\nfrom operator import mul\nprint("Yes" if mul(*map(int,input().split()))%2==1 else "No")\n']
['Wrong Answer', 'Runtime Error', 'Accepted']
['s152171243', 's166419140', 's476292488']
[2940.0, 3060.0, 3060.0]
[17.0, 18.0, 18.0]
[80, 105, 106]
p03260
u016572066
2,000
1,048,576
You are given integers A and B, each between 1 and 3 (inclusive). Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.
['a, b = map(int, input.split())\nif (a * b) % 2 == 0:\n print("No")\nelse:\n print("Yes")', 'a, b = map(int, input().split())\nif (a * b) % 2 == 0:\n print("No")\nelse:\n print("Yes")']
['Runtime Error', 'Accepted']
['s535099197', 's417679235']
[2940.0, 2940.0]
[18.0, 17.0]
[86, 88]
p03260
u017271745
2,000
1,048,576
You are given integers A and B, each between 1 and 3 (inclusive). Determine if there is an integer C between 1 and 3 (inclusive) such that A \times B \times C is an odd number.
['A, B = map(int, input().split())\n\nif A*B%2 == 1:\n ans = "No"\nelse: ans = "Yes"\n\nprint(ans)', 'A, B = map(int, input().split())\n\nif A*B%2 == 1:\n ans = "Yes"\nelse: ans = "No"\n\nprint(ans)']
['Wrong Answer', 'Accepted']
['s311935846', 's114401688']
[2940.0, 2940.0]
[17.0, 18.0]
[93, 93]