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 "grid.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> SortDisks(int N) {
vector<int> v;
for (int i = 0; i < N; ++i) v.push_back(i);
for (int i = 0; i < N; ++i) {
pair<int,int> most = make_pair(0,0);
for (int j = 0; j < N-i; ++j) {
swap(v[0],v[j]);
most = max(most,make_pair(PutDisks(v),j));
swap(v[0],v[j]);
}
swap(v[most.second],v[N-i-1]);
}
vector<int> ans(N);
for (int i = 0; i < N; ++i) ans[v[i]] = i+1;
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... |