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

建议使用的浏览器:

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

2796:Coin Piles

题目描述
We have some coins on the table. Each coin is characterized by its size. We want to arrange these coins into successive piles so that the following hold:

1. The size of the top coin in each pile is strictly greater than the size of all the other coins in the same pile.
2. The size of the top coin in each pile is strictly greater than the size of the top coin in the previous pile.
3. The number of coins in each pile is strictly greater than the number of coins in the previous pile.

You will be given the size of each coin. You are to calculate the maximal number of piles that we can organize according to the given rules. Each coin should be used in exactly one pile.
输入解释
There are multiple cases (no more than 100).

There is two lines for each case. The first line is a number n (1 <= n <= 50), indicating the number of coins. A line with n integers follows, giving the sizes of the coins.

Note that the maximal of the sizes will be unique, so it's always possible to form at least one pile.
输出解释
For each case, output the maximal number of piles that we can organize.
输入样例
6
1 2 2 2 2 3
6
1 1 2 2 2 3
6
1 2 2 2 3 4
输出样例
2
3
3
来自杭电HDUOJ的附加信息
Author hhanger@zju
Recommend lcy

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

源链接: HDU-2796

最后修改于 2020-10-25T22:56:51+00:00 由爬虫自动更新

共提交 0

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