# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
670527 | someone | Exam (eJOI20_exam) | C++14 | 301 ms | 315076 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>
#define int long long
using namespace std;
const int N = 5e3 + 42, INF = 1e18 + 42;
int n, a[N], b[N], nb[N][N], cost[N][N], dp[N];
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n;
for(int i = 0; i < n; i++)
cin >> a[i];
for(int i = 0; i < n; i++)
cin >> b[i];
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++) {
nb[i][j+1] = nb[i][j];
if(a[i] == b[j])
nb[i][j+1]++;
}
for(int i = 0; i < n; i++) {
int imax = i;
for(int j = i+1; j <= n; j++) {
if(a[imax] < a[j-1])
# | 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... |