anyone tell me questions which can be solve by map on codechef,spoj or codeforces?

anyone tell me questions which can be solve by map on codechef,spoj or codeforces?

As specific, I don’t think you’ll find questions based on the use of map purely. STL is only an alternative to some standard algorithms. Like you can use sort() of stl as well you can write your own sort algorithms like mergesort, quicksort, heapsort etc. However, I mention some questions here in which I used map. Look:


http://www.codechef.com/problems/FROGV In question in which you use array, you can use map as well(usually it applies).

Ex: in bfs we need to make the visit array for checking which vertices have been visited or not, we can make map, for count of some elements of the array or something. In recursion problems also. Such situations are mostly apt for maps.
I’ll add on more to the list.

I wrote some time ago about what I call “counting map” - http://codeforces.com/blog/entry/3976 … there are also problem links…

1 Like