Created
October 3, 2018 14:43
-
-
Save hiramekun/6c7c94d5daaf9d6657b42ea8633ebe0c to your computer and use it in GitHub Desktop.
mapをvectorに変換して,それをvalueの値でsortする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unordered_map<int, int> mp_even; | |
vector<pair<int, int> > elem_even(mp_even.begin(), mp_even.end()); | |
sort(elem_even.begin(), elem_even.end(), | |
[](pair<int, int> a, pair<int, int> b) { return a.second > b.second; }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment