/ GCOJ / 题库 /

[GCOI Round #1 D] Mission

[GCOI Round #1 D] Mission

题目描述

Mr Aoligei has \(n\) missions. He played most of the time, so the deadline of aool the missions is only \(d\) days away. For the i-th mission, he must spend \(a_i\) days to do it. Now, you need to tell him how many missions can he do before the deadline. He cannot do more than one mission at a time.

输入格式

Input is given from Standard Input in the following format:
\(n \space \space d \newline a_1 \space \space a_2 \space \space \dots \space \space a_d\)

输出格式

Print the number of mission he can do before the deadine.

输入输出样例

Input #1:

5 3
2 1 4 3 1

Output #1:

2

信息

ID
1007
难度
2
分类
贪心 点击显示
标签
递交数
1
已通过
1
通过率
100%
上传者

相关

在下列比赛中:

GCOI Round #1