# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
596067 | someone | Art Collections (BOI22_art) | C++17 | 1491 ms | 652 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 int long long
#include <art.h>
using namespace std;
const int N = 4e3 + 42;
int nbInv[N];
vector<int> id, ans;
void solve(int n) {
for(int i = 0; i < n; i++)
id.push_back(i+1);
for(int i = 0; i < n; i++) {
swap(id[0], id[i]);
nbInv[i] = publish(id);
}
for(int i = 0; i < n; i++) {
ans.push_back(i+1);
int pos = nbInv[i] - ((nbInv[i] + nbInv[0] - i) >> 1);
for(int j = i; j > pos; j--)
swap(ans[j], ans[j-1]);
}
answer(ans);
}
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... |