2014鞍山网络预选赛1004(贪心)hdu5000
来源:互联网 发布:ipad弹钢琴软件 编辑:程序博客网 时间:2024/03/29 10:05
Clone
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 291 Accepted Submission(s): 131
Problem Description
After eating food from Chernobyl, DRD got a super power: he could clone himself right now! He used this power for several times. He found out that this power was not as perfect as he wanted. For example, some of the cloned objects were tall, while some were short; some of them were fat, and some were thin.
More evidence showed that for two clones A and B, if A was no worse than B in all fields, then B could not survive. More specifically, DRD used a vector v to represent each of his clones. The vector v has n dimensions, representing a clone having N abilities. For the i-th dimension, v[i] is an integer between 0 and T[i], where 0 is the worst and T[i] is the best. For two clones A and B, whose corresponding vectors were p and q, if for 1 <= i <= N, p[i] >= q[i], then B could not survive.
Now, as DRD's friend, ATM wants to know how many clones can survive at most.
More evidence showed that for two clones A and B, if A was no worse than B in all fields, then B could not survive. More specifically, DRD used a vector v to represent each of his clones. The vector v has n dimensions, representing a clone having N abilities. For the i-th dimension, v[i] is an integer between 0 and T[i], where 0 is the worst and T[i] is the best. For two clones A and B, whose corresponding vectors were p and q, if for 1 <= i <= N, p[i] >= q[i], then B could not survive.
Now, as DRD's friend, ATM wants to know how many clones can survive at most.
Input
The first line contains an integer T, denoting the number of the test cases.
For each test case: The first line contains 1 integer N, 1 <= N <= 2000. The second line contains N integers indicating T[1], T[2], ..., T[N]. It guarantees that the sum of T[i] in each test case is no more than 2000 and 1 <= T[i].
For each test case: The first line contains 1 integer N, 1 <= N <= 2000. The second line contains N integers indicating T[1], T[2], ..., T[N]. It guarantees that the sum of T[i] in each test case is no more than 2000 and 1 <= T[i].
Output
For each test case, output an integer representing the answer MOD 10^9 + 7.
Sample Input
21528 6
Sample Output
17
题意:RT
思路:找到一个x,然后求满足总和等于x的所有的解
而x要取T[i]总和的一半,比赛的时候只能想到要取x为T[i]的最大值,sad~
而求n个数(对应的位置不能超过T数组的上界)满足总和等于x的所有的解就是一个背包问题,dp搞就可以了
0 1
- 2014鞍山网络预选赛1004(贪心)hdu5000
- 2014鞍山网络预选赛1006(LCT模板题)hdu5002
- 2014鞍山网络预选赛1005(概率DP)hdu5001
- 2014鞍山网络预选赛1010(缩点+高斯消元)hdu5006
- hdu5000 Clone 鞍山网络赛D题
- 2014北京网络预选赛1006(贪心)HDU5037
- 2014鞍山站 D - Galaxy(数论+贪心)
- 2014网络赛 鞍山赛区
- 2014牡丹江网络预选赛E题(线段树)zoj3813
- 2014牡丹江网络预选赛D题(状压DP)zoj3812
- 2014牡丹江网络预选赛B题(找规律)zoj3810
- 2014西安网络预选赛1009(矩阵快速幂)hdu5015
- 2014西安网络预选赛1003(DP+剪枝)hdu5009
- 2014广州网络预选赛1008(树链剖分)HDU5029
- 2014西安网络预选赛1009(点分治)HDU5016
- 2014上海网络预选赛1003(树链剖分)HDU5044
- 2014上海网络预选赛1011(LCT)HDU5052
- HDU -- 5001 Walk(2014鞍山网络赛E)(概率)
- Nike ssxa zeg pnivk
- lv官網 dsga eza lnlbk
- ADT(Abstract Data Type)抽象数据类型
- android listview setselection 失效解决办法
- 传感器尺寸对比图
- 2014鞍山网络预选赛1004(贪心)hdu5000
- 网络编程中如何设置服务器监听IP
- 类的静态成员数据变量
- java 判断含有中文的字符串的长度
- jquery-mobile的页面跳转和iscroll之间的兼容解决方法
- poj 3672
- cocos2d-x 3.2 |跑酷游戏之 update使用方法
- ListView优化
- Reverse Nodes in k-Group