上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 40 下一页
摘要: 题意:输入一个由小写字母组成的字符串,你的任务是把它划分成尽量少的回文串。 题解:d(i)为字符0~i划分成的最小回文串的个数,则d[ i ]=min{ d[ j ]+1 |s[ j+1~ i ]是回文串 }。 注意要预处理,其次是怎么初始化。。。很重要 阅读全文
posted @ 2017-08-07 12:00 天之道,利而不害 阅读(292) 评论(0) 推荐(0) 编辑
摘要: 题意:某城市的地铁是线性的,有n(2<=n<=50)个车站,从左到右的编号为1~n。有M1辆车从第1站出发往右开,还有M2辆车从第n站开始往左开。 在时刻0,Mario从第1站出发,目的是在时刻T(0<=T<=200)会见车站n的一个间谍。在车站等车时容易被抓,所以她决定躲在开动的火车上,让在 车站 阅读全文
posted @ 2017-08-07 11:52 天之道,利而不害 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 题意:有n首歌,剩余T秒时间,问在结束之前,使得唱的歌的数目尽量多,在此前提下尽量晚的离开KTV。跟多的细节请读Input 题解:如果不考虑数目,则是一道裸的01背包,而现在是数目多的优先,其次再是时间长的优先。所以适合用一个结构体,注意优先级!!! 然后按照01背包的思想做就是了。。。更新值的时候 阅读全文
posted @ 2017-08-05 15:05 天之道,利而不害 阅读(346) 评论(0) 推荐(0) 编辑
摘要: Bessie was poking around the ant hill one day watching the ants march to and fro while gathering food. She realized that many of the ants were sibling 阅读全文
posted @ 2017-08-04 23:27 天之道,利而不害 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2017-08-04 22:47 天之道,利而不害 阅读(256) 评论(0) 推荐(0) 编辑
摘要: People in Silverland use coins.They have coins of value A1,A2,A3...An Silverland dollar.One day Tony opened his money-box and found there were some co 阅读全文
posted @ 2017-08-04 22:33 天之道,利而不害 阅读(258) 评论(0) 推荐(0) 编辑
摘要: Bessie is such a hard-working cow. In fact, she is so focused on maximizing her productivity that she decides to schedule her next N (1 ≤ N ≤ 1,000,00 阅读全文
posted @ 2017-08-04 22:19 天之道,利而不害 阅读(200) 评论(0) 推荐(0) 编辑
摘要: It is a little known fact that cows love apples. Farmer John has two apple trees (which are conveniently numbered 1 and 2) in his field, each full of 阅读全文
posted @ 2017-08-04 22:09 天之道,利而不害 阅读(313) 评论(0) 推荐(0) 编辑
摘要: The cows don't use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up in a standard bowling- 阅读全文
posted @ 2017-08-04 21:58 天之道,利而不害 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Jessica's a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she 阅读全文
posted @ 2017-08-03 21:59 天之道,利而不害 阅读(173) 评论(0) 推荐(0) 编辑
上一页 1 ··· 28 29 30 31 32 33 34 35 36 ··· 40 下一页