fork(2) download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. #define ll long long
  5. #define endl "\n"
  6. #define FOR(i, a, b) for (int i = a; i <= b; i++)
  7. #define FORD(i, a, b) for (int i = a; i > b; i--)
  8. #define FORu(i, a, b) for (int i = a; i < b; i++)
  9. #define vii vector <int>
  10. #define pb push_back
  11. #define fi first
  12. #define se second
  13. #define sz(a) (int)a.size()
  14. #define all(x) x.begin(), x.end()
  15. #define filei "BAI5.INP"
  16. #define fileo "BAI5.out"
  17. int main()
  18. {
  19. ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  20. if (fopen(filei, "r"))
  21. {
  22. freopen(filei, "r", stdin);
  23. freopen(fileo, "w", stdout);
  24. }
  25. int n; cin >> n;
  26. vii a(n);
  27. FORu(i, 0, n) cin >> a[i];
  28. sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end());
  29. FORu(i, 0, sz(a)) cout << a[i] << " ";
  30.  
  31.  
  32.  
  33. }
Success #stdin #stdout 0s 5320KB
stdin
7
1 0 3 8 5 9 0
stdout
0 1 3 5 8 9