백준 2910번 빈도정렬 (C++)(stable, unordered_map, find와 find_if,람다식,stable_sort)


백준  2910번 빈도정렬 (C++)(stable, unordered_map, find와 find_if,람다식,stable_sort)

문제와 정말 정말 오래걸린 문제이다.살짝 부끄럽지만 일단은 내가 vector, pair ,stable_sort, map ,unordered_map,find,find_if 등에 대해서 공부하는 시간이 됐다.정답 코드#include #include #include #include #include using namespace std; bool my_sort(pair a,pair b) { return (a.second > b.second); } int main() { ios :: sync_with_stdio(0); cin.tie(0); int n,c; cin >> n >> c; vectorarr; int num; for (int i=0;i < n;i++) { cin >> num; auto a = find_if(..


원문링크 : 백준 2910번 빈도정렬 (C++)(stable, unordered_map, find와 find_if,람다식,stable_sort)