随笔分类 - UVA
摘要:Job order problem.greedy :Sort the people by their work time decreasingly. And that's the order.The total time is max {start_time[i] + work_time[i]}Demonstration:Assumes that x1x2x3...xixj...xn is the order.If we swap xi,xj, all of the other man's ending time is not changed. (start_time[i] +
阅读全文
摘要:There is no doubt that the strong knight should take care of the strong dragon.So we can sort the knights by their ability increasingly. As for dragon, ditto. From the first knight to the last one, if the knight can kill the current dragon (from the first to the last too), it does. Otherwise, let th
阅读全文
浙公网安备 33010602011771号