设为首页 加入收藏

TOP

HDOJ 5000 Clone
2015-07-20 17:39:46 来源: 作者: 【 】 浏览:2
Tags:HDOJ 5000 Clone

所有满足的情况的属性和是一定的,而且属性和等于sum/2时得到的结果最大.


Clone

Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 574 Accepted Submission(s): 277


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.
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].

Output For each test case, output an integer representing the answer MOD 10^9 + 7.
Sample Input
2
1
5
2
8 6

Sample Output
1
7

Source 2014 ACM/ICPC Asia Regional Anshan Online


#include 
  
   
#include 
   
     #include 
    
      #include 
     
       using namespace std; typedef long long int LL; const LL mod=(1e9+7); int v[2020],n; LL sum,dp[2][2000400]; int main() { int T_T; scanf("%d",&T_T); while(T_T--) { scanf("%d",&n); sum=0; for(int i=0;i
      
       


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇ZOJ 1542 POJ 1861 Network 网络 .. 下一篇九度OJ1004 Median

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·数据库:推荐几款 Re (2025-12-25 12:17:11)
·如何最简单、通俗地 (2025-12-25 12:17:09)
·什么是Redis?为什么 (2025-12-25 12:17:06)
·对于一个想入坑Linux (2025-12-25 11:49:07)
·Linux 怎么读? (2025-12-25 11:49:04)