Advertisement
yejolga

ol2_1

Jan 28th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. #include <algorithm>
  4.  
  5.  
  6. using namespace std;
  7.  
  8.  
  9. int main()
  10. {
  11.     int n;
  12.     cin>>n;
  13.     vector<long long> v1;
  14.     v1.resize(n);
  15.     for(int i = 0; i < n; i++)
  16.         cin>>v1[i];
  17.     sort(v1.begin(), v1.end());
  18.     auto last = unique(v1.begin(), v1.end());
  19.     v1.erase(last, v1.end());
  20.     for(auto i : v1)
  21.         cout<<i<<' ';
  22.  
  23.     return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement