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