Time Limit: 2000/1000 MS (Java/others) memory limit: 65536/65536 K (Java/Others)
Total submission (s): 291 accepted submission (s): 131
Problem descriptionafter eating food from Chernobyl, DRD got a super power: He cocould 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 cocould not keep ve. 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 cocould not keep ve.
Now, as DRD's friend, ATM wants to know how many clones can have ve at most.
Inputthe 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 , t ,..., T [N]. it guarantees that the sum of T [I] in each test case is no more than 2000 and 1 <= T [I].
Outputfor each test case, output an integer representing the answer MOD 10 ^ 9 + 7.
Idea: Find an X, and then find all solutions that satisfy the sum of X.
X needs to take half of the sum of T [I]. During the game, only the maximum value of X is t [I ~
While finding the number of N (the corresponding position cannot exceed the upper limit of the T array) All solutions that meet the sum of X is a backpack problem, and DP is enough.
2014 Anshan network qualifiers 1004 (Greedy) hdu5000