//http://noi.openjudge.cn/ch0206/1808 #include #include #include #include const int MAX_LEN = 200+5; std::string s1,s2; int dp[MAX_LEN][MAX_LEN]; template T max(const T t1,const T t2,const T t3){ return std::max(t1,std::max(t2,t3)); } template void print(const Args&...args){ std::stringstream ss; ((ss<>s1>>s2) { for(int i=1;i<=s1.length();i++){ for(int j=1;j<=s2.length();j++){ if(s1[i-1]==s2[j-1]){ dp[i][j] = dp[i-1][j-1] + 1; }else{ dp[i][j] = max(dp[i][j-1], dp[i-1][j], dp[i-1][j-1]); } } } // std::cout<