# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
251906 | dwsc | On the Grid (FXCUP4_grid) | C++17 | 4 ms | 384 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>
#include "grid.h"
using namespace std;
std::vector<int> SortDisks(int N) {
vector<int> l(N,-1);
vector<int> order;
for (int i = N; i >= 1; i--){
vector<int> unsolved;
for (int j = 0; j < N; j++){
if (l[j] == -1) unsolved.push_back(j);
}
for (int j = 0; j < unsolved.size(); j++){
vector<int> query;
query.push_back(unsolved[j]);
// cout<< unsolved[j] << "\n";
for (int k = 0; k < unsolved.size(); k++) {
if (k != j) {
query.push_back(unsolved[k]);
// cout << unsolved[k] << "\n";
}
}
for (int k = order.size()-1; k >= 0; k--) query.push_back(order[k]);
int num = PutDisks(query);
//cout <<num << "queried\n";
if (num == N-1+i){
int act = unsolved[j];
l[act] = i;
order.push_back(act);
break;
}
}
}
return l;
}
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... |