#P2389. 电脑班的裁员
电脑班的裁员
Description
ZZY has a unique downsizing method: each student has an exam score (). Among students (), choose no more than () contiguous segments of students to keep, and dismiss the unselected students, so that the sum of the remaining students’ scores is maximized. Note that wrong answers deduct points [don’t ask me why], so scores may be negative.
Input Format
The first line contains . The second line contains the scores of students to .
Output Format
A single number , the maximum sum of scores.
5 3
1 -1 1 -1 1
3
Hint
2014 Peng Kunzhi: "The statement is so short — looks trivial at first glance."
Translated by ChatGPT 5
京公网安备 11011102002149号