Leone_kyoya's blog

By Leone_kyoya, history, 23 months ago, In English

Using maps in C++ is common but dangerous also. As for the question Link if we use map, then it may leads to TLE, but the same CODE will work if you use a vector or any other method for storing the count of the given elements. This is because map is a self-balanced BST(Balanced Binary Search Tree). and it takes O(LOGN) time to insert and search element. So always be careful while using the map

Full text and comments »

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