Codeforces and Polygon may be unavailable from December 6, 19:00 (UTC) to December 6, 21:00 (UTC) due to technical maintenance. ×

Tenz1n's blog

By Tenz1n, history, 15 months ago, In English

I was solving the problem : 1732D1 - Balance (Easy version). And my solution was same as i keep the track of the kth-MEX of the xth element when ever the request has been made. So for checking whether the kth element is present in the set or not, i used unordered_map<> by while adding the elements in the unordered_map<> when the add operation is processed. But i got TLE at test 36. Later when i checked other's solution they used ordered_map<> and used the .find() function to check whether the element is added to the set or not. And then i also used that .find() function and it got accepted.

Can anyone help tell me why by using mapping with unordered_map<> gives TLE and get Accepted while using .find() function?

Submission 1 : 223430749 Submission 2 : 223513656

Full text and comments »

  • Vote: I like it
  • +4
  • Vote: I do not like it