Christmas Lights (lights)

215 teams scored 11965 points on this task, for a maximum score of 100, an average score of 56 and a median score of 55.

Highlights

  1. Galilei, Verona is the institute with the most points (325).
  2. Lombardia is the region with the most points (2325).

Statement

Davide wants to decorate his home for Christmas, even though his budget as a student is pretty limited, and he needs to avoid excessive expenses. After days of searching around the city, he finally found a nice row of almost new Christmas lights: it is time to start the decorations! The row consists of N consecutive lights, numbered from 0 to N-1. Each light has a colour L_i (i = 0 … N-1), represented by a number between 0 and C-1. Every colour between 0 and C-1 appears at least once in the row of lights. In order to save energy (running the house dynamo is tiring!), he wants to cut off a segment of consecutive lights from the row containing every colour between 0 and C-1 at least once. What is the length of the shortest segment he can cut?