ENG
RUS
Timus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board
Discussion of Problem
1869
. New Year Cruise
hint: prefix sum
Posted by
So Sui Ming
16 Dec 2023 18:54
1 2 3
1->2:180 180 -180
1->3:180 180 -180
2->3:180 180 -180
overall: 360 0 -360
prefix sum: 360 360 0
hence max from 1 to 3 is 360
do this similarly from 3 to 1
© 2000–2024
Timus Online Judge Team
. All rights reserved.