# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
757390 | drdilyor | Vim (BOI13_vim) | C++17 | 429 ms | 524288 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 ll = long long;
const int inf = 1e9;
signed main() {
cin.tie(0)->sync_with_stdio(0);
int n;
string s;
cin >> n >> s;
vector memo(n, vector(n, -1));
auto dp = [&](auto& dp, int l, int ne)->int {
if (ne == n) return 0;
if (memo[l][ne] !=-1) return memo[l][ne];
vector seen(10, 0);
int res = inf;
int cnt = 0;
for (int r = l+1; r < n; r++) {
if (s[r] == 'e') {
if (r >= ne) cnt++;
continue;
}
if (seen[s[r] % 10]) continue;
seen[s[r] % 10] = 1;
if (cnt == 0) res = min(res, dp(dp, r, ne) + 2);
else {
int nne = r+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... |