Font
Time limit1sMemory limit256 MB
Count the subsets of the given words whose letters together cover all 26 lowercase letters.
- Level
Medium4 of 10
- Topics
- Brute force, Bit manipulation
- Solved
- No attempts yet
Problem
Sanggeun wants to write one sentence that tests the font he made. The font contains only lowercase letters, so the sentence has to be written in lowercase letters as well.
The test sentence has to contain all 26 lowercase letters.
Anyone who has solved a lot of problems should already sense what this problem asks after reading only this far.
Sanggeun has one dictionary with words in it. The test sentence can only use words from the dictionary, and each word can be used only once. The order of the words does not matter. ("uvijek jedem sarmu" and "jedem sarmu uvijek" are the same sentence.)
Write a program that counts the test sentences Sanggeun can make.
Input
The first line contains the number of words (). Each of the next lines contains one word from the dictionary. A word consists of lowercase letters only and is at most 100 characters long. No word is given twice.
Output
Print the number of test sentences Sanggeun can make.