Comments

It seems sometimes people downvote just because the colour of your name isn't good enough!

On tourist → Hello 2018, 9 years ago
+6

Extra 10 minutes for 10k registrants :)

Am I the only one who is seeing random people turning red?

On Lewin → Good Bye 2017, 9 years ago
0

they have all the colours, though

On Lewin → Good Bye 2017, 9 years ago
0

better done than said.

On Lewin → Good Bye 2017, 9 years ago
0

When you lock an answer and think to hack to jump up on the scoreboard, and you yourself get hacked. Crap :/ Never felt so helpless.

On Lewin → Good Bye 2017, 9 years ago
+9

May the force code with you.

0

Isn't anti hash map test there to avoid the same problem that I've stated above?

0

Yes. But the sum-1 and sum+1 in case of many test cases can have a collision in their key values. And when there is too many collision and load factor that is current size/table size crosses 0.7 then a process called rehashing is performed in which size of the table is doubled. Which costs o(n) time complexity. So maybe due to repeated rehashing, it is giving TLE.

-13

This can be explained by a single fact that Unordered_map is implemented using a hash table. In which a hash key is generated for the input and it is stored at the key location. Whereas in case of Ordered Map or map it is stored in a tree.

So whenever same values are stored in an unordered_map then there will be a link list at the key. And it will take O(n) time to access a link list. Whereas in ordered_map it will always take O(log n) time.

So, it is advisable to use unordered_map in case of unique elements only.

Think twice code once, you could have been red.

In comparison to other judges Codeforces has the simplest language.

On kashyap → spoj tutorial for ABA12C, 9 years ago
0

Can you explain it in a greater detail?

For D, divide sum of pair which is to be found by 2.In case of even numbers on the pairs will be on both the sides of halved number. We only need to find the number of pairs. So this makes it even easier.

On ODT → Codeforces Round #449, 9 years ago
0

Div2 B wow author is a bob Dylan fan :P

can you elaborate the solution in a greater detail