_Glassy_Sky_ @ 2023-01-15 18:52:38
#include<bits/stdc++.h>
using namespace std;
int a[100001], b[100001];
int f[100001][100001];
int main()
{
int n;
cin >> n;
for(int i = 1; i <= n; i ++)
cin >> a[i];
for(int i = 1; i <= n; i ++)
cin >> b[i];
for(int i = 1; i <= n; i ++)
for(int j = 1; j <= n; j ++)
{
f[i][j] = max(f[i - 1][j], f[i][j - 1]);
if(a[i - 1] == b[j - 1])
f[i][j] = max(f[i][j], f[i - 1][j - 1] + 1);
}
cout << f[n][n];
return 0;
by zjy2008 @ 2023-01-15 18:55:22
MLE
by Fractured_Angel @ 2023-01-15 19:03:46
这明显就是MLE,数组开那么大
by arrow_king @ 2023-01-15 19:39:42
@OIdrearmer_Z 再说这题时间复杂度要
by sz_jinzikai @ 2023-05-20 15:43:42
@FZwangmuem 我很好奇你本地怎么过的。。。
by QBY1617 @ 2023-08-18 16:19:36
他本地过不了,但是不会像别的编译错误那样,他会正常出现运行框