# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
260069 | arnold518 | Vim (BOI13_vim) | C++14 | 2102 ms | 98808 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;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int MAXN = 5000;
int N;
char A[MAXN+10];
int dp[MAXN+10][MAXN+10];
vector<int> V[20];
int solve(int now, int pos)
{
int &ret=dp[now][pos];
if(ret!=-1) return ret;
ret=987654321;
for(int i=0; i<10; i++)
{
if(i==4) continue;
auto it=upper_bound(V[i].begin(), V[i].end(), now);
if(it==V[i].end()) continue;
ret=min(ret, solve(*it, pos)+2);
}
if(now>pos)
{
int p=now-pos+lower_bound(V[4].begin(), V[4].end(), now)-lower_bound(V[4].begin(), V[4].end(), pos);
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |