![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
动态规划
Sixoloy_
做一个善良博爱的人
展开
-
sicily 1240. Faulty Odometer
1240. Faulty OdometerConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionYou are given a car odometer which displays the miles traveled as an integer. The odometer has a def原创 2015-05-22 14:21:10 · 510 阅读 · 0 评论 -
sicily 1091. Maximum Sum
1091. Maximum SumConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionGiven a set of n integers: A={a1, a2,..., an}, we define a function d(A) as below:原创 2015-11-08 18:24:38 · 366 阅读 · 0 评论 -
sicily 1019. Apple Tree
1019. Apple TreeConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionWshxzt is a lovely girl. She likes apple very much. One day HX takes her to an apple tree. There are N no原创 2015-11-07 15:08:35 · 695 阅读 · 0 评论 -
sicily 1419. On the run(牛奶快递)
1419. On the run(牛奶快递)ConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescription Crystal发现他做程序员的薪水已经很难支撑整个家庭的开销了。为了增加收入,Crystal决定每天早上6点起床给和他同一座楼的住户送牛奶。 Crystal住的楼房设计奇特,每一层楼只有一原创 2015-10-04 17:59:49 · 655 阅读 · 0 评论 -
sicily 1564. HOUSING
1404. Hie with the PieConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionThe Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfort原创 2015-09-06 00:40:37 · 294 阅读 · 0 评论 -
code[VS] 1297 硬币
题目描述 Description我们知道即使是同一种面值的硬币,它们的重量也有可能不一样,因为它受到许多因素的影响,包括制造工艺和流程上的。但是任何一种面值的硬币的重量总是处于某个特定范围之内。现在已知所有面值的硬币的重量范围。给定一堆硬币的总重量,问这堆硬币的总价值有多少种不同的可能。举例:已知一角硬币的重量在19到21之间,五角硬币的重量在40到43之间。有一堆硬币的总重量为99。则它原创 2015-07-23 00:54:23 · 1040 阅读 · 0 评论 -
code[VS]1025 选菜
题目描述 Description 在小松宿舍楼下的不远处,有PK大学最不错的一个食堂——The Farmer’s Canteen(NM食堂)。由于该食堂的菜都很不错,价格也公道,所以很多人都喜欢来这边吃饭。The Farmer’s Canteen的点菜方式如同在超市自选商品一样,人们从一个指定的路口进去,再从一个指定的路口出来并付款。由于来这里就餐的人数比较多,所以人们自觉地在原创 2015-07-21 22:01:24 · 856 阅读 · 0 评论 -
code[VS] 1048 石子归并
题目描述 Description有n堆石子排成一列,每堆石子有一个重量w[i], 每次合并可以合并相邻的两堆石子,一次合并的代价为两堆石子的重量和w[i]+w[i+1]。问安排怎样的合并顺序,能够使得总合并代价达到最小。输入描述 Input Description第一行一个整数n(n第二行n个整数w1,w2...wn (wi 输出描述原创 2015-07-26 20:42:52 · 816 阅读 · 0 评论 -
Sicily 1828. Minimal
这道题我自己把DP方程写出来了,dp[i][j]代表s1下标到i,s2下标到j时,数对差之和的最小值(i#include "bits/stdc++.h"using namespace std;int s1[503];int s2[503];int dp[503][503];int main(){ ios::sync_with_stdio(false); int t; c原创 2015-04-29 00:57:03 · 375 阅读 · 0 评论 -
1148. 过河
一直不知道怎样状态压缩,看到网上代码把两个石头的最大距离改成了90,我想知道s和t分别为7和8的时候,90也适用么,应该跟最小公倍数有关吧。。。 太水了,求大神解答!#include "bits/stdc++.h"using namespace std;int stone_pos[102];int stone_is[10000];int dp[10000]; int main(){原创 2015-04-25 21:29:44 · 727 阅读 · 0 评论 -
sicily 1011. Lenny's Lucky Lotto
1011. Lenny's Lucky LottoConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionLenny likes to play the game of lotto. In the lotto game, he picks a list of N unique numbers in the range from 1原创 2015-05-14 13:12:37 · 384 阅读 · 0 评论 -
sicily 1077.Cash Machine
1077. Cash MachineConstraintsTime Limit: 10 secs, Memory Limit: 32 MBDescriptionA Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate原创 2015-05-15 16:35:37 · 405 阅读 · 0 评论 -
sicily 1211. 商人的宣传
1211. 商人的宣传ConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescription Bruce是K国的商人,他在A州成立了自己的公司,这次他的公司生产出了一批性能很好的产品,准备宣传活动开始后的第L天到达B州进行新品拍卖,期间Bruce打算将产品拿到各个州去做推销宣传,以增加其影响力。原创 2015-05-25 11:58:34 · 429 阅读 · 0 评论 -
sicily 1011. Lenny's Lucky Lotto
1011. Lenny's Lucky LottoConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionLenny likes to play the game of lotto. In the lotto game, he picks a list of N unique numbers in the range from 1原创 2015-05-14 02:38:24 · 386 阅读 · 0 评论 -
最大子序列和
今天又回顾了一下最大子序列和,没有参考以前的资料,自己想还是想了挺久的,还好后来还是想出来了,就是将几个子序列和大于0的序列做个比较,找出和最大那个嘛。期间交的时候还WRONG了几次。实际上是一个小细节搞错了,当以前一个数作为结尾的子序列和如果小于0,那么新的子序列从当前元素开始,而我设置成了0。还有就是不一定和比0大时,才跟最大子序列和做比较,这点卡的比较蛋疼,一般很难想到。#inc原创 2015-10-29 22:02:02 · 341 阅读 · 0 评论