#include <iostream>
#include <algorithm>
#include <vector>
int main()
{
std::vector<int> v = { 5, 2, 9, 6, 12, 7, 8, 3, 1, 0 };
partial_sort(v.begin(), v.begin() + 3, v.end(), std::greater<int>());
for(auto const& n : v)
std::cout << n << " ";
std::cout << "\nfirst = " << v[0] << "\n";
std::cout << "second = " << v[1] << "\n";
std::cout << "third = " << v[2] << "\n";
return 0;
}
/*
run:
12 9 8 2 5 6 7 3 1 0
first = 12
second = 9
third = 8
*/