Spring Carnival (colors)

47 teams scored 3808 points on this task, for a maximum score of 100, an average score of 81 and a median score of 100.

Highlights

  1. Galileo Galilei, Trento is the institute with the most points (200).
  2. Emilia-Romagna is the region with the most points (826).

Statement

The Spring Carnival has arrived and N tourists have reached to the event. We know that all the tourists must wear a hat which is in one of the K colors. The carnival organizers have given each tourist a hat and asked them to sit in a line to take a group picture. However, the picture was lost, but fortunately an observer recorded for each person how many people in front of them had a hat of the same color as the hat they were wearing. For example, if the array is [0, 1, 0, 1, 2, 3], the second person had one person in front of them with the same hat color, while the fifth person had two people with the same hat color in front of them. Assuming that the carnival organizers have an unlimited number of hats of each of the K colors, find out how many different ways exist which could have been used to assign hats to people such that the array the observer recorded would be the same as the array we would record for that given configuration? Since the answer can be big...