摘要: 就是找出最长的一个回文串 。。 一开始用了个朴素的dp。。结果应该是内存爆了开不了那么大数组。 然后就暴力枚举了回文的中间数字。过了。。感觉还是太低效题目: Calf Flac It is said that if you give an infinite number of cows an infinitenumber of heavy-duty laptops (with very large keys), that they willultimately produce all the world's great palindromes. Your job will beto d 阅读全文
posted @ 2014-01-31 20:50 doubleshik 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 题目大意就是用最多M 块木板去修天花板, 要求最后用掉的木板长度最小。这道题最好的是用贪心解。 做的时候我用了dp想法比较简单, 参考nocow 贪心的想法比较巧妙感觉题目:Barn RepairIt was a dark and stormy night that ripped the roof and gates off the stalls that hold Farmer John's cows. Happily, many of the cows were on vacation, so the barn was not completely full.The cows sp 阅读全文
posted @ 2014-01-31 19:24 doubleshik 阅读(294) 评论(0) 推荐(0) 编辑