动态规划
文章平均质量分 66
圆溜溜的奶黄包
这个作者很懒,什么都没留下…
展开
-
//01背包//内存很小但是有点慢的非常简洁版本------四E
Bessie has gone to the mall’s jewelry store and spies a charm bracelet. Of course, she’d like to fill it with the best charms possible from the N (1 ≤ N ≤ 3,402) available charms. Each charm i in the s原创 2018-02-10 14:04:28 · 171 阅读 · 0 评论 -
//完全背包//hdu2063//investment------四D
John never knew he had a grand-uncle, until he received the notary’s letter. He learned that his late grand-uncle had gathered a lot of money, somewhere in South-America, and that John was the only inh原创 2018-02-21 00:10:45 · 157 阅读 · 0 评论 -
//二刷//记忆化搜索//深搜dfs+动态规划dp//poj1088滑雪
Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 1 2 3 4 5 16 17 18 19 6 15 24 25 20 7 14 23 22 ...原创 2018-02-20 18:10:24 · 241 阅读 · 0 评论 -
//动态规划dp//钉子和小球------四C
有一个三角形木板,竖直立放,上面钉着n(n+1)/2颗钉子,还有(n+1)个格子(当n=5时如图1)。每颗钉子和周围的钉子的距离都等于d,每个格子的宽度也都等于d,且除了最左端和最右端的格子外每个格子都正对着最下面一排钉子的间隙。 让一个直径略小于d的小球中心正对着最上面的钉子在板上自由滚落,小球每碰到一个钉子都可能落向左边或右边(概率各1/2),且球的中心还会正对着下一颗将要碰上的钉子。例原创 2018-02-20 15:25:46 · 284 阅读 · 0 评论 -
//二刷//动态规划dp//数位dp//hdu2089//不要62
杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含有4或62的号码。例如: 62315 73418 88914 都属于不吉利号码。但是,61152虽然含有6和2,但不是6...原创 2018-02-20 12:13:57 · 162 阅读 · 0 评论 -
//水题五道//dp入门//手机短号//小兔的棋盘//数塔问题//核反应堆//简易版之最短距离
手机短号 大家都知道,手机号是一个11位长的数字串,同时,作为学生,还可以申请加入校园网,如果加入成功,你将另外拥有一个短号。假设所有的短号都是是 6+手机号的后5位,比如号码为13512345678的手机,对应的短号就是645678。 现在,如果给你一个11位长的手机号码,你能找出对应的短号吗? Input 输入数据的第一行是一个N(N <= 200),表示有N个数据,接下原创 2018-02-18 19:48:16 · 404 阅读 · 0 评论 -
//dp动态规划//好题//poj1745//Divisibility
Consider an arbitrary sequence of integers. One can place + or - operators between integers in the sequence, thus deriving different arithmetical expressions that evaluate to different values. Let us,原创 2018-02-27 17:50:00 · 343 阅读 · 0 评论 -
//动态规划//要处理好边界//LITTLE SHOP OF FLOWERS ------四B
题目链接: https://vjudge.net/contest/205708#problem/B 大致题意就是有f朵花,v个花瓶,不同的花放在不同的花瓶里会有不同的魅力值,每朵花选择的花瓶序号间的大小关系必须和花序号大小关系保持一致,在这个条件下,最大魅力值是多少。解题思路: dp[i][j]代表在用了i朵花j个花瓶的情况下的最大魅力值。一般情况下,dp[i][j]是max{dp[i][j-原创 2018-02-06 15:37:39 · 199 阅读 · 0 评论 -
//动态规划入门题嘻嘻嘻//数字三角形------四A
7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 (Figure 1) Figure 1 shows a number triangle. Write a program that calculates the highest sum of numbers passed on a route that starts原创 2018-02-06 13:44:08 · 168 阅读 · 0 评论 -
//dp动态规划入门题//最长公共子序列------四F
A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, …, xm > another sequence Z = < z1, z2, …, zk > is a subsequence of X原创 2018-02-10 15:53:07 · 207 阅读 · 0 评论 -
//贪心+dp//最长下降子序列//Monkey and Banana------四G
A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with some blocks. If the monke原创 2018-02-25 17:24:26 · 200 阅读 · 0 评论