字符串模拟赛T3

时间:2023-03-08 18:31:48

字符串模拟赛T3

只看我的做法就够了

#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
using namespace std;
const int maxn = ;
int n,m,ans;
char a[maxn],b[maxn];
int main(){
cin>>a>>b;
n = strlen(a);
m = strlen(b);
int l,r,tmp;
for(int i = ;i < n;i++){
for(int j = ;j < m;j++){
tmp = ;
for(int k = ;i + k - < n && j + k - < m;k++){
if(a[i+k-] == '' && b[j+k-] == '') tmp++;
}
if(ans < tmp) ans = tmp;
}
}
cout<<ans;
return ;
}