码迷,mamicode.com
首页 >  
搜索关键字:sticks    ( 387个结果
hdu acm-step 1.3.6 Wooden Sticks
本题题意:有n根棍子,给出两个属性长度l和重量w,当加工当前棍子的长度和长度均大于上一根棍子时,可以不重置机器,每次重置机器要花1min, 求最小时间。 代码如下: 这道题就是两个循环,每处理完一根棍子后,要记录当前棍子的属性,然后跟下一根比较,仅当当前棍子的两个属性都大于上一根棍子时才进行比较,比 ...
分类:其他好文   时间:2017-08-19 13:05:12    阅读次数:171
POJ 1065 Wooden Sticks【贪心】
题意: 有一些木棍,每个有长度和重量,要求把这些木棍排成若干两个属性值均不下降的序列。问至少要分为多少个序列。且要保证排出来的子序列数最少。 思路: ( 9 , 4 ) ,( 2 , 5 ) ,( 1 , 2 ) ,( 5 , 3 ),( 4 , 1 )可以排成这样 ( 4 , 1 ) , ( 5 ... ...
分类:其他好文   时间:2017-08-16 00:46:44    阅读次数:118
HDU 5543 Pick The Sticks:01背包变种
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5543 题意: 给你N个金条和一张长度为L的桌子。每个金条长度为a[i],价值为w[i]。金条只能在桌子上横着摆一排,并且只要金条的重心(中心)在桌子上,就可以放。问你在桌子上能够摆的金条的最大总价值。 ...
分类:其他好文   时间:2017-08-15 10:05:40    阅读次数:164
POJ2676 Sticks
木棒 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 147267 Accepted: 34890 Description 乔 治拿来一组等长的木棒,将它们随机地砍断,使得每一节木棍的长度都不超过50个长度单位。然后他又想把这些木 ...
分类:其他好文   时间:2017-08-14 11:33:07    阅读次数:136
DFS——hdu1518Square
一、题目回顾 题目链接:Square Problem Description Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square? Input The fi ...
分类:其他好文   时间:2017-08-07 20:38:39    阅读次数:161
Cutting Sticks UVA - 10003
题解:dp[ i ][ j ]=min { dp[ i ][ k ]+dp[ k ][ j ] }+a[ j ]-a [i ]。 和石子归并是一样的问题,枚举区间的长度,然后更新这个区间的值。 ...
分类:其他好文   时间:2017-08-07 15:20:37    阅读次数:135
Wooden Sticks POJ - 1065
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 ...
分类:其他好文   时间:2017-08-05 00:24:56    阅读次数:227
UVA 10003 Cutting Sticks 区间DP
题目链接: https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=944 题目大意: 给你一个长度为L的木条, 和N个切割点, 每次切割的代价是当前切割木条的长度 ...
分类:其他好文   时间:2017-08-03 20:24:07    阅读次数:175
[POJ 2653]Pick-up sticks
Description Description Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan ...
分类:其他好文   时间:2017-08-03 11:21:16    阅读次数:176
HDU - 1518 :Square
Given a set of sticks of various lengths, is it possible to join them end-to-end to form a square? InputThe first line of input contains N, the number ...
分类:其他好文   时间:2017-07-28 20:50:54    阅读次数:148
387条   上一页 1 ... 8 9 10 11 12 ... 39 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!