SHARE
TWEET

Untitled

a guest Jan 19th, 2020 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2. #define F first
  3. #define S second
  4. #define PB push_back
  5. #define MP make_pair
  6. #define MAXN 10000
  7. #define MOD 100000
  8.  
  9. using namespace std;
  10.  
  11. typedef vector<int> vi;
  12. typedef pair<int,int> ii;
  13. typedef vector<ii> vii;
  14. typedef long long ll;
  15.  
  16. int main(){
  17.     int n;
  18.     scanf("%d", &n);
  19.     vi v(n);
  20.     for(int i = 0; i < n; i++){
  21.         scanf("%d", &v[i]);
  22.     }
  23.     sort(v.begin(), v.end());
  24.     v.erase(unique(v.begin(),v.end()), v.end());
  25.     for(int i = 0; i < v.size(); i++){
  26.         printf("%d ", v[i]);
  27.     }
  28.     printf("\n");
  29.     return 0;
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top