| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 42953 | MatheusLealV | Ancient Books (IOI17_books) | C++14 | 2 ms | 580 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 <bits/stdc++.h>
#define N 501
using namespace std;
typedef long long ll;
int n, s, ans[1000050];
ll minimum_walk(vector<int> v, int s_)
{
ll sum = 0, last = 0;
n = v.size(), s = s_;
for(int i = 0; i < n; i++)
{
while(v[i] != i)
{
swap(v[i], v[v[i]]);
sum += abs(v[v[i]] - v[i]);
last = min(v[i], v[v[i]]);
}
sum ++;
}
return sum + last - 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... | ||||
