
(^-^) -----动态规划 -----(^-^)
SY_Pistachio
低调的前行,越努力越幸运!
展开
-
动态规划 多重背包 Coins
People in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there were some coins.He decided to buy a very nice watch in...原创 2018-04-07 17:31:18 · 398 阅读 · 1 评论 -
动态规划--简单递推 poj 2084
数塔Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 54389 Accepted Submission(s): 31938Problem Description在讲述DP算法的时候,一个经典的例子就是数塔问题,它是这样描述的:有如下所...原创 2018-05-12 10:17:24 · 255 阅读 · 0 评论 -
动态规划--简单递推 poj 2084
母牛的故事Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 102018 Accepted Submission(s): 49927Problem Description有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每...原创 2018-05-12 10:28:52 · 204 阅读 · 0 评论 -
动态规划--简单递推 POJ 2044
一只小蜜蜂...Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 90664 Accepted Submission(s): 32204Problem Description有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编...原创 2018-05-12 11:12:16 · 321 阅读 · 0 评论 -
最长公共子序列
Common SubsequenceTime Limit: 1000MS Memory Limit: 10000K Total Submissions: 61444 Accepted: 25704 DescriptionA subsequence of a given sequence is the given sequence with some ...原创 2018-08-10 19:58:23 · 152 阅读 · 0 评论 -
2755:神奇的口袋(百炼,2755 动态规划)
2755:神奇的口袋查看 提交 统计 提示 提问总时间限制: 10000ms 内存限制: 65536kB描述有一个神奇的口袋,总的容积是40,用这个口袋可以变出一些物品,这些物品的总体积必须是40。John现在有n个想要得到的物品,每个物品的体积分别是a1,a2……an。John可以从这些物品中选择一些,如果选出的物体的总体积是40,那么利用这个神奇的口袋,J...原创 2018-08-12 10:19:59 · 295 阅读 · 0 评论 -
Charm Bracelet(poj 3464 0-1背包 动态规划)
Charm BraceletTime Limit: 1000MS Memory Limit: 65536K Total Submissions: 47080 Accepted: 20026 DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet...原创 2018-08-12 11:50:47 · 293 阅读 · 0 评论 -
圣诞老人的礼物-Santa Clau’s Gifts(贪心,结构体重构,sort)
圣诞老人的礼物-Santa Clau’s Gifts查看 提交 统计 提示 提问总时间限制: 1000ms 内存限制: 65536kB描述圣诞节来临了,在城市A中圣诞老人准备分发糖果,现在有多箱不同的糖果,每箱糖果有自己的价值和重量,每箱糖果都可以拆分成任意散装组合带走。圣诞老人的驯鹿最多只能承受一定重量的糖果,请问圣诞老人最多能带走多大价值的糖果。输入...原创 2018-08-08 11:11:38 · 700 阅读 · 0 评论 -
滑雪(百炼 1088 动态规划)
滑雪查看 提交 统计 提问总时间限制: 1000ms 内存限制: 65536kB描述Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长的滑坡。区域由一个二维数组给出。数组的每个数字代表点的高度。下面是一个例子 ...原创 2018-08-13 08:52:32 · 1978 阅读 · 2 评论 -
Stall Reservations(贪心 优先队列)
Stall Reservations Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 10792 Accepted: 3814 Special Judge Description Oh those pic...原创 2018-08-08 15:06:18 · 410 阅读 · 0 评论 -
Radar Installation(贪心)
Radar Installation查看 提交 统计 提问总时间限制: 1000ms 内存限制: 65536kB描述Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a ...原创 2018-08-08 16:58:34 · 333 阅读 · 0 评论 -
超级楼梯 递推
有一楼梯共M级,刚开始时你在第一级,若每次只能跨上一级或二级,要走上第M级,共有多少种走法? Input 输入数据首先包含一个整数N,表示测试实例的个数,然后是N行数据,每行包含一个整数M(1<=M<=40),表示楼梯的级数。 Output 对于每个测试实例,请输出不同走法的数量 Sa...原创 2018-04-25 19:13:20 · 385 阅读 · 0 评论 -
动态规划 Sumsets
Farmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an integer power of 2. Here are the possible sets of numbers...原创 2018-04-07 11:01:05 · 224 阅读 · 0 评论 -
ACM 动态规划 Robberies
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2955RobberiesTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 28543 Accepted Submission(s): 104...原创 2018-04-06 18:52:55 · 296 阅读 · 0 评论 -
ACM D - Ignatius and the Princess IV
"OK, you are not too bad, em... But you can never pass the next test." feng5166 says."I will tell you an odd number N, and then N integers. There will be a special integer among them, you have to ...原创 2018-04-08 16:09:33 · 329 阅读 · 1 评论 -
ACM 动态规划 完全背包 E - Monkey and Banana
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 m...原创 2018-04-08 21:52:21 · 228 阅读 · 0 评论 -
动态规划 背包问题描述 状态转化方程
1. 0-1背包:总来源(https://blog.youkuaiyun.com/slience_646898/article/details/78638125) (1)状态转化方程: f[i,j] = Max{ f[i-1,j-Wi]+Pi( j >= Wi ), f[i-1,j] } 2.多重背包:总来源(https://blog.youkuaiyun.com/acdreamers/a...原创 2018-04-08 22:04:12 · 342 阅读 · 0 评论 -
动态规划 Cow Bowling
The cows don't use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up in a standard bowling-pin-like triangle like this: ...原创 2018-04-09 19:32:35 · 260 阅读 · 0 评论 -
动态规划 数字三角形
数字三角形(POJ1163) 在上面的数字三角形中寻找一条从顶部到底边的路径,使得路径上所经过的数字之和最大。路径上的每一步都只能往左下或 右下走。只需要求出这个最大和即可,不必给出具体路径。 三角形的行数大于1小于等于100,数字为 0 - 99 输入格式:首先输入一个整数n表示读入数字三角的层数,然后输入n层数字三角形。 5 7 3 8 8 ...原创 2018-04-06 16:15:07 · 469 阅读 · 0 评论 -
动态规划 最长上升子序列
最长上升子序列Time Limit: 3000 ms Memory Limit: 65536 KiBSubmit Statistic DiscussProblem Description一个数的序列bi,当b1 < b2 < ... < bS的时候,我们称这个序列是上升的。对于给定的一个序列(a1, a2, ..., aN),我们可以得到一些上升的子序列(a...原创 2018-04-06 16:40:07 · 263 阅读 · 1 评论 -
动态规划 最长公共子序列问题
最长公共子序列详解思路总结:https://blog.youkuaiyun.com/hrn1216/article/details/51534607最长公共子序列问题Time Limit: 1000 ms Memory Limit: 65536 KiB Submit Statistic Discuss Problem Description 给定两个序列X=...原创 2018-04-06 17:21:09 · 239 阅读 · 0 评论 -
ACM-动态规划21-三角形最长路径问题
ACM-动态规划21-三角形最长路径问题这个就是基于 https://mp.youkuaiyun.com/postedit/79832350的一个变形,原理类似。 描述如下所示的由正整数数字构成的三角形: 7 3 8 8 1 0 2 7 4 4 4 5 2 6 5 从三角形的顶部到底部有很多条不同的路径。对于每条路径,把路径上面的数加起来可以得到一个和,和最大的路径称为最佳路径。你的任...原创 2018-04-06 17:41:27 · 536 阅读 · 0 评论 -
ACM 动态规划 大盗阿福
ACM-动态规划23-大盗阿福描述阿福是一名经验丰富的大盗。趁着月黑风高,阿福打算今晚洗劫一条街上的店铺。这条街上一共有 N 家店铺,每家店中都有一些现金。阿福事先调查得知,只有当他同时洗劫了两家相邻的店铺时,街上的报警系统才会启动,然后警察就会蜂拥而至。作为一向谨慎作案的大盗,阿福不愿意冒着被警察追捕的风险行窃。他想知道,在不惊动警察的情况下,他今晚最多可以得到多少现金?输入 输入的第一行是一个...原创 2018-04-06 18:06:38 · 280 阅读 · 0 评论 -
ACM 常见动态规划习题及解析
http://blog.sina.com.cn/s/articlelist_2101275125_3_1.html转载 2018-04-06 18:25:45 · 769 阅读 · 0 评论 -
概率DP——UVA12230 Crossing Rivers
UVA12230 Crossing Rivers1.题目大意: 有个人每天要去公司上班,每次会经过N条河,家和公司的距离为D,默认在陆地的速度为1, 给出N条河的信息,包括起始坐标p,宽度L,以及船的速度v。船会往返在河的两岸,人到达河岸时, 船的位置是随机的(往返中)。问说人达到公司所需要的期望时间。2.思路: 2.1,过每条河最坏的情况是t=3*L/v; 即去的时候船刚刚...原创 2018-11-01 19:27:08 · 290 阅读 · 0 评论