cf/mirror

Maximum Subsequence Value

CF
1365E1900· candidate master2s256 MB⌨ stdin/stdout

Examples

Sample 1of 4
Input
3
2 1 3
Output
3
Sample 2of 4
Input
3
3 1 4
Output
7
Sample 3of 4
Input
1
1
Output
1
Sample 4of 4
Input
4
7 7 1 1
Output
7
1365E.cpp
loading editor…
Ln 11·137 BGNU C++20 (64)