1. 程式人生 > >第一屆 C語言比賽

第一屆 C語言比賽

https://zhuanlan.zhihu.com/p/49116229

This English game is a simple English words connection game.

The rules are as follows: there are N English words in a dictionary, and every word has its own weight v. There is a weight if the corresponding word is used. Now there is a target string X. You have to pick some words in the dictionary, and then connect them to form X. At the same time, the sum weight of the words you picked must be the biggest.

輸入N個單詞做成一個字典,每個單詞都有一個權值,

現在輸入一個長字串,從你上面輸入的字元查詢,計算出這個長字串最大的權值

 

涉及知識點

字典樹

DPdynamic programming的縮寫,中文為動態規劃程式設計