摘要: Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's Hal 阅读全文
posted @ 2017-05-28 23:28 天之道,利而不害 阅读(365) 评论(0) 推荐(0) 编辑
摘要: If he would take the cards in the opposite order, i.e. 50, then 20, then 1, the score would be Input The first line of the input contains the number o 阅读全文
posted @ 2017-05-28 00:46 天之道,利而不害 阅读(270) 评论(0) 推荐(0) 编辑
摘要: N堆石子摆成一条线。现要将石子有次序地合并成一堆。规定每次只能选相邻的2堆石子合并成新的一堆,并将新的一堆石子数记为该次合并的代价。计算将N堆石子合并成一堆的最小代价。 例如: 1 2 3 4,有不少合并方法 1 2 3 4 => 3 3 4(3) => 6 4(9) => 10(19) 1 2 3 阅读全文
posted @ 2017-05-28 00:38 天之道,利而不害 阅读(173) 评论(0) 推荐(0) 编辑