文章

71

粉丝

97

获赞

5

访问

17.6k

头像
最大公共子串 题解:dp
P1855 兰州大学机试
发布于2024年3月15日 15:46
阅读数 102

#include<iostream>
#include<cstring>
#include<string>
#include<vector>
using namespace std;

const int maxn = 105;
char s1[maxn];
char s2[maxn];
int dp[maxn][maxn];

int main() {
    while (cin>>s1+1>>s2+1) {
        int m = strlen(s1+1);
        int n = strlen(s2+1);
        int ans = 0;
        int table = 0;
        for (int i = 0; i <= m;i++) {
            for (int j = 0; j <= n;j++) {
                if (i==0||j==0) {
                    dp[i][j] = 0;
                }
          ...

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发