POPLOCAVANJE - COCI
Mirko's ASCII street is made of N lowercase letters of the English alphabet. The city government occasionally replaces the tiles in the street. However, the letter tiles are in high demand, so the government has only M different tile patterns available.
The i-th tile pattern consists of Li letters. A tile cannot be rotated or broken into pieces, and it can only be placed such that the tile letters coincide with the contiguous letter subsequence in the street.Tiles can overlap and we can use multiple tiles of the same pattern.
A street cell is untileable if it cannot be covered by any tile. Compute the number of untileable cells.
Input:
6
abcbab
2
cb
cbabOutput:
2Input:
4
abab
2
bac
babaOutput:
4Input:
6
abcabc
2
abca
cabOutput:
1Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.