您当前的位置: 首页 > 

钟钟终

暂无认证

  • 0浏览

    0关注

    233博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

第二周--贪心题解(H)

钟钟终 发布时间:2021-03-17 15:40:12 ,浏览量:0

题H: 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 a stick. The setup times are associated with cleaning operations and changing tools and shapes in the machine. The setup times of the woodworking machine are given as follows:

(a) The setup time for the first wooden stick is 1 minute. (b) Right after processing a stick of length l and weight w , the machine will need no setup time for a stick of length l’ and weight w’ if l>a[i].y; a[i].f=0; } sort(a,a+n,cmp); int time=0; for(int i=0;i=a[k].y) { a[j].f=1; k=j; } } } cout

关注
打赏
1664378814
查看更多评论
立即登录/注册

微信扫码登录

0.0383s