Submission #258489

# Submission time Handle Problem Language Result Execution time Memory
258489 2020-08-06T04:35:30 Z 반딧불(#5073) Vim (BOI13_vim) C++17
3.77778 / 100
1060 ms 1144 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++){
        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 1 ms 392 KB Output isn't correct
2 Incorrect 1 ms 384 KB Output isn't correct
3 Incorrect 1 ms 384 KB Output isn't correct
4 Incorrect 1 ms 384 KB Output isn't correct
5 Incorrect 1 ms 384 KB Output isn't correct
6 Incorrect 1 ms 384 KB Output isn't correct
7 Incorrect 1 ms 384 KB Output isn't correct
8 Incorrect 1 ms 384 KB Output isn't correct
9 Correct 1 ms 384 KB Output is correct
10 Correct 1 ms 384 KB Output is correct
11 Incorrect 1 ms 384 KB Output isn't correct
12 Incorrect 1 ms 384 KB Output isn't correct
13 Incorrect 0 ms 384 KB Output isn't correct
14 Incorrect 0 ms 384 KB Output isn't correct
15 Incorrect 0 ms 384 KB Output isn't correct
16 Incorrect 1 ms 384 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 1 ms 384 KB Output isn't correct
20 Incorrect 0 ms 384 KB Output isn't correct
21 Incorrect 1 ms 384 KB Output isn't correct
22 Incorrect 1 ms 384 KB Output isn't correct
23 Incorrect 1 ms 384 KB Output isn't correct
24 Incorrect 0 ms 384 KB Output isn't correct
25 Incorrect 1 ms 384 KB Output isn't correct
26 Incorrect 1 ms 384 KB Output isn't correct
27 Incorrect 1 ms 384 KB Output isn't correct
28 Incorrect 1 ms 384 KB Output isn't correct
29 Incorrect 1 ms 384 KB Output isn't correct
30 Incorrect 0 ms 384 KB Output isn't correct
31 Incorrect 0 ms 384 KB Output isn't correct
32 Incorrect 1 ms 384 KB Output isn't correct
33 Incorrect 1 ms 384 KB Output isn't correct
34 Incorrect 1 ms 384 KB Output isn't correct
35 Incorrect 0 ms 384 KB Output isn't correct
36 Incorrect 1 ms 384 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 384 KB Output isn't correct
2 Incorrect 4 ms 384 KB Output isn't correct
3 Incorrect 2 ms 384 KB Output isn't correct
4 Incorrect 7 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 6 ms 384 KB Output isn't correct
8 Correct 5 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 180 ms 656 KB Output isn't correct
2 Incorrect 193 ms 760 KB Output isn't correct
3 Incorrect 172 ms 888 KB Output isn't correct
4 Incorrect 418 ms 888 KB Output isn't correct
5 Incorrect 245 ms 760 KB Output isn't correct
6 Incorrect 1060 ms 1012 KB Output isn't correct
7 Incorrect 471 ms 888 KB Output isn't correct
8 Incorrect 302 ms 1144 KB Output isn't correct
9 Incorrect 719 ms 888 KB Output isn't correct
10 Incorrect 841 ms 904 KB Output isn't correct
11 Incorrect 422 ms 768 KB Output isn't correct
12 Incorrect 272 ms 760 KB Output isn't correct
13 Incorrect 236 ms 760 KB Output isn't correct
14 Incorrect 263 ms 760 KB Output isn't correct
15 Incorrect 553 ms 888 KB Output isn't correct
16 Incorrect 153 ms 640 KB Output isn't correct
17 Incorrect 194 ms 640 KB Output isn't correct
18 Incorrect 177 ms 640 KB Output isn't correct
19 Incorrect 193 ms 760 KB Output isn't correct
20 Incorrect 432 ms 1016 KB Output isn't correct