摘要: dp ,经典LCS,你懂的,不解释//dp 经典的LCS问题。对于s1,s2,如果c(s1)=c(s2),则f(s1,s2)=f(s1-1,s2-1,)+1,如果c(s2)!=c(s1),则 //f(s1,s2)=max{f(s1-1,s2),f(s1,s2-1)},边界是f(s1,0)=0,f(0,s2)=0; #include <iostream> #include <cstdio> #include <cstring> using namespace std; const int maxn=1000; const int inf=1<<31 阅读全文
posted @ 2012-11-23 17:30 LJ_COME!!!!! 阅读(127) 评论(0) 推荐(0)