1233 : 维克多词典
- 时间限制Time Limit
- 1 秒Sec
- 内存限制Memory Limit
- 256 兆MB
- 提交次数Submitted
- 247 次Times
- 通过次数Solved
- 75 次Times
标准评测 Standard
从标准输入读入,结果写到标准输出。评测将输出拆成 token,与标准答案逐项比较,不按整段逐字节比对。
Read from standard input and write to standard output. The judge splits the output into tokens and compares them with the official answer; it does not compare raw bytes.
| 比对Compare | token 相同即通过。中间的空格、制表符、换行可多可少。Matching tokens pass. Extra spaces, tabs, or newlines between them are ignored. |
|---|---|
| 不同则错Differs | token 个数或内容不同即错误。23 与 2 3、02 与 2、2.0 与 2 均视为不同。A different token count or value is wrong. 23 vs 2 3, 02 vs 2, and 2.0 vs 2 all differ. |
| 输入Input | 标准输入,格式见题面。Standard input; format as in the statement. |
| 输出Output | 标准输出。Standard output. |
| 时间与内存Time and memory | 记这一份程序的 CPU 时间和内存峰值。题目上的时间限制、内存限制就是这一份的上限。The record is this program’s CPU time and peak memory. The limits on the problem apply to this one run. |
题目描述Description
Keyi 是一个热爱读书的中学生,并养成了每天早上阅读的习惯。
随着高考的临近,Keyi 计划每天从《维克多词典》中学习几个单词。
然而,她记忆单词的方法有点奇特。如果她今天学习了一个长度为 \(k\) 的单词,她坚持要在当天记住词典中所有长度为 \(k\) 的单词。
但是,Keyi 每天的精力是有限的,她一天最多只能学习 \(W\) 个单词,否则她就记不住它们了。
Keyi 不确定要如何有效地安排学习计划,以便尽量用最少的天数完成《维克多词典》的记忆。因此,她恳请您的帮助。
输入格式Input
第一行包含两个整数 \(n\) 和 \(W\ (1\le W \le n \le 50000)\),表示《维克多词典》内单词的数量以及 Keyi 每天最多学习的单词数量。
第二行包含 \(n\) 个整数 \(a_i\ (1 \le a_i \le 13)\),\(a_i\) 表示第 \(i\ (1 \le i \le n)\) 个单词的长度。
保证对于相同长度的单词,它们不会出现超过 \(W\) 次。
输出格式Output
输出一行表示 Keyi 记住整本《维克多词典》所需的最少天数。
样例Sample
出题Author
SYSU
题目到此结束End of problem