Description There is a straight highway with villages alongside the highway. The highway is represented as an integer axis, and the position of each village is identified with a single integer coordinate. There are no two villages in the same positio…
Post Office Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 15966 Accepted: 8671 Description There is a straight highway with villages alongside the highway. The highway is represented as an integer axis, and the position of each villa…
Post Office Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 15412 Accepted: 8351 Description There is a straight highway with villages alongside the highway. The highway is represented as an integer axis, and the position of each villa…
Post Office Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 22278 Accepted: 12034 Description There is a straight highway with villages alongside the highway. The highway is represented as an integer axis, and the position of each village…
Mondriaan's Dream Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 16771 Accepted: 9683 Description Squares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his 'toilet series…
Post Office Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 17168 Accepted: 9270 Description There is a straight highway with villages alongside the highway. The highway is represented as an integer axis, and the position of each villa…
http://poj.org/problem?id=1160 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 20218 Accepted: 10899 Description There is a straight highway with villages alongside the highway. The highway is represented as an integer axis, and the po…
Apple Catching Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 14311 Accepted: 7000 Description 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 f…
题意 : 给出一个由 n 中字母组成的长度为 m 的串,给出 n 种字母添加和删除花费的代价,求让给出的串变成回文串的代价. 分析 : 原始模型 ==> 题意和本题差不多,有添和删但是并无代价之分,要求最少操作几次才能是其变成回文串 ① 其实细想之后就会发现如果没有代价之分的话删除和增添其实是一样的,那么除了原串原本拥有的最长回文串不用进行考虑处理,其他都需要进行删除或者增添来使得原串变成回文串,所以只要对原串 S 和其反向串 S' 找出两者的最长公共子串长度 L 再用总长减去 L 即可 ②…
#include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int maxn=105; int head[maxn<<1],to[maxn<<1],val[maxn],nex[maxn<<1]; int F[maxn][maxn<<1],G[maxn][maxn<<1]; int cnt,V; void ad…