摘要:
回文字符串时间限制:3000ms | 内存限制:65535KB难度:4描述所谓回文字符串,就是一个字符串,从左到右读和从右到左读是完全一样的,比如"aba"。当然,我们给你的问题不会再简单到判断一个字符串是不是回文字符串。现在要求你,给你一个字符串,可在任意位置添加字符,最少再添加几个字符,可以使这个字符串成为回文字符串。输入第一行给出整数N(0接下来的N行,每行一个字符串,每个字符串长度不超过1000.输出每行输出所需添加的最少字符数样例输入1 Ab3bd样例输出2来源IOI 2000这题目只需要求个数,不必具体写出添加的字符,那么求原串和转置串的LCS的长度g,再用LE 阅读全文
posted @ 2013-02-09 08:03
ChrisZZ
阅读(143)
评论(0)
推荐(0)
摘要:
子串和时间限制:5000ms | 内存限制:65535KB难度:3描述给定一整型数列{a1,a2...,an},找出连续非空子串{ax,ax+1,...,ay},使得该子序列的和最大,其中,1#include using namespace std;const int MAXN = 1000000 + 5;int dp[MAXN], a[MAXN];int main(){// freopen("in.txt", "r", stdin); int cas; scanf("%d", &cas); while(cas--){ int 阅读全文
posted @ 2013-02-09 08:02
ChrisZZ
阅读(184)
评论(0)
推荐(0)
摘要:
单调递增子序列(二)时间限制:1000ms | 内存限制:65535KB难度:4描述给定一整型数列{a1,a2...,an}(0如:1 9 10 5 11 2 13的最长单调递增子序列是1 9 10 11 13,长度为5。输入有多组测试数据(#include #include using namespace std;const int MAXN = 100000 + 5;int main(){// freopen("in.txt", "r", stdin); int m, i, a[MAXN]; while(scanf("%d", & 阅读全文
posted @ 2013-02-09 08:01
ChrisZZ
阅读(183)
评论(0)
推荐(0)

浙公网安备 33010602011771号