Submission #3200282
Source Code Expand
n, x = map(int, input().split())
lis = map(int, input().split())
count = 0
for i in sorted(lis):
x -= i
if x < 0:
break
count += 1
if x > 0:
count -= 1
print(count)
Submission Info
| Submission Time | |
|---|---|
| Task | A - Candy Distribution Again |
| User | mitubaEX |
| Language | Python (3.4.3) |
| Score | 200 |
| Code Size | 210 Byte |
| Status | AC |
| Exec Time | 19 ms |
| Memory | 2940 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 200 / 200 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt |
| All | 0_00.txt, 0_01.txt, 0_02.txt, 0_03.txt, 1_00.txt, 1_01.txt, 1_02.txt, 1_03.txt, 1_04.txt, 1_05.txt, 1_06.txt, 1_07.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 0_00.txt | AC | 18 ms | 2940 KiB |
| 0_01.txt | AC | 19 ms | 2940 KiB |
| 0_02.txt | AC | 19 ms | 2940 KiB |
| 0_03.txt | AC | 19 ms | 2940 KiB |
| 1_00.txt | AC | 19 ms | 2940 KiB |
| 1_01.txt | AC | 19 ms | 2940 KiB |
| 1_02.txt | AC | 18 ms | 2940 KiB |
| 1_03.txt | AC | 19 ms | 2940 KiB |
| 1_04.txt | AC | 19 ms | 2940 KiB |
| 1_05.txt | AC | 19 ms | 2940 KiB |
| 1_06.txt | AC | 19 ms | 2940 KiB |
| 1_07.txt | AC | 19 ms | 2940 KiB |