很好的一道区间DP,写之前一直想的二维怎么写,实在是想不出来了,看了清楚姐姐的题解才知道,哦,是四维DP,DP这东西,真的很奇妙,想得到就是板子题,想不到能卡死人
代码附:
#pragma GCC optimize("Ofast","inline","-ffast-math")
#pragma GCC target("avx,sse2,sse3,sse4,mmx")
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5+10;
char s1[55],s2[55];
int n,m,len1,len2,ans;
int dp[55][55][55][55];
signed main()
{
int T;
scanf("%d",&T);
while(T--)
{