Advertisement
RabbitPower

A10

Oct 24th, 2020
1,645
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <set>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7.     int n;
  8.     cin >> n;
  9.  
  10.     set<int> s;
  11.  
  12.  
  13.     for (int i = 0; i < n; i++) {
  14.         int x;
  15.         cin >> x;
  16.         s.insert(x);
  17.     }
  18.     cout << s.size()<<endl;
  19.  
  20.     for (int x : s) {
  21.         cout << x << ' ';
  22.     }
  23.  
  24.  
  25.     s.erase(3);
  26.     cout << endl;
  27.     for (int x : s) {
  28.         cout << x << ' ';
  29.     }
  30.  
  31.    
  32.    
  33.  
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement