Thank you for helping, but let's just say that they are randomly generated 1000 ints. How does that work in this case? because you would eventually run of alphabets to use as IDs.
using std::multimap, place each value into the map along with it's corresponding ID. std::multimap allows the storage of multiple of the same value, and uses Red-black tree internally so the values are now sorted when inserted into the tree. Also the sorting is stable
Example: http://coliru.stacked-crooked.com/a/226935d5217f522b