上一页 1 2 3 4 5 6 ··· 11 下一页
摘要: 题目比较长 , 就是给出 一些点的连线, 要求留下最多的线让他们不相交数据量比较大, 用二分的LIS题目:Bridging signalsTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 9862Accepted: 5397Description'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed 阅读全文
posted @ 2014-02-06 17:59 doubleshik 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 题目的意思是给出一个序列,要求变成单调不上升或者单调不下降。 代价是 |A-B| 的总和网上都是说离散化。。虽然还是不太明白但是这道题终于有点感觉了首先可以看出变化后的序列中所有的数一定还在原数列中, 那么先对原数列排序a b1 3 2 4 5 3 9 -> 1 2 3 3 4 5 9然后dp[i][j] 表示第i个数, 把他变成 b[j] 所要画的最小代价dp[i][j] = dp[i-1] [ 0~j] + abs(b[j] - a[i]) 以此循环。虽然这道懂了但是感觉这个思路还是有点别扭。。智商拙计。。题目:Making the GradeTime Limit: 1000MSMe 阅读全文
posted @ 2014-02-06 17:37 doubleshik 阅读(514) 评论(0) 推荐(0) 编辑
摘要: 问题给出n个木头, 每个木有有li , wi的属性, 如果后一根木头的li>=li-1 且wi>=w-1 那么不需要等加工时间, 否则加1.第一根木头总要1个时间的加工时间,问最少需要多少时间首先根据木头的某一个属性排序, 然后求 最长下降子序列( 等于求出最长不下降的 个数) 题目:Wooden SticksTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 17044Accepted: 7121DescriptionThere is a pile of n wooden sticks. The length and 阅读全文
posted @ 2014-02-05 22:52 doubleshik 阅读(182) 评论(0) 推荐(0) 编辑
摘要: 奶牛们上天了。。 有n种材料,每种材料高hi , 限制最大放置高度ai , 有ci块, 问能搭多高首先对每种材料按照ai排序, 然后从小到大, dp[i][j] 表示前i中材料在j的高度下,第i种能剩多少,最后只要从amax往下判断第一个>=0的就可以了题目:Space ElevatorTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 7638Accepted: 3606DescriptionThe cows are going to space! They plan to achieve orbit by building 阅读全文
posted @ 2014-02-05 20:46 doubleshik 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 与昨天一道类似的多重集组合数问题每个家族有n个蚂蚁,一共T个家族, 问从S到B能有多少组合可能题目:G - Ant Counting Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit StatusAppoint description:DescriptionBessie was poking around the ant hill one day watching the ants march to and fro while gathering food. She realized 阅读全文
posted @ 2014-02-05 19:25 doubleshik 阅读(638) 评论(0) 推荐(0) 编辑
摘要: 一个背包问题给出n只奶牛的IQ ,EQ 要求在IQ EQ 都不小于0 的情况下总和最大dp[i][q] 表示前i只奶牛智商总和为q的最大情商。对每一只奶牛枚举一下智商的范围, 从-1000*100 ~ 1000*100 用数组平移一下 就是0 ~2*1000*100初始化dp[0]= 0 表示在不装任何奶牛的情况下智商和0,情商和0要求每次必须正好装满智商题目:Cow ExhibitionTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 8292Accepted: 3059Description"Fat and doci 阅读全文
posted @ 2014-02-05 17:17 doubleshik 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 一道比较水的题目。 原型是多重集组合数的问题。。大意就是n种物品,每种ai个, 问从中取出m个有多少种取法dp[i+1][j] 是前i中物品取出j个的取法dp[i+1][j] = dp[i][j] + dp[i+1][j-1] - dp[i][j-a[i]-1]] 后面的减号是因为在取j-1个的时候可能已经用掉了ai个。。这时候要去掉这种情况才能继续添加ai注意用longlong 和避免 负数。题目:P1792摆花Wrong Answer标签:NOIP普及组2012[显示标签]背景NOIP2012描述小明的花店新开张,为了吸引顾客,他想在花店的门口摆上一排花,共m盆。通过调查顾 客的喜好,小明 阅读全文
posted @ 2014-02-04 23:49 doubleshik 阅读(384) 评论(0) 推荐(0) 编辑
摘要: dp[i][j] 表示 用 前i种前能 凑成j 元的方法数。dp[i][j] = dp[i-1][j] + dp[i][j- (i+1)] 因为我i是从0开始的。。 所以i+1 表示第i中的值最后要用一下高精度题目:H - Dollar Dayz Time Limit:1000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u Submit StatusAppoint description:DescriptionFarmer John goes to Dollar Days at The Cow Store and discov 阅读全文
posted @ 2014-02-04 21:37 doubleshik 阅读(197) 评论(0) 推荐(0) 编辑
摘要: 题目大意是给出一些面值的硬币和数量。问在1-m中能凑出多少种钱。设 dp[i+1][j] 为前i种凑成j元第i种最多剩下多少。1. dp[i+1][j] = mi ( dp[i][j]>=0) 前i-1种已经能凑成j了2.dp[i+1][j] = -1 ( j 2 #include 3 #include 4 using namespace std; 5 6 int n,m; 7 int A[200]; 8 int C[200]; 9 int dp[100000+10];10 int main()11 {12 while(scanf("%d%d",&n,& 阅读全文
posted @ 2014-02-04 17:35 doubleshik 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 题意是有n个箱子, 每个箱子上最多承放Xi个箱子。 问最少搭成多少堆。这道题显然是贪心。。但是比赛的时候脑残了。。做了一个多小时的二分, 都不知道为什么100 的数据量自己要去做二分。。。早上起来发现二分错在判断条件少加了个1.。orz。。。贪心策略就是从小到大排序,然后把每个箱子放在他能放的最大堆下。。。题目:C. Fox and Box Accumulationtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputFox Ciel has n. 阅读全文
posted @ 2014-02-04 12:32 doubleshik 阅读(361) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 11 下一页