fork 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.  
  12. int main()
  13. {
  14. int n,k;cin>>n>>k;
  15. ll count=0;
  16. while(n--)
  17. {
  18. bool ch=0;
  19. string s;
  20. cin>>s;
  21. map<int,bool>mp;
  22. mp.clear();
  23. for(int i=0;i<s.size();i++)
  24. {
  25. mp[s[i]-'0']=true;
  26. }
  27. for (int i = 0; i <=k ; ++i) {
  28. if(mp[i]==false)
  29.  
  30. {ch=1;break;}
  31. }
  32. if(ch==0)
  33. count++;
  34.  
  35. }
  36. cout<<count<<ne;
  37. }
Success #stdin #stdout 0.01s 5272KB
stdin
10 6
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
stdout
10