# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
716905 | adrilen | Art Collections (BOI22_art) | C++17 | 1528 ms | 724 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>
using namespace std;
using ll = long long;
typedef pair<int, int> pii;
#include "art.h"
void solve(int n) {
vector <int> v(n);
for (int i = 0; i < n; i++) v[i] = i + 1;
int last, first;
first = last = publish(v);
vector <int> output(n);
int val, diff;
for (int i = 0; i < n - 1; i++)
{
v.insert(v.begin(), v.back());
v.pop_back();
val = publish(v);
diff = val - last;
output[(diff + n - 1) / 2] = v.front();
swap(last, val);
}
val = first;
diff = val - last;
output[(diff + n - 1) / 2] = v.back();
answer(output);
}
/*
x + 1
3 1 2 5 4
x + 3
4 3 1 2 5
1 2 3 4 5
-4 -2 0 2 4
1 2 3 4
-3 -1 1 3
*/
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... |