fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int N;
  6. set<int> st;
  7. cin>>N;
  8. int K;
  9. while(N--){
  10. cin>>K;
  11. st.insert(K);
  12. }
  13. cout << st.size() << '\n';
  14. }
Success #stdin #stdout 0.01s 5320KB
stdin
5
2 3 2 2 3
stdout
2