Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
1,532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int co[105];
  6.  
  7. int main()
  8. {
  9.     int n,x;
  10.     cin >> n >> x;
  11.     for(int i=0;i<n;i++)
  12.     {
  13.         int a;
  14.         cin >> a;
  15.         co[a]++;
  16.     }
  17.     int ans=0;
  18.     for(int i=0;i<x;i++)
  19.         ans+=(co[i]==0);
  20.     ans+=(co[x]!=0);
  21.     cout << ans << endl;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement