Problem1747--DP-最大上升子序列的和

1747: DP-最大上升子序列的和

Time Limit: 1 Sec  Memory Limit: 128 MB
Submit: 36  Solved: 20
[Status] [Submit] [Creator:]

Description

输入n个数字,求最大上升子序列的和。

Input

输入的第一行是序列的长度N(1<=N<=2000)。第二行给出序列中的N个整数,这些整数的取值范围都在0到10000(可能重复)。

Output

包含一个数字,为最大上升子序列和。

Sample Input Copy

7
1 7 3 5 9 4 8

Sample Output Copy

18

Source/Category

 提高A