fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. const int maxn = 1e6+7;
  4. int x,cnt(0);
  5. int d[maxn];
  6. int main()
  7. {
  8. while(cin >> x)
  9. {
  10. if(d[x]==0)
  11. {
  12. d[x]++;
  13. cnt++;
  14. }
  15. }
  16. cout << cnt;
  17. }
Success #stdin #stdout 0.01s 5548KB
stdin
2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 
stdout
1