# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
629598 | null_awe | Art Collections (BOI22_art) | C++17 | 1620 ms | 856 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 <art.h>
using namespace std;
void solve(int n) {
vector<int> arr(n), order(n); for (int i = 0; i < n; ++i) arr[i] = i + 1;
set<int> un; for (int i = 0; i < n; ++i) un.insert(i);
int base = publish(arr);
for (int i = 0; i < n - 1; ++i) {
for (int j = 0; j < i; ++j) arr[j] = j + 1;
for (int j = i; j < n - 1; ++j) arr[j] = j + 2;
arr[n - 1] = i + 1;
int comp = publish(arr), l = (base - comp + n - i - 1) / 2, rem = 0;
for (int num : un) {
if (rem == l) {
rem = num;
break;
}
++rem;
}
order[rem] = i + 1, un.erase(rem);
}
for (int i = 0; i < n; ++i) if (!order[i]) order[i] = n;
answer(order);
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |