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…
Wooden Sticks 题意:有一台机器处理木材,最开始需要一分钟准备,如果后面处理的木材比前面处理的木材更长更重,则不需要准备时间,否则需要分钟准备时间. 思路:按长度排序然后求重量的一个最长单减子序列就好了. struct node { int x,y; }a[N]; int b[N]; int cmp(node a,node b) { if(a.x!=b.x) return a.x<b…