Similar things have been asked before but I am having trouble applying the concept. I would like to to keep track of the indices of the pairs in my vector of pairs then, once sorted, std::cout the input order.
e.g.
cin >> 5 6 1 5 1 2 1 2 3 5
cout << 1 2 1 2 1 5 3 5 5 6
//and this is where I am having trouble
cout >> 3 4 2 5 1
I was thinking of converting to triples, where the last element is the index but that was causing headaches and errors.