stables_sort

입출력   풀이 #include #include #include #include using namespace std;bool compare(pair a, pair b){ return a.first > cnt; int age; string name; vector> info; for (int i = 0; i > age >> name; info.push_back({ age, name }); } stable_sort(info.begin(), info.end(), compare); cout    stable_sort() 는 안정된 정렬을 보장한다따라서 비교하는 값이 같은 경우에는 입력된 순서대로 출력한다
연Gennie
'stables_sort' 태그의 글 목록