fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. long long int n,temp,i;
  7. set<int> s;
  8. cin >> n;
  9. for(i=0;i<n;i++)
  10. {
  11. cin >> temp;
  12. s.insert(temp);
  13. }
  14. cout << s.size();
  15. return 0;
  16. }
Success #stdin #stdout 0.01s 5428KB
stdin
5
2 3 2 2 3
stdout
2