fork(1) download
  1. #include <bits/stdc++.h>
  2.  
  3. #define ne "\n"
  4. #define ll long long
  5. #define cinn copy(istream_iterator<int>(cin), istream_iterator <int>(), back_inserter(v))
  6. #define coutt copy(v.begin(), v.end(), ostream_iterator<int>(cout, " "))
  7. #define ret return
  8. #define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
  9.  
  10. using namespace std;
  11. double pi = 3.14159265358979323846;
  12.  
  13. int main()
  14. {
  15. int n,k;cin>>n>>k;
  16. ll count=0;
  17. while(n--)
  18. {
  19. bool ch=0;
  20. string s;
  21. cin>>s;
  22. map<int,bool>mp;
  23. mp.clear();
  24. for(int i=0;i<s.size();i++)
  25. {
  26. mp[s[i]-'0']=true;
  27. }
  28. for (int i = 0; i <=k ; ++i) {
  29. if(mp[i]==false)
  30.  
  31. {ch=1;break;}
  32. }
  33. if(ch==0)
  34. count++;
  35.  
  36. }
  37. cout<<count<<ne;
  38. }
Success #stdin #stdout 0.01s 5276KB
stdin
10 6
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
stdout
10