码迷,mamicode.com
首页 >  
搜索关键字:pick-up sticks    ( 418个结果
HDU-1051-Wooden Sticks(C++ && 不水的贪心!)
Wooden Sticks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14161    Accepted Submission(s): 5860 Problem Description There is a ...
分类:编程语言   时间:2015-06-20 14:23:31    阅读次数:312
HDU 3573 Buy Sticks (逻辑)
题意:a,b,c三种棍子长度分别为20,28,32,现需要这三种棍子数根,欲买长为75的棍子来剪成这三种(不够长的就废弃) ,问需要买多少根。思路:将所有棍子尽可能和其他搭配起来,使得数量减到最少。分情况: 结果(按最坏情况考虑):2a+c=72 要么c=0,要么a=1或a=02a+b=68...
分类:其他好文   时间:2015-06-18 23:58:34    阅读次数:371
HDU Wooden Sticks (贪心)
Wooden Sticks Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 65536/32768K (Java/Other) Total Submission(s) : 19   Accepted Submission(s) : 7 Font: Times New Roman | Verdana | Georgia Fon...
分类:其他好文   时间:2015-06-15 09:24:34    阅读次数:142
LA3938:"Ray, Pass me the dishes!"(线段树)
Description After doing Ray a great favor to collect sticks for Ray, Poor Neal becomes very hungry. In return for Neal's help, Ray makes a great dinner for Neal. When it is time for dinner, Ray...
分类:其他好文   时间:2015-06-14 00:32:19    阅读次数:237
HDU 1051 Wooden Sticks (贪心)
Wooden Sticks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 14126    Accepted Submission(s): 5842 Problem Description There is a...
分类:其他好文   时间:2015-06-08 08:28:03    阅读次数:102
Codeforces Round #297 (Div. 2)C. Ilya and Sticks
题意:给你n 个木头的长度   ,  问你组成矩形的最大总面积为多少,  且木头长度L   可以当作L-1 来使用。 题解:很显然   组成矩形要保证总面积最大   只有大的和大的边组成才能保证面积最大,并且如果当前大的为偶数条那么不需要变成-1  否则变成减1   从头到尾扫一遍  没了 代码: #include #include #include using namespace st...
分类:其他好文   时间:2015-05-31 09:11:00    阅读次数:126
codeforces 525C Ilya and Sticks
#include #include #include #include #include #include #include #include using namespace std; int a[100005]; int main(){ int n; cin >> n; for(int i = 0;i < n;i++){ scanf("%d",&a[i])...
分类:其他好文   时间:2015-05-29 20:21:58    阅读次数:135
贪心 Codeforces Round #297 (Div. 2) C. Ilya and Sticks
题目传送门 1 /* 2 题意:给n个棍子,组成的矩形面积和最大,每根棍子可以-1 3 贪心:排序后,相邻的进行比较,若可以读入x[p++],然后两两相乘相加就可以了 4 */ 5 #include 6 #include 7 #include 8 #include 9 usi...
分类:其他好文   时间:2015-05-26 21:03:03    阅读次数:118
hdu 1455 hdu 1455 Sticks
思路还是很简单的,不过关键在于剪枝,用了几个不强力的剪枝,飘过~~~998ms #include #include #include #define maxn 65+5 using namespace std; int maxx,n,m,flag,l; int mapp[maxn]; int visit[maxn]; bool cmp(int x,int y) { return x>y;...
分类:其他好文   时间:2015-05-23 18:27:41    阅读次数:109
UVA10003---Cutting Sticks(简单区间dp)
任意两个切割点之间无法再分割 所以如果设dp[i][j] 表示从i位置切到j位置其实没有多大意义,亲测这样会TLE dp[i][j]表示切割第i个切割点开始的位置到第j个切割点的位置结束的木棍的最小花费 时间复杂度O(n3)O(n^3)/************************************************************************* >...
分类:其他好文   时间:2015-05-22 09:50:43    阅读次数:149
418条   上一页 1 ... 24 25 26 27 28 ... 42 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!