Advertisement
MasFlam

piwo tul

Dec 16th, 2019
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main(){
  6. int n;
  7. cin>>n;
  8. int t[20000] = {0};
  9.  
  10. for(int i = 0; i < n; i++){
  11. cin >> t[i];
  12. t[i]--;
  13. }
  14.  
  15. int types[15000] = {0};
  16.  
  17. for(int i = 0; i < n; i++){
  18. types[t[i]] = 1;
  19. }
  20.  
  21. int missingTypes = 15000;
  22.  
  23. for(int i = 0; i < 15000; i++){
  24. if(types[i] == 1){
  25. missingTypes--;
  26. }
  27. }
  28.  
  29. cout << missingTypes << endl;
  30.  
  31. return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement