IP Address (ip)

282 teams scored 24120 points on this task, for a maximum score of 100, an average score of 86 and a median score of 100.

Highlights

  1. ITI Planck, Villorba is the institute with the most points (1020).
  2. Veneto is the region with the most points (3850).

Statement

Marco is trying to hack the network in his university. In order to do so, he needs to send a malicious packet to each computer that might be connected to the same network. Just to be sure, Marco decided to send the packet to a range of IP addresses. An IP address is a set of four “octets” separated by dots (each “octet” is an integer in the 0 to 255 inclusive range). For example, 127.0.0.1, 192.168.2.3 and 255.255.255.255 are valid IP addresses, while something like 10.20.300.4000 is not. Given an IP address, we can increment it and go to the next address in this way: if the last octet is less than 255 then we increment it by 1, otherwise we set it to 0 and increment the second-last octet (repeating this in a similar way to the left if necessary). This is similar to what happens when we increment a number by 1: if the last digit is 9 then we need to set it to 0 and increment the second-last digit (which could be 9 as well and so on)...