Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|

Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |

Language: Scrabble
Description The game of Scrabble is played with tiles. A tile either has a single letter written on it, or it is blank. In the latter case, the tile may be used to represent a letter of your choice. On your turn, you arrange the tiles to form a word. Each tile may be used at most once, but not all tiles need to be used. Given several Scrabble tiles and a dictionary, determine how many words in the dictionary can be formed using the given Scrabble tiles. Input The input test file will contain multiple test cases. In each test case, the first line contains a positive integer Output For each test case, write a single line with the number of dictionary words that can be spelled with the given Scrabble tiles. Sample Input 5 PROGRAM CONTEST PIZZA ZA PITA _PIZA 3 BANANAS CARROTS FIGS A__AA__ 0 Sample Output 3 2 Hint In the first test case, Source |

[Submit] [Go Back] [Status] [Discuss]

All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di

Any problem, Please Contact Administrator