2012年9月15日

Palindrome DP

摘要: 算法:最长上升子序列,求字符串的正序和逆序的最长上升子序列,N - dp[N][N]就是最少要添加的单词。View Code #include<iostream>#include<string>using namespace std;class Matrix{ public: int solve(int ); void input( ) { scanf("%s", pstr+1);} void reverse(int ); private: char pstr[5010]; char qstr[5010]; short int dp[... 阅读全文

posted @ 2012-09-15 10:41 more think, more gains 阅读(220) 评论(0) 推荐(0)

导航