# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
588449 | dozer | Exam (eJOI20_exam) | C++14 | 345 ms | 197584 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define sp " "
#define endl "\n"
#define fileio() freopen("input.txt", "r", stdin), freopen("output.txt", "w", stdout)
#define fastio() cin.tie(0), ios_base::sync_with_stdio(0)
#define N 5005
#define pii pair<int, int>
#define st first
#define nd second
#define modulo 1000000007
#define LOGN 18
#define int long long
int a[N], b[N];
int dp[N][N];
map<int, int> val;
int f(int i, int j)
{
if (i == 0 || j == 0) return 0;
if (dp[i][j] != -1) return dp[i][j];
int ans = f(i, j - 1);
if (b[j] == a[i]) ans++;
ans = max(ans, f(i - 1, min(j, i - 1)));
return dp[i][j] = ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |