A bottom-up DP. To be honest, it is not easy to relate DP to this problem. Maybe, all "most"\"least" problems can be solved using DP..Reference:http:/...
分类:
Web程序 时间:
2014-06-25 18:39:32
阅读次数:
235
题目:Tuhao and his two small partners participated in the tournament.But in the end, they lost the chance to finish a mathematical problem.After the com...
分类:
其他好文 时间:
2014-06-25 18:07:35
阅读次数:
333
The2-3 treeis also a search tree like thebinary search tree, but this tree tries to solve the problem of theunbalanced tree.Imagine that you have a bi...
分类:
其他好文 时间:
2014-06-25 17:28:52
阅读次数:
202
拆点二分图匹配
棋盘游戏
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 2146 Accepted Submission(s): 1250
Problem Description
小希和Gardo...
分类:
其他好文 时间:
2014-06-25 08:48:14
阅读次数:
248
点击打开链接
Xor Sum
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 132768/132768 K (Java/Others)
Total Submission(s): 291 Accepted Submission(s): 151
Problem Description
Zeus 和...
分类:
其他好文 时间:
2014-06-24 23:43:48
阅读次数:
343
题目链接:http://poj.org/problem?id=2155
题目大意:给出一个N*N的0矩阵,下面给出两种指令:1. 给出的第一个数据为‘C’,再给出四个整形数据,x1,y1,y1,y2,对以(x1,y1)(x2,y2)分别为左上角和右下角坐标的矩阵内的元素进行反转(0变1,1变0) 2. 给出的第一个数据为‘Q’,再给出两个数据,x,y,然后输出此时这个坐标上的元素...
分类:
其他好文 时间:
2014-06-24 22:29:35
阅读次数:
271
S王国有N个城市,有N-1条道路。王都为编号1的城市。叛军驻扎在许多城市。除了王都外有K个城市有军队,这K支军队要向王都进军,并且消灭沿途经过的城市中的叛军。每支军队只能沿着道路走,并且是其所在城市与王都之间的最短路线走。问能够消灭多少叛军?...
分类:
其他好文 时间:
2014-06-24 21:19:26
阅读次数:
146
题目链接:http://acdream.info/problem?pid=1019
题意:两种操作,第一种将字符串某个位置的字符换为另一个字符;第二种查询某个连续子序列是否是回文串;
解法:有两种hash的办法,所以写了两种解法;首先hash是x1 * p^1+ x2*p^2 +x3*p^3...可以用树状数组维护前缀和,维护两个串,一个是正串,另一个是反串用于比较。比较时候乘以相应的p倍数判...
分类:
其他好文 时间:
2014-06-24 19:25:19
阅读次数:
252
Exception in thread "main"
java.lang.RuntimeException: No-args constructor for class java.sql.Timestamp does not exist. Register an InstanceCreator with Gson for this type to fix this problem.
#关于使...
分类:
其他好文 时间:
2014-06-24 17:52:56
阅读次数:
207
LOOPS
Time Limit: 15000/5000 MS (Java/Others) Memory Limit: 125536/65536 K (Java/Others)
Total Submission(s): 1864 Accepted Submission(s): 732
Problem Description
Akemi Homura is a M...
分类:
其他好文 时间:
2014-06-24 15:42:18
阅读次数:
285