贪心1009
所属分类:文章/文档
开发工具:Visual C++
文件大小:1KB
下载次数:1
上传日期:2018-04-26 23:46:35
上 传 者:
zilewwy
说明: For example :
There are 5 soldiers (A B C D E)with level numbers : 2 4 5 6 4;
One method :
C could teach B; B could teach A; So , A B C are eligible to study on the same broomstick.
D could teach E;So D E are eligible to study on the same broomstick;
Using this method , we need 2 broomsticks.
Another method:
D could teach A; So A D are eligible to study on the same broomstick.
C could teach B; So B C are eligible to study on the same broomstick.
E with no teacher or student are eligible to study on one broomstick.
Using the method ,we need 3 broomsticks.
……
(Input file contains multiple test cases.
In a test case,the first line contains a single positive number N indicating the number of soldiers.(0<=N<=3000)
Next N lines :There is only one nonnegative integer on each line , indicating the level number for each soldier.( less than 30 digits);
Output
For each case, output the minimum number of broomsticks on a single line.)
文件列表:
贪心1009.cpp (445, 2018-04-26)
题目.txt (2476, 2018-04-26)
近期下载者:
相关文件:
收藏者: