zanzibar - bradendubois/competitive-programming GitHub Wiki
Stand on Zanzibar
ID: zanzibar
Difficulty: 1.4
CPU Time: 1 second
Memory: 1024 MB
Solution
For each of the T cases, one starts a total at 0 and keeps a reference to the current and previous values along the line, updated each as one moves forward. If current is greater than 2 * previous, that difference is added to the total.