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 "books.h"
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int mxn = 1e6+10;
int N;
long long minimum_walk(std::vector<int> p, int s) {
ll ans = 0;
N = p.size();
for(int i = 0;i<N;i++)ans += abs(p[i]-i);
for(int i = 0;i<N;i++){
if(i != p[i]){
ans += i<<1;
break;
}
}
return ans;
}
# | 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... |