There are two arrays, one for ids and one for scores, I want to store the two arrays to a std::map
, and use the std::partial_sort
to find the five highest scores, then print their ids
so, Is there any possible to use the std::partial_sort
on std::map
?
Can I use std::partial_sort to sort a std::map?
812 Views Asked by TwenteMaster At
2
In
std::map
, sorting applies only to keys. You can do it using vector:Here is the Demo