QAQ
by world_execute @ 2019-08-08 08:51:44
你试试把提到外面去试试
by world_execute @ 2019-08-08 08:55:43
或者每次用memset进行初始化
by world_execute @ 2019-08-08 08:57:00
可能会出现不从f[i][i]开始的转移
by world_execute @ 2019-08-08 08:57:56
这个时候在里面的f数组没有被清空
by world_execute @ 2019-08-08 08:58:46
```cpp
//#pragram GCC optimize(2)
//#pragram GCC optimize(3)
//#pragram GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define Reg register
#define Rint register int
#define Lint long long int
char s[1010];
int f[1010][1010];
int main(){
scanf("%s",s);
int n=strlen(s);
memset(f,0,sizeof(f));
for(int len=2;len<=n;len++){
for(int i=0;i<=n-len;i++){
int j=i+len-1;
if(s[i]==s[j]) f[i][j]=f[i+1][j-1];
else f[i][j]=min(f[i+1][j]+1,f[i][j-1]+1);
}
}
printf("%d",f[0][n-1]);
return 0;
}
```
by world_execute @ 2019-08-08 08:59:14
每次用memset初始化一下就好了呢QAQ
by world_execute @ 2019-08-08 09:01:20
https://www.luogu.org/record/22354770
by world_execute @ 2019-08-08 09:01:29
@[world_execute](/space/show?uid=115196) %%%Orz
by 良知 @ 2019-08-08 09:02:54
$$ \color{white}\large\mathtt{Orz} $$
by momentous @ 2019-08-08 09:07:41