Electrical Power Line (powerline)

181 teams scored 7650 points on this task, for a maximum score of 100, an average score of 42 and a median score of 30.

Highlights

  1. Galileo Galilei, Trento is the institute with the most points (500).
  2. Lombardia is the region with the most points (1400).

Statement

Luca needs a lot of electricity to run its homelab, composed of lots of very powerful servers. For this reason, some years ago he built a very complex overhead power line composed of N towers. The N towers are connected in a line and the i-th tower is H_i meters high. In order to increase their efficiency, a new law mandates that every tower in a power line must be at least as high as the following one. Luca needs to change the height of some towers, in order to meet the new requirements. Every day, starting from the first tower, Luca will increase the height of every tower to the same height of the next one. Of course, if one tower is already taller than the following one it will not be modified. How many days does Luca need to finish the job?