#include<bits/stdc++.h>
using namespace std;
int main(){
//int n, m;
string s1, s2;
int n , m;
cin >> n >> m;
cin >> s1 >> s2;
int b[n + 1][m + 1];
for(int i = 0;i < n;i++){
for(int j = 0;j < m;j++){
b[i][j] = 0;
}
}
for(int i = 0;i < n;i++){
for(int j = 0;j < m;j++){
if(s1[i] == s2[j]){
b[i + 1][j + 1] = b[i][j] + 1;
}
else{
b[i + 1][j + 1] = b[i + 1][j] > b[i][j + 1] ? b[i + 1][j] : b[i][j + 1];
}
}
}
cout << b[n][m] + 0;
return 0;
}
https://www.luogu.com.cn/problem/T335893
file:///C:/Users/41251/Desktop/VJ)_IMYM@OG8J_G2K3QNRAI.png_IMYM@OG8J_G2K3QNRAI.png)
wei sheng mo zhi de le 10 fen?