Submission #54700

# Submission time Handle Problem Language Result Execution time Memory
54700 2018-07-04T16:23:07 Z fallingstar Ancient Books (IOI17_books) C++14
0 / 100
2 ms 720 KB
#include <cassert>
#include <iostream>
#include <algorithm>
#include <vector>

#define long long long

using namespace std;

long minimum_walk(vector<int> p, int s)
{
    int n = p.size();
    assert(s == 0);
    int mx = 0; long ans = 0;
    for (int i = 0; i < n; ++i)
    {
        if (i > 0 && mx < i) ans += 2;
        mx = max(mx, p[i]);
        ans += abs(i - p[i]);
    }
    return ans;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 496 KB Output is correct
3 Correct 2 ms 496 KB Output is correct
4 Correct 2 ms 540 KB Output is correct
5 Incorrect 2 ms 540 KB 3rd lines differ - on the 1st token, expected: '4', found: '6'
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 496 KB Output is correct
3 Correct 2 ms 496 KB Output is correct
4 Correct 2 ms 540 KB Output is correct
5 Incorrect 2 ms 540 KB 3rd lines differ - on the 1st token, expected: '4', found: '6'
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 496 KB Output is correct
3 Correct 2 ms 496 KB Output is correct
4 Correct 2 ms 540 KB Output is correct
5 Incorrect 2 ms 540 KB 3rd lines differ - on the 1st token, expected: '4', found: '6'
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 720 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 496 KB Output is correct
3 Correct 2 ms 496 KB Output is correct
4 Correct 2 ms 540 KB Output is correct
5 Incorrect 2 ms 540 KB 3rd lines differ - on the 1st token, expected: '4', found: '6'
6 Halted 0 ms 0 KB -