码迷,mamicode.com
首页 >  
搜索关键字:pick-up sticks    ( 418个结果
贪心/hdu 1051 Wooden Sticks
#include#include#includeusing namespace std;struct node{ int l,w; bool v;};int n;node a[5010];bool cmp(node x,node y){ if (x.l==y.l) return x...
分类:其他好文   时间:2014-12-11 23:43:26    阅读次数:246
hdu 1455 sticks
经典剪枝题目,注释的别人代码。还是得自己多敲。反思,反思! 1 #include "iostream" 2 #include "algorithm" 3 #include "memory.h" 4 using namespace std; 5 6 int sticks[64],n,len,num;....
分类:其他好文   时间:2014-12-09 01:49:04    阅读次数:131
Uva 10003-Cutting Sticks(区间DP)
题目链接:点击打开链接 题意: 一根长度为L 的木棒,要求要切割n次,给出n次需要切割的位置,每次切割花费为当前段的总长度。求最小花费。 思路:。。一开始想了好久也没往区间DP那方面想QAQ。设 dp[i][j] 为切割[i,j] 区间的最小花费,状态转移方程为 dp[i][j]=max(dp[i][k-1]+dp[k+1][j]+a[j+1]-a[i-1]); #include #inc...
分类:其他好文   时间:2014-12-04 01:10:36    阅读次数:170
POJ1011 Sticks 【剪枝】
Sticks Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 122771   Accepted: 28441 Description George took sticks of the same length and cut them randomly unt...
分类:其他好文   时间:2014-12-02 00:11:43    阅读次数:172
nyoj-248-buying feed
http://acm.nyist.net/JudgeOnline/problem.php?pid=248BUYING FEED时间限制:3000ms | 内存限制:65535KB难度:4描述FarmerJohnneeds to travel to town to pick up K (1 2#inc...
分类:其他好文   时间:2014-11-24 20:50:04    阅读次数:228
poj 2362
G -SquareTime Limit:3000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 2362DescriptionGiven a set of sticks of various len...
分类:其他好文   时间:2014-11-21 15:55:58    阅读次数:260
POJ 2653 Pick-up sticks --队列,几何
题意: 按顺序扔木棒,求出最上层的木棒是哪些。解法: 由于最上层的木棒不超过1000个,所以用一个队列存储最上层的木棒,每次扔出一个木棒后,都与队列中的木棒一一判断,看此木棒是否在某一最上层的木棒的上面,即判线段是否相交(两次跨立实验),如果相交,则将那个被压的木棒抛出队列,最后再加入扔的这个木棒到...
分类:其他好文   时间:2014-11-19 12:29:27    阅读次数:167
poj 1011
SticksTime Limit:1000MSMemory Limit:10000KTotal Submissions:122529Accepted:28391DescriptionGeorge took sticks of the same length and cut them randomly...
分类:其他好文   时间:2014-11-16 10:34:55    阅读次数:128
POJ 1011 Sticks
题目来源:http://poj.org/problem?id=1011 Sticks Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 122460   Accepted: 28373 Description George took sticks...
分类:其他好文   时间:2014-11-11 19:18:12    阅读次数:181
区间dp
区间DP 区间DP 注意点例题: 1.最优矩阵链乘2.UVA 10003 Cutting Sticks 注意点 区间dp与一般的dp有所区别,若使用递推的方法,需要注意根据dp[i][j]  中j-i递增的顺序来递推。 例题: 1.最优矩阵链乘 #include #include ...
分类:其他好文   时间:2014-11-10 13:50:58    阅读次数:172
418条   上一页 1 ... 30 31 32 33 34 ... 42 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!