#include <algorithm>
#include <functional>
#include <iostream>
#include <vector>
template <class T, typename P = std::less<typename T::value_type>>
void dropsort(T& cont, P pred = P())
{
cont.erase(std::unique(cont.begin(), cont.end(), std::not2(pred)),
cont.end()
);
}
int main( )
{
std::vector<int> arr = {0, 2, 1, 4, 3, 6, 5, 7, 9, 8};
dropsort(arr);
std::cout << std::is_sorted(arr.begin(), arr.end());
}
I2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGZ1bmN0aW9uYWw+CiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHZlY3Rvcj4KCnRlbXBsYXRlIDxjbGFzcyBULCB0eXBlbmFtZSBQID0gc3RkOjpsZXNzPHR5cGVuYW1lIFQ6OnZhbHVlX3R5cGU+Pgp2b2lkIGRyb3Bzb3J0KFQmIGNvbnQsIFAgcHJlZCA9IFAoKSkKewogICAgY29udC5lcmFzZShzdGQ6OnVuaXF1ZShjb250LmJlZ2luKCksIGNvbnQuZW5kKCksIHN0ZDo6bm90MihwcmVkKSksCiAgICAgICAgICAgICAgIGNvbnQuZW5kKCkKICAgICAgICAgICAgICApOwp9CgppbnQgbWFpbiggKQp7CiAgICBzdGQ6OnZlY3RvcjxpbnQ+IGFyciA9IHswLCAyLCAxLCA0LCAzLCA2LCA1LCA3LCA5LCA4fTsKICAgIGRyb3Bzb3J0KGFycik7CiAgICBzdGQ6OmNvdXQgPDwgc3RkOjppc19zb3J0ZWQoYXJyLmJlZ2luKCksIGFyci5lbmQoKSk7Cn0K