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

建议使用的浏览器:

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

3730:Ebbinghaus method

题目描述

Facer is going to have CET6 test! To prepare for the test, he bought a vocabulary book and divided it to 30 wordlist each contains about 60 words. However, this amount is too large for Facer because of his poor IQ. Recently, he found Ebbinghaus method, a famous way of memorizing. The method is like this: we label the day we first memorize the wordlist as first day, then we need to review the words in day 2, day 4, day 8,day 15 and day 30. After that, we will not forget them. Suppose memorizing a wordlist for the first time costs 1 hour and 20 minutes and reviewing costs 40 minutes. Now Facer wants a schedule of memorizing satisfying 2 conditions: 1) He can memorize all the words as soon as possible; 2) the memorizing time in each day should be no more than 2 hours. Now your task is to calculate how many days he needs to memorizing all words. Notice that Facer always memorize all the wordlist in sequence. For example, he will never memorize the third wordlist before the second one.

输入解释

The first line of the input contains n, m. n stands for the number of wordlist and m stand for the number of times Facer needs to review each wordlist.
Then next line contains an ascending integer sequence contains a1, a2, ..., am indicating on which day Facer needs to review the wordlist. The day is calculated from the day he first memorize it.
1 ≤ n, m ≤ 1000
ai+1 - ai ≤ 100
1 ≤ a1 ≤ 100

输出解释

Output the number of days Facer needs to memorizing all wordlists.

输入样例
5 5
2 4 8 15 30
输出样例
36

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3730

最后修改于 2020-10-29T07:09:19+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 10000