Problem - C - Codeforces
Problem - C - Codeforces
Enter | Register
HOME TOP CATALOG CONTESTS GYM PROBLEMSET GROUPS RATING EDU API CALENDAR HELP RAYAN
Codeforces Blitz Cup 2025 Final Rounds Have Started! Join the stream now: https://youtu.be/rbHFLNg7Nkc. ×
PROBLEMS SUBMIT CODE MY SUBMISSIONS STATUS HACKS ROOM STANDINGS CUSTOM INVOCATION
https://codeforces.com/contest/2062/problem/C 1/2
3/9/25, 10:21 PM Problem - C - Codeforces
5 → Problem tags
1
-1000
brute force math *1200
2
5 -3 No tag edit access
2
1000 1
9 → Contest materials
9 7 9 -9 9 -8 7 -8 9
11 Announcement (en)
678 201 340 444 453 922 128 987 127 752 0
Tutorial (en)
output Copy
-1000
8
1001
2056
269891
Note
In the first test case, Cirno can not perform any operation, so the answer is −1000 .
In the second test case, Cirno firstly reverses the sequence, then replaces the sequence with its
difference sequence: [5, −3] → [−3, 5] → [8]. It can be proven that this maximizes the sum, so the
answer is 8.
In the third test case, Cirno can choose not to operate, so the answer is 1001 .
Supported by
https://codeforces.com/contest/2062/problem/C 2/2