文章

7

粉丝

254

获赞

2

访问

76.7k

头像
蓝翔研究生
P1627 上海交通大学2018年机试题
发布于2020年4月9日 16:51
阅读数 8.5k

#include
#include
using namespace std;
const int maxn = 1000;
char a[maxn], b[maxn];
int dp[maxn][maxn];

int main(){
    //dp[i][j] == dp[i-1][j-1] + 1; a[i] == b[j]
    //         == 0;    
    while(scanf("%s %s", a, b) != EOF){
        int alen = strlen(a);
        int blen = strlen(b);
        
        for(int i = 0; i <= alen; i++){ //col
            dp[i][0] = 0;
        }
        for(int i = 0; i <= blen; i++){ // row
            dp[0][i] = 0;
        }
        
        int ans = 0;
        int e,s = 0;
        
  &nbs...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发