fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main(){
  5. map<int,int> b;
  6. vector<int> a;
  7. int n,s; cin >> n;
  8. while(n--){
  9. cin >> s;
  10. a.push_back(s);
  11. b[s]++;
  12. }
  13. cout << a.size() - b.size() + 1;
  14. //cout << 1+(n-b.size());
  15. }
Success #stdin #stdout 0.01s 5260KB
stdin
10
10 10 10  10 10 10 11 12 9 9

stdout
7