# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
137488 | gs14004 | Vim (BOI13_vim) | C++17 | 175 ms | 34920 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;
using lint = long long;
using pi = pair<int, int>;
const int MAXN = 70005;
int n;
char str[MAXN], buf[MAXN];
int chk[MAXN];
int dp[MAXN][10];
int d2[MAXN][10][10];
int f(int v, int w);
int g(int v, int win, int wout);
int g(int v, int win, int wout){
if(v == n - 1) return 1e9;
if(~d2[v][win][wout]) return d2[v][win][wout];
int ret = 1e9;
if(win + 'a' == str[v + 1] && wout + 'a' == str[v + 1]){
for(int i=0; i<10; i++){
ret = min(ret, f(v + 1, i) + 3);
}
for(int i=0; i<10; i++){
for(int j=0; j<10; j++){
ret = min(ret, g(v + 1, i, j) + 5);
}
}
}
else if(win + 'a' == str[v + 1]){
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... |