C++ has always had the convenient data structures std::set and std::map, which are tree data structures whose operations take
time. With C++11, we finally received a hash set and hash map in std::unordered_set and std::unordered_map. Unfortunately, I've seen a lot of people on Codeforces get hacked or fail system tests when using these. In this post I'll explain how it's possible to break these data structures and what you can do in order to continue using your favorite hash maps without worrying about being hacked







.
again.
, extremely low.
= 1,000,000. Even if you don't want to do the math, you can observe that the answer is between
= 1,500,000, the average distance for index
= 750,000, the average distance for index
by using an
. Let's define the function
, which I'll describe here:
, if we picked two of the 
, and the solutions above use this idea.
. The case above makes use of this fact by alternating angles of
and
, making all cross products the same despite angles being different.
, and
(our polygons are convex). A similar idea that also works is to use the distance between vertex
.
