上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 52 下一页
摘要: 还没有学过RMQ,所以只能用会的单调队列做。Bob’s RaceTime Limit: 5000/2000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1358Accepted Submission(s): 441Problem DescriptionBob wants to hold a race to encourage people to do sports. He has got trouble in choosing the route. There are N house 阅读全文
posted @ 2013-07-12 10:55 chenhuan001 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 处理题目中给的日期,然后用单调队列维护Alice's mooncake shopTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1925Accepted Submission(s): 468Problem DescriptionThe Mid-Autumn Festival, also known as the Moon Festival or Zhongqiu Festival is a popular harvest festiva 阅读全文
posted @ 2013-07-11 23:39 chenhuan001 阅读(391) 评论(0) 推荐(0) 编辑
摘要: 一个模式的dp。PearlsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1096Accepted Submission(s): 476Problem DescriptionIn Pearlania everybody is fond of pearls. One company, called The Royal Pearl, produces a lot of jewelry with pearls in it. The Royal Pe 阅读全文
posted @ 2013-07-11 09:08 chenhuan001 阅读(170) 评论(0) 推荐(0) 编辑
摘要: 简单dpMax Sum Plus Plus PlusTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 949Accepted Submission(s): 470Problem Description给定一个由n个正整数组成的整数序列a1 a2 a3 ... an求按先后次序在其中取m段长度分别为l1、l2、l3...lm的不交叠的连续整数的和的最大值。Input第一行是一个整数n(0 ≤ n ≤ 1000),n = 0表示输入结束第二行的第一个 阅读全文
posted @ 2013-07-10 20:11 chenhuan001 阅读(204) 评论(0) 推荐(0) 编辑
摘要: 我用的dp是n^3的, dp[i][j] 表示在s串的i个前和t串的j个前,s[i],t[j]为最末端的两个串得到的最大值。状态转移方程为:之前将s和t串最尾端添加'-' for(int i=1;i=0;k--) { dp[i][j]=max(dp[i][j],dp[i-1][k]+tmp); tmp += fuc('-',t[k]); } tmp=0; for(int k=i-1;k>=0;k... 阅读全文
posted @ 2013-07-04 21:02 chenhuan001 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 使用一种二进制的优化, 可以完美的解决这题,《背包九讲》中说的非常好但是还有一种线性复杂的算法。 应该算是该题很巧妙的解法for(i=1;i=0;l--) { if(dp[l]==0) continue; for(k=1;k#include #include #include #include #include #include #include #include using namespace std;#define INF 0x3fffffffstruct node{ int w,c;... 阅读全文
posted @ 2013-07-02 13:46 chenhuan001 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 一道贪心题。可以分两种情况1 、是没有把对面的牌全打败,那么只要用最大的可能去打攻击状态的牌。2、 是将对面的牌全打败,那么只要保证打对面防守状态的花费最小,就可以保证最后的结果最大两种情况下的最大值就我们要的答案.D. Ciel and Dueltime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel is playing a card game with her friend Jiro.Jiro hasncards, each 阅读全文
posted @ 2013-06-30 17:28 chenhuan001 阅读(339) 评论(0) 推荐(0) 编辑
摘要: 可以发现天的操作相当于*(k1+k2)然后就很好判断了。威威猫系列故事——吃鸡腿Time Limit: 3000/1000 MS (Java/Others)Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2232Accepted Submission(s): 421Problem Description 威威猫不是一只普通的猫,普通的猫喜欢吃鱼,但威威猫最喜欢吃鸡腿。他每天都在不停的吃啊吃,吃了一只又一只鸡腿。现在他遇到了一个难题,如果他的体重太胖那么他的主人就不给他吃鸡腿了,所以他需要你的帮助。 威威猫的身体由n.. 阅读全文
posted @ 2013-06-28 23:25 chenhuan001 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 太弱了,写了一下午,高中基础太差的孩子伤不起。。。记住抛物线是关于x轴对称的。而且抛物线的方程可以是: y=k(x-h)+c //其中(h,c)为顶点坐标The areaTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6080Accepted Submission(s): 4247Problem DescriptionIgnatius bought a land last week, but he didn't know the are 阅读全文
posted @ 2013-06-28 17:16 chenhuan001 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 纠结的一道dp。状态转移方程还是比较好想的,优化比较纠结 D. Ilya and Roadstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEverything is great about Ilya's city, except the roads. The thing is, the only ZooVille road is represented asnholes in a row.... 阅读全文
posted @ 2013-06-28 09:02 chenhuan001 阅读(266) 评论(0) 推荐(0) 编辑
上一页 1 ··· 36 37 38 39 40 41 42 43 44 ··· 52 下一页