下载此文档

《c案例04动态规划》.ppt


文档分类:管理/人力资源 | 页数:约57页 举报非法文档有奖
1/57
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/57 下载此文档
文档列表 文档介绍
第四讲
动态规划
(Dynamic programming)
Date
1
整理课件
一、经典问题:数塔问题
有形如下图所示的数塔,从顶部出发,在每一结点可以选择向左走或是向右走,一直走到底层,要求找出一条路径,使路径上s are m[1], m[2],..., m[n] then it must be the case that  W[m[1]] < W[m[2]] < ... < W[m[n]] and  S[m[1]] > S[m[2]] > ... > S[m[n]] In order for the answer to be correct, n should be as large as possible. All inequalities are strict: weights must be strictly increasing, and speeds must be strictly decreasing. There may be many correct outputs for a given input, your program only needs to find one.
Date
13
整理课件
三 1160 FatMouse's Speed
Sample Input
6008 1300 6000 2100
500 2000 1000 4000 1100 3000 6000 2000 8000 1400 6000 1200 2000 1900
Sample Output 4
4
5
9
7
Date
14
整理课件
三 1160 FatMouse's Speed
解题思路:
题目要求找到的体重递增,速度递减
老鼠,先把老鼠的体重进行升序排序
然后算出速度的最长递减子序列。
Date
15
整理课件
四 1087 Super Jumping! Jumping! Juping!
Problem Description
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.

The game can be played by two or more than two players. It consists of a chessboard(棋盘)and some chessmen(棋子), and all chessmen are marked by a positive integer or “start” or “end”. The player starts from start-point and must jumps into end-point finally. In the course of jumping, the player will visit the chessmen in the path, but everyone must jumps from one chessman to another absolutely bigger (you can assume start-point is a minimum and end-point is a maximum.). And all players cannot go backwards. One jumping can go from a chessman to next, also can go across many chessmen, and even you can straightly get to end-point from start-point. Of course you get zero point in this situation. A player is a winner if and only if he can get a bigger score according to his jumping solution. Note that your score comes from the sum of value on the chessmen in you jumping path. Your task is to output the max

《c案例04动态规划》 来自淘豆网www.taodocs.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数57
  • 收藏数0 收藏
  • 顶次数0
  • 上传人相惜
  • 文件大小468 KB
  • 时间2022-07-31