A faster solution :
Competitive-Programming-Playlist/journeytothemoon.cpp at master · Trathz/Competitive-Programming-Playlist · GitHub
Constraints: The values in the ids are <= 10^9, not <= 109. (CodeChef has a typo).
Indian National Olympiad in Informatics (INOI) is ro...
If tle, use unordered_map and will pass :D
Clarification: There seems to be an issue with the last test case for this problem. If your code passes everything but the last test case, consider it to be an AC.
Thanks, same thing here unfortunately :/