Hi everyone!
I don't know, maybe this topis was discussed on Codeforces but google didn't help me.
It seems that standart hash function in gcc works badly (for Visual C++ all is good).
For 0 ≤ x ≤ 232 - 1
std::hash<int>()(x) == x
std::hash<long long>()(x) == x
For any other number
std::hash<long long>()(x + (1LL << 32)) == std::hash<long long>()(x)
For example code in spoiler works more than 10 seconds on Codeforces because hashes of all numbers are equal to zero.
Code
What can we do without writing our own hash function?