49517 10381
510
632
628
973
286
555
454
346
928
161
788
218
768
536
928
51
799
376
<242050 bytes omitted>
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#63937 | #1020. jwp的采购之旅 | Time Limit Exceeded | 0 | 5829 ms | 548 K | C++ / 516 B | Blaze | 2021-12-05 15:45:22 |
#include <stdio.h>
int main() {
int n, m, sum = 0, quantity = 0, cur;
scanf("%d%d", &n, &m);
int a[n];
for (int i = 0; i < n; i++) scanf("%d", &a[i]);
for (int i = 0; i < n - 1; i++)
for (int j = 0; j < n - i - 1; j++)
if (a[j] > a[j + 1]) {
cur = a[j];
a[j] = a[j + 1];
a[j + 1] = cur;
}
for (int i = 0; i < n; i++) {
if (sum > m)
break;
sum += a[i];
quantity++;
}
printf("%d\n", quantity);
}
49517 10381
510
632
628
973
286
555
454
346
928
161
788
218
768
536
928
51
799
376
<242050 bytes omitted>
10275 688001
248
7
829
41
135
305
833
20
238
562
122
705
44
566
959
252
837
828
2
<50105 bytes omitted>
用户输出
3825
Special Judge 信息
Files user_out and answer differ
系统信息
Exited with return code 0
99537 230761
617
79
429
959
175
563
23
857
892
30
557
449
298
197
975
469
123
54
<486854 bytes omitted>
32687 937376
986
151
30
876
983
54
213
694
547
730
224
193
320
597
991
454
642
280
<159779 bytes omitted>