fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int a,b,c,d,e,f,g,h,j,i,x,y,z;
  6. cin>>a;
  7. for(b=0;b<a;b++)
  8. {
  9. cin>>c;
  10. int arr[c+1];
  11. int arr2[c+1];e=0;
  12. memset(arr2,0,sizeof(arr2));
  13. for(d=1;d<=c;d++)
  14. {
  15. cin>>arr[d];
  16. arr2[arr[d]]++;
  17. }
  18. for(d=1;d<=c;d++)
  19. {
  20. if(arr2[d]==0)
  21. {
  22. e++;
  23. }
  24. }
  25. cout<<e<<"\n";
  26. }}
Success #stdin #stdout 0s 16048KB
stdin
Standard input is empty
stdout
Standard output is empty