Preparando MOJI

Good Number

1000ms 262144K

Description:

Let's call a number k-good if it contains all digits not exceeding k (0, ..., k). You've got a number k and an array a containing n numbers. Find out how many k-good numbers are in a (count each number every time it occurs in array a).

Input:

The first line contains integers n and k (1 ≤ n ≤ 100, 0 ≤ k ≤ 9). The i-th of the following n lines contains integer ai without leading zeroes (1 ≤ ai ≤ 109).

Output:

Print a single integer — the number of k-good numbers in a.

Sample Input:

10 6
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560
1234560

Sample Output:

10

Sample Input:

2 1
1
10

Sample Output:

1

Informação

Codeforces

Provedor Codeforces

Código CF365A

Tags

implementation

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 08:47:37

Relacionados

Nada ainda