第一届 C语言比赛
发布日期:2021-06-30 18:54:58 浏览次数:2 分类:技术文章

本文共 517 字,大约阅读时间需要 1 分钟。

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的缩写,中文为动态规划编程

 

转载地址:https://linus.blog.csdn.net/article/details/83994860 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:Unicode 和 UTF-8 有什么区别?
下一篇:C 实现 删除字符串空白符的函数 strtrim

发表评论

最新留言

路过,博主的博客真漂亮。。
[***.116.15.85]2024年04月10日 15时01分50秒