Mock CCC '26 S2 - The Quick Brown Fox
View as PDFMock Canadian Computing Competition: 2026 Senior #2
The quick brown fox jumps over the lazy dog is a famous sentence that contains all the letters of the English alphabet from a to z. Such a sentence or phrase that have all the letters in the alphabet appear at least once is known as a pangram.
Amelia has a set of strings, each containing only lowercase alphabetical letters, each with a length of
. She would like to put as many as of them as she can in a bag such that all the strings combined within the bag form a pangram. Unfortunately, the bag can only fit exactly
strings, and so she must choose one to exclude from being within the bag.
For example, if she has the following strings:
abcdefghijklmnopqrstuvwxxyabcdefghijklmnopqrstuvwyyzabcdefghijklmnopqrstuvwzzz
Amelia could choose to remove either the or
string, and the remaining
would form a pangram. However, if she removed the
string, then the remaining letters would not form a pangram since the letter
x would not appear in the remaining strings. In this case, she has choices of strings that she could remove such that the remaining strings form a pangram.
How many of her strings can she exclude such that the remaining
strings form a pangram?
Input Specification
The first line contains spaced integers
and
, indicating the number of strings and the length of the strings respectively.
The next lines each contain a string of
lowercase alphabetical characters.
The following table shows how the available 15 marks are distributed.
| Marks | Bounds on |
Bounds on |
|---|---|---|
Output Specification
Output the number of strings that she could exclude from her set of strings, such that the remaining ones form a pangram.
Sample Input 1
3 26
abcdefghijklmnopqrstuvwxxy
abcdefghijklmnopqrstuvwyyz
abcdefghijklmnopqrstuvwzzz
Output for Sample Input 1
2
Explanation of Output for Sample Input 1
This is the case from the problem statement.
Sample Input 2
2 1
a
b
Output for Sample Input 2
0
Explanation of Output for Sample Input 2
There is no way to exclude one string such that the other one is a pangram.
Sample Input 3
8 5
yxwvu
tsrqp
onmlk
jihgf
edcba
tnalp
osmqz
rkpzp
Output for Sample Input 3
5
Explanation of Output for Sample Input 3
Amelia could choose to exclude either the ,
,
,
, or
string.
Comments