Wooden Sticks Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8899    Accepted Submission(s): 3630 [解题思路]初学贪心仅知道一些理论的知识,这题说是贪心自己也没啥感觉,做题的思路是在抛开贪心的概念然后按照自己的想法实现出来,实现之后想在思路中找到贪心的影子,只能看到每次都是找尽可能多的s…
参考链接:http://blog.csdn.net/xiaohuan1991/article/details/6956629 (HDU 1257 解题思路一样就不继续讲解) POJ 1065题意:给你n个木块,分别给出其长度和重量,然后要对这些木块进行加工,如果木块1的长度和重量都不大于木块2, 那么这两个木块可以放在一起加工,从而只用花费1个时间单位.问要如何进行加工从而能够花费最少时间单位. 知识点: 偏序集:若一个集合A为偏序集,那么满足:1.任意一个元素X属于集合,那么这个元素X≤X 2…
Wooden Sticks Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 16262 Accepted: 6748 Description There is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking ma…
There is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs some time, called setup time, for the machine to prepare processing…
嘤嘤嘤,实习半年多的小蒟蒻的第一篇博客(题解) 英文的: There is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs some time, called setup time, for the m…
http://poj.org/problem?id=1065 题意比较简单,有n跟木棍,事先知道每根木棍的长度和宽度,这些木棍需要送去加工,第一根木棍需要一分钟的生产时间,如果当前木棍的长度跟宽度 都大于前一根木棍,那么这根木棍不需要生产时间,问你最少的生产时间是多少? 首先可以贪心,先按长度 l排序,如果l相同,按宽度w排序. 从i=0开始,每次把接下来的i+1  -  n-1 的没有标记并且长度和宽度大于等于i这根木棍的长度和宽度标记起来. #include<cstdio> #includ…
题目地址:http://poj.org/problem?id=1065 Sample Input 3 5 4 9 5 2 2 1 3 5 1 4 3 2 2 1 1 2 2 3 1 3 2 2 3 1 Sample Output 2 1 3 题目抽象:给你一个序列,序列的每个元素包含两个值(x,y).现在希望找到最少数目的条件序列.条件序列是这样的:cur.x<=(cur+1).x && cur.y<=(cur+1).y满足条件的序列的最少的数目是多少?代码: #include…
POJ :http://poj.org/problem?id=1065 ZOJ: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=25 看大神的代码的研究的... 心情不好该学习还是要学习的....QAQ 其实题目的意思就是把所有元素分为最少的堆数,每堆有l<=l' and w<=w' 按l排序后(l相等则按w),问题转化为把所有元素分为最少的堆数,每堆有w<=w'(l<=l' 显然成立) 即已知一个数列,要求最…
题意: 有一些木棍,每个有长度和重量,要求把这些木棍排成若干两个属性值均不下降的序列.问至少要分为多少个序列.且要保证排出来的子序列数最少. 思路: ( 9 , 4 ) ,( 2 , 5 ) ,( 1 , 2 ) ,( 5 , 3 ),( 4 , 1 )可以排成这样 ( 4 , 1 ) , ( 5 , 3 ) , ( 9 , 4 );   ( 1 , 2 ) , ( 2 , 5 ) . 其中:(4,1)<=(5,3)<=(9,4)为不降序列,(4,1)<(5,3)由于4<5&…
排序后贪心或根据第二关键字找最长下降子序列 #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cstdlib> #include<algorithm> #include<iostream> #include<sstream> #include<cmath>…