Pordenone's Cyberspace (hacking)

4 teams scored 210 points on this task, for a maximum score of 100, an average score of 53 and a median score of 47.

Highlights

  1. I.I.S. F. Alberghetti, Imola is the institute with the most points (100).
  2. Emilia-Romagna is the region with the most points (115).

Statement

Alessandro wants to challenge Edoardo’s control over Pordenone’s Cyberspace, hacking its main database! After days of attempts, Alessandro finally found a weak spot: the custom hash Edoardo uses for the master key, that is a sequence of N integers V_i, for i=0… N-1. Thanks to smart reverse engineering techniques, he also found the hash algorithm that Edoardo uses. Assume that the master key is a string of characters s_i for i=0… N-1. Then, V_i is the number of excess of s_i characters before position i relative to those following i. In formulas: V_i = #{j < i: s_j = s_i} - #{j > i: s_j = s_i} For example, assume that the master key is wow. The first hashed integer is the number of w preceding the first one (which is of course zero), minus the number of w following it (which is one), so that V_0 = 0 - 1 = -1. The second hashed integer is the number of o before the second character minus the number of o after it, which is V_1 = 0 - 0 = 0. Finally, V_2 = 1 - 0 = 1...