Advertisement
Josif_tepe

Untitled

May 18th, 2024
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <set>
  4. using namespace std;
  5. int main() {
  6.     int n;
  7.     cin >> n;
  8.     set<int> st;
  9.     for(int i = 0; i < n; i++) {
  10.         int x;
  11.         cin >> x;
  12.  
  13.         st.insert(x);
  14.     }
  15.  
  16.     cout << st.size() << endl;
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement