博客园  :: 首页  :: 联系 :: 管理

2012年12月23日

摘要: (Shoemaker's Problem)A shoemaker hasNorders from customers which he must satisfy. The shoemaker can work on only one job in each day, and jobs usually take several days. For theith job, the integerTi(1Ti1, 000) denotes the number of days it takes the shoemaker to finish the job.But popularity ha 阅读全文

posted @ 2012-12-23 19:49 Apprentice89 阅读(271) 评论(0) 推荐(0)

摘要: Stacks of Flapjacks原文链接 http://blog.csdn.net/yzfuture2010/article/details/8091337有一堆煎饼,直径各异,摞成一堆。可用一把铲子插入任意两张饼之间,完成一次对铲子之上所有饼的翻转操作。假设最底部的饼的位置为1,最顶层的饼的位置为n。对第i (1≤i≤n) 张饼及其上的所有饼的一次翻转操作可以记为flip(i)。最左边一列经过flip(3)变为中间一列,而中间一列经过flip(1)变为最右边一列。求算法,使得能对任意给出的一堆饼经过如上操作变为有序堆。堆中最小直径的饼在最顶层,最大直径的饼在最底层。算法很简单,在n个. 阅读全文

posted @ 2012-12-23 11:53 Apprentice89 阅读(903) 评论(0) 推荐(0)