Maximum Sum Increasing Subsequence
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given a sequence of length . Find its subsequence such that
the numbers in the subsequence are sorted in strictly ascending order.
the sum of numbers in the subsequence is the biggest
Input
The first line contains the size of array .The second line contains integers .
Output
Print the sum of the maximum sum subsequence.
Examples
For example, if input is , then output should be .
Input #1
Answer #1
Submissions 148
Acceptance rate 32%