Submission #1075887

#TimeUsernameProblemLanguageResultExecution timeMemory
1075887aminAncient Books (IOI17_books)C++14
0 / 100
1 ms348 KiB
#include "books.h" #include <bits/stdc++.h> using namespace std; #define ll long long long long minimum_walk(vector<int> p, int s) { ll ans=0; ll n=p.size(); ll ma=0; ll mi=-1; for(int i=0;i<n;i++) { if(p[i]==i) { continue; } if(mi==-1) mi=i; ma=i; if(p[i]>i) ans+=p[i]-i; } return ans+ma+mi; }
#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...