https://www.luogu.com.cn/problem/P2679
/*
CB Ntsc
*/
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define mp make_pair
#define rd read()
inline int read() {
int xx = 0, ff = 1;
char ch = getchar();
while (ch < '0' || ch > '9') {
if (ch == '-')
ff = -1;
ch = getchar();
}
while (ch >= '0' && ch <= '9') xx = xx * 10 + (ch - '0'), ch = getchar();
return xx * ff;
}
inline void write(int out) {
if (out < 0)
putchar('-'), out = -out;
if (out > 9)
write(out / 10);
putchar(out % 10 + '0');
}
const int N = 2e3 + 5;
const int M = 40;
const int INF = 1e9 + 5;
const int MOD = 1e9 + 7;
int sum[N][N];
int n,m,K,t,f[N][N]={1};
string a,b;
signed main(){
n=rd;m=rd;K=rd;
// cin>>n>>m>>K;
// cerr<<f[2][1]<<endl;
cin>>a>>b;
// f[0][0]=1;
for(int i=1;i<=n;i++){
for(int j=m;j;j--){
for(int k=K;k;k--){
if(a[i-1]==b[j-1])sum[j][k]=(sum[j-1][k]+f[j-1][k-1])%MOD;
else sum[j][k]=0;
f[j][k]=(f[j][k]+sum[j][k])%MOD;
}
}
}
cout<<f[m][K];
return 0;
}
/*
1
2 5 1
0 0 1
0 0 4
*/
问题:
ideone和本地vscode均能过,提交后直接显示CE无CE信息,洛谷ide编译失败信息如下
Nothing is compiled: OUTPUT exceeds.