# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
294769 | amoo_safar | Ancient Books (IOI17_books) | C++17 | 2084 ms | 29400 KiB |
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>
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
const int N = 1e6 + 10;
int mk[N], mk2[N];
int L[N], R[N];
//int mn[N][N], mx[N][N];
//ll dp[N][N];
ll minimum_walk(vector<int> p, int s) {
int n = p.size();
ll ans = 0;
ll near = n;
for(int i = 0; i < n; i++){
if(p[i] != i){
ans += abs(p[i] - i);
} else {
//mk[i] = 1;
Compilation message (stderr)
# | 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... |