modulo - bradendubois/competitive-programming GitHub Wiki
Modulo
ID: modulo
Difficulty: 1.4
CPU Time: 1 second
Memory: 1024 MB
Solution
Nothing too complicated: keep a map to track the occurrences of numbers, and a tally of unique remainders. At each number, see if its remainder (modulo 42) has been seen in the map, if not, increment the tally, but increment the occurrences of this number in the map either way.