DP
文章平均质量分 81
正义的地球人
这个作者很懒,什么都没留下…
展开
-
HDU 3182 Hamburger Magi(状压DP)
In the mysterious forest, there is a group of Magi. Most of them like to eat human beings, so they are called “The Ogre Magi”, but there is an special one whose favorite food is hamburger, having been原创 2016-08-31 12:10:15 · 287 阅读 · 0 评论 -
POJ 2677 双调欧几里得旅行商问题
John Doe, a skilled pilot, enjoys traveling. While on vacation, he rents a small plane and starts visiting beautiful places. To save money, John must determine the shortest closed tour that connects h原创 2016-07-20 14:57:55 · 742 阅读 · 0 评论 -
hdu 5067 Harry And Dig Machine (状态压缩dp)
Description As we all know, Harry Porter learns magic at Hogwarts School. However, learning magical knowledge alone is insufficient to become a great magician. Sometimes, Harry also has to gain k原创 2016-07-20 15:13:44 · 243 阅读 · 0 评论 -
POJ 2923 Relocation (状态压缩+背包)
DescriptionEmma and Eric are moving to their new house they bought after returning from their honeymoon. Fortunately, they have a few friends helping them relocate. To move the furniture, they o原创 2016-07-20 16:32:00 · 294 阅读 · 0 评论 -
HDU 2059 动态规划
题意:额,中文题不翻译。解题思路:看别人的博客才理解的,由于每个加油站都可以选择加油和不加油,为了把所有情况考虑进去,不妨令dp[i]为从起点到第i个加油站所需要的最短时间,那么dp[i]就应该是从0到i-1这些节点充满电然后直接跑到i的最短时间。为什么这样做不会丢失最优解?不妨考虑第4个节点,计算过程中你求出了dp[2]+t2和dp[3]+t3,这就等于说你已经考虑了第3个节点充电或原创 2016-07-25 09:19:25 · 292 阅读 · 0 评论 -
HDU 1421 搬寝室 动态规划
Description胡老师马上要搬新家了,可是搬家真的是一个很累的活,看着家里的n件物品, 胡老师已经凌乱了,因为物品实在太多。于是胡老师想了又想,决定先随便搬2* p件过去就行了。现在,胡老师发现每搬一次的疲劳度是和左右手的物品的重量差的平方成正比,( 每次左手一件右手一件) ,如果胡老师左手拿重量为3的物品, 右手拿重量为6的物品, 则他搬完这次的疲劳度为(6-3)^2 = 9.原创 2016-07-25 16:34:11 · 1332 阅读 · 1 评论