当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3576:Elevators in Jiayuan Students' Apartment

题目描述
There are three elevators in the Building B of Jiayuan Students' Apartment in BJTU, which carry a lot of students to go up and down every day.
There're 16 floors in the Building B. The students living on the 1F don't need to wait for the elevators, so all the m students want to get to the 2F or higher.
Supposed that the capacity of each elevator is C( 1 ≤ C ≤ 13 ). Now there are m( 1 ≤ m ≤ 3*C ) students waiting for upstairs on the first floor, while all the three elevators stop on the first floor. You can arrange the way how they go upstairs, that Nobody will left on the first floor when the elevators are in the process of rising. How many times do the three elevators have to stop at least to carry all the m students to the right floor?
输入解释
The first line of input contains a number t, which means there are t cases of the test data.
In each case of testing data, the first line contains two integers C and m.
In the next line, there are m integers f ( 2 ≤ f ≤ 16 ), indicate the floor a student wants to reach.
输出解释
For each case of testing data, the first line is written as "Case n: X", where n is the case number, X is the minimum times the elevators have to stop in the process of rising.
输入样例
2
1 3
2 4 16
2 6
9 9 9 6 6 6
输出样例
Case 1: 3
Case 2: 4
来自杭电HDUOJ的附加信息
Author madongfly & Louty (Special Thanks: mark.zhe)
Recommend zhouzeyong

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3576

最后修改于 2020-10-25T23:04:55+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)