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: Crabbles
Description Jennifer is practicing for a Crabbles tournament. She pulls out a handful of Crabbles tiles out of a bag, and tries to form the word with the highest possible score. Each tile contains a letter (used to form the word) and a number (its score value). She can use each tile at most once in her word, and she is not required to use every tile. The word that she forms must appear in her dictionary. Her score is the sum of the values of the tiles used in the word. Note that in Crabbles, different tiles with the same letter may have different score values. To check her work, Jennifer would like a program to tell her the maximum score possible for the set of tiles. Your task is to write this program. Input The first line contains an integer 1 ≤ Output For each hand in the input, output a line containing the maximum score possible with that hand. Sample Input 2 abcd hgfe 1 10 a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10 Sample Output 26 Source |

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

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

Any problem, Please Contact Administrator