
动态规划
文章平均质量分 77
ShawnVan_Bean
软件工程大二学生一枚
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
数塔问题
在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的: 有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少? 已经告诉你了,这是个DP的题目,你能AC吗? Input 输入数据首先包括一个整数C,表示测试实例的个数,每个测试实例的第一行是一个整数N(1 <= N <= 100),表示数塔的高度,接下来用N行数字原创 2017-08-04 13:50:46 · 326 阅读 · 0 评论 -
Super Jumping! Jumping! Jumping!
Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to you now. T原创 2017-08-04 14:41:35 · 207 阅读 · 0 评论 -
Common Subsequence
A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there exists a strictly increa原创 2017-08-04 15:58:52 · 227 阅读 · 0 评论 -
Piggy-Bank(完全背包)
Before ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this action comes from Irreversibly Bound Money (IBM). The idea behind is simple原创 2017-08-04 18:50:14 · 319 阅读 · 0 评论 -
Coins(多重背包)
Whuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in a nearby shop. He wante原创 2017-08-05 09:04:17 · 2650 阅读 · 1 评论 -
AGTC
Let x and y be two strings over some finite alphabet A. We would like to transform x into y allowing only operations given below: Deletion: a letter in x is missing in y at a corresponding posit原创 2017-08-05 13:12:12 · 439 阅读 · 0 评论 -
石子合并问题--直线版(矩阵相乘)
一条直线上摆放着一行共n堆的石子。现要将石子有序地合并成一堆。规定每次只能选相邻的两堆合并成新的一堆,并将新的一堆石子数记为该次合并的得分。请编辑计算出将n堆石子合并成一堆的最小得分和将n堆石子合并成一堆的最大得分。 Input 输入有多组测试数据。 每组第一行为n(n=100),表示有n堆石子。 二行为n个用空格隔开的整数,依次表示这n堆石子的石子数量ai(0 Outpu原创 2017-08-05 09:22:39 · 758 阅读 · 0 评论 -
Bone Collector(01背包)
Many years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave … The bone collect原创 2017-08-04 16:43:59 · 258 阅读 · 0 评论