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>
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |