fork download
  1. #include <iostream>
  2. using namespace std;
  3. int tab[1000001];
  4. int main() {
  5. int n, x, ile = 0;
  6. cin >> n;
  7.  
  8. for (int i = 0; i < n; i++) {
  9. cin >> x;
  10. tab[x]++;
  11. }
  12.  
  13. for (int j = 0; j <= 1000000; j++) {
  14. if (tab[j] == 1) {
  15. ile++;
  16. }
  17. }
  18.  
  19. cout << ile;
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0.01s 5280KB
stdin
5
2 
3 
7 
2 
8
stdout
3