Submission #901395

#TimeUsernameProblemLanguageResultExecution timeMemory
901395nxteruAncient Books (IOI17_books)C++14
0 / 100
1 ms436 KiB
#include <bits/stdc++.h> using namespace std; using ll =long long; int minimum_walk(vector<int>p, int s){ int n=p.size(); ll ans=0; int ma=0; for(int i=0;i<n;i++){ ans+=abs(p[i]-i); ma=max(ma,p[i]); if(ma<=i&&i<n-1)ans+=2; } return ans; }
#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...