摘要:
1 bool findpath(int u) 2 { 3 int i; 4 for(i=1; i<=N; i++) 5 { 6 if(!used[i] && map[u][i] == 1) 7 { 8 used[i] = 1; 9 if(match[i] == -1 || findpath(match[i]))10 {11 match[i] = u;12 return 1;13 ... 阅读全文
posted @ 2013-09-03 19:35
pc....
阅读(63)
评论(0)
推荐(0)
摘要:
http://acm.hdu.edu.cn/showproblem.php?pid=4512题意: 给你一个序列,找出回文串,可以不连续的,但必须满足从前面到中间是递增的,中间到结尾时递减的。如果没有中间的话,也就是回文串是偶数,则中间两个必须相等。坑爹: 本想直接将序列反过来然后和原串做LCIS找到一个最长的序列,但是有个恶心的数据一下子没想到,结果WA了好久, 31 2 1 3 这组数据,如果反过来的话他们的LCIS值会是3,但根据题意是不对的。解法: 原本的模板是两个for,都是1~N循环,但这样就会出现上述问题,所以在里层循环范围改成 j 2 using namespace st... 阅读全文
posted @ 2013-09-03 17:21
pc....
阅读(360)
评论(0)
推荐(0)
摘要:
1 int LCIS() 2 { 3 memset(DP,0,sizeof(DP)); 4 int i; 5 int j; 6 int max; 7 for(i=1; i str2[j] && max max)26 {27 max = DP[i];28 }29 }30 return max;31 }View Code 阅读全文
posted @ 2013-09-03 16:55
pc....
阅读(79)
评论(0)
推荐(0)
浙公网安备 33010602011771号