Submission #258490

# Submission time Handle Problem Language Result Execution time Memory
258490 2020-08-06T04:37:06 Z 반딧불(#5073) Vim (BOI13_vim) C++17
3.77778 / 100
532 ms 888 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int n;
char s[100002];
vector<int> vec;
int DP[100002];

int main(){
    scanf("%d %s", &n, s+1);
    for(int i=1; i<=n; i++) if(s[i] == 'e') vec.push_back(i);
    n = (int)vec.size();

    for(int i=0; i<n; i++){
        if(s[vec[i]+1] == 'e'){
            DP[i] = 1e9;
            continue;
        }
        DP[i] = (vec[i] - vec[0]) + 4 + i;
        for(int j=0; j<i; j++){
            DP[i] = min(DP[i], DP[j] + (vec[i] - vec[j+1]) + 4 + (i-j));
        }
    }
    printf("%d", DP[n-1]);
}

Compilation message

vim.cpp: In function 'int main()':
vim.cpp:13:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d %s", &n, s+1);
     ~~~~~^~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Output isn't correct
2 Incorrect 0 ms 384 KB Output isn't correct
3 Incorrect 1 ms 384 KB Output isn't correct
4 Incorrect 0 ms 384 KB Output isn't correct
5 Incorrect 0 ms 384 KB Output isn't correct
6 Incorrect 1 ms 384 KB Output isn't correct
7 Incorrect 0 ms 384 KB Output isn't correct
8 Incorrect 0 ms 384 KB Output isn't correct
9 Correct 0 ms 256 KB Output is correct
10 Correct 0 ms 256 KB Output is correct
11 Incorrect 0 ms 384 KB Output isn't correct
12 Incorrect 0 ms 384 KB Output isn't correct
13 Incorrect 0 ms 384 KB Output isn't correct
14 Incorrect 1 ms 384 KB Output isn't correct
15 Incorrect 0 ms 384 KB Output isn't correct
16 Incorrect 0 ms 256 KB Output isn't correct
17 Incorrect 0 ms 384 KB Output isn't correct
18 Incorrect 0 ms 384 KB Output isn't correct
19 Incorrect 0 ms 384 KB Output isn't correct
20 Incorrect 0 ms 384 KB Output isn't correct
21 Incorrect 0 ms 384 KB Output isn't correct
22 Incorrect 0 ms 384 KB Output isn't correct
23 Incorrect 0 ms 256 KB Output isn't correct
24 Incorrect 0 ms 256 KB Output isn't correct
25 Incorrect 0 ms 384 KB Output isn't correct
26 Incorrect 0 ms 384 KB Output isn't correct
27 Incorrect 0 ms 384 KB Output isn't correct
28 Incorrect 0 ms 384 KB Output isn't correct
29 Incorrect 0 ms 384 KB Output isn't correct
30 Incorrect 0 ms 384 KB Output isn't correct
31 Incorrect 0 ms 256 KB Output isn't correct
32 Incorrect 0 ms 384 KB Output isn't correct
33 Incorrect 0 ms 384 KB Output isn't correct
34 Incorrect 0 ms 384 KB Output isn't correct
35 Incorrect 0 ms 384 KB Output isn't correct
36 Incorrect 0 ms 384 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 384 KB Output isn't correct
2 Incorrect 5 ms 384 KB Output isn't correct
3 Incorrect 1 ms 384 KB Output isn't correct
4 Incorrect 3 ms 384 KB Output isn't correct
5 Incorrect 4 ms 384 KB Output isn't correct
6 Incorrect 2 ms 384 KB Output isn't correct
7 Incorrect 4 ms 384 KB Output isn't correct
8 Correct 3 ms 384 KB Output is correct
9 Incorrect 4 ms 384 KB Output isn't correct
10 Incorrect 4 ms 384 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 171 ms 512 KB Output isn't correct
2 Incorrect 190 ms 640 KB Output isn't correct
3 Incorrect 166 ms 512 KB Output isn't correct
4 Incorrect 397 ms 760 KB Output isn't correct
5 Incorrect 241 ms 692 KB Output isn't correct
6 Incorrect 485 ms 884 KB Output isn't correct
7 Incorrect 461 ms 812 KB Output isn't correct
8 Incorrect 326 ms 640 KB Output isn't correct
9 Incorrect 491 ms 760 KB Output isn't correct
10 Incorrect 503 ms 768 KB Output isn't correct
11 Incorrect 440 ms 760 KB Output isn't correct
12 Incorrect 263 ms 760 KB Output isn't correct
13 Incorrect 201 ms 888 KB Output isn't correct
14 Incorrect 282 ms 640 KB Output isn't correct
15 Incorrect 532 ms 808 KB Output isn't correct
16 Incorrect 157 ms 632 KB Output isn't correct
17 Incorrect 191 ms 632 KB Output isn't correct
18 Incorrect 168 ms 512 KB Output isn't correct
19 Incorrect 187 ms 640 KB Output isn't correct
20 Incorrect 388 ms 760 KB Output isn't correct