# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
721720 | drdilyor | Art Collections (BOI22_art) | C++17 | 1555 ms | 612 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> ans(n);
vector<int> inv(n);
vector<int> t(n);
iota(t.begin(), t.end(), 1);
for (int i = 0; i < n; i++) {
inv[i] = publish(t);
rotate(t.begin(), t.begin() + 1, t.end());
}
for (int i = 0; i < n; i++) {
int inv1 = inv[i];
int inv2 = inv[(i+1) % n];
int diff = (1 - n%2 + inv1 - inv2) / 2;
ans[diff + (n-1) / 2] = i+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... |