码迷,mamicode.com
首页 >  
搜索关键字:sticks    ( 387个结果
【POJ】2653 Pick-up sticks(计算几何+暴力)
http://poj.org/problem?id=2653我很好奇为什么这样$O(n^2)$的暴力能过....虽然说这是加了链表优化的,但是最坏不也是$O(n^2)$吗。。。(只能说数据太弱...)然后本题裸的判线段相交和点在直线上...(看了网上的标程,不判端点的情况都能过我也是醉了...)#i...
分类:其他好文   时间:2015-01-01 17:18:03    阅读次数:130
hdu 1518(dfs)
题目链接 :http://acm.hdu.edu.cn/showproblem.php?pid=1518SquareProblem DescriptionGiven a set of sticks of various lengths, is it possible to join them end...
分类:其他好文   时间:2014-12-19 15:44:33    阅读次数:185
EOJ1981 || POJ1011 经典dfs+剪枝+奇怪的数据
题目:EOJ1981 || POJ1011   经典dfs+剪枝+奇怪的数据   Description George took sticks of the same length and cut them randomly until all partsbecame at most 50 units long. Now he wants to return sticks to th...
分类:其他好文   时间:2014-12-18 20:44:15    阅读次数:242
贪心/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
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
387条   上一页 1 ... 27 28 29 30 31 ... 39 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!