fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int T;
  6. cin >> T;
  7.  
  8. while (T--) {
  9. int n, k;
  10. cin >> n >> k;
  11.  
  12. int dem = 0;
  13.  
  14. for (int i = 0; i < n; i++) {
  15. int x;
  16. cin >> x;
  17.  
  18. if (x == 0) {
  19. if (k == 0) dem++;
  20. continue;
  21. }
  22.  
  23. while (x > 0) {
  24. if (x % 10 == k)
  25. dem++;
  26. x /= 10;
  27. }
  28. }
  29.  
  30. cout << dem << endl;
  31. }
  32.  
  33. return 0;
  34. }
Success #stdin #stdout 0.01s 5296KB
stdin
Standard input is empty
stdout
0
0