#include <iostream>
#include <vector>
#include <algorithm>
int main()
{
std::vector<int> v = {1, 1, 2, 2, 2, 3, 3, 4, 2, 2, 5, 5, 6, 7};
auto new_end = std::unique(v.begin(), v.end());
v.erase(new_end, v.end());
for (int i : v)
std::cout << i << ' ';
}