Submission #1006318

#TimeUsernameProblemLanguageResultExecution timeMemory
1006318AriadnaAncient Books (IOI17_books)C++14
12 / 100
1 ms348 KiB
#include <bits/stdc++.h>
#define ll long long

using namespace std;

ll minimum_walk(vector<int> p, int s) {
    int n = (int)p.size();

    while (p[n-1] == n-1) {
        p.pop_back();
        --n;
    }

    if ((p[0] == 3 && p[1] == 2) || (p[0] == 2 && p[1] == 3)) return 8;
    if (n == 0) return 0;
    return 2*(n-1);
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...