Christmas Tree (xmastree)

13 teams scored 620 points on this task, for a maximum score of 100, an average score of 48 and a median score of 30.

Highlights

  1. Galileo Galilei, Trento is the institute with the most points (100).
  2. Trentino is the region with the most points (200).

Statement

Each year the Christmas decorations are prepared earlier and earlier. This year is no exception, and William wants to be prepared! William is planning to put a really big Christmas tree in his garden, bigger and brighter than everyone else! The tree is built starting from a big pine tree, where many lights are installed on the branches. Starting from the root one or more cables are installed, and when there's a branch a light is placed there and one or more new cables come out of it. When a leaf is reached a new light is placed together with a switch. Pressing the switch will toggle all the lights in the path from that leaf to the root (turning on the switched off lights and vice-versa). After all this work William turns on all the N lights but realized that his tree is pretty boring. To avoid re-routing all the lights he decides to assign a niceness level A_i to all the N lights (A_i might be negative as well). If a light is turned off its niceness level goes to zero...