# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
713231 | gun_gan | Art Collections (BOI22_art) | C++17 | 1566 ms | 664 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 "art.h"
using namespace std;
void solve(int n) {
vector<int> ans(n), v;
int x = 0;
{
for(int j = 2; j <= n; j++) {
v.push_back(j);
}
v.push_back(1);
x = publish(v);
v.clear();
v.push_back(1);
for(int j = 2; j <= n; j++) {
v.push_back(j);
}
int y = publish(v);
ans[n - (x - y + n - 1) / 2 - 1] = 1;
x = y;
}
int cnt = 2;
while(cnt < n) {
int b = v.back();
for(int i = n - 1; i >= 1; i--) v[i] = v[i - 1];
v[0] = b;
int y = publish(v);
ans[n - (x - y + n - 1) / 2 - 1] = b;
x = y;
cnt++;
}
for(int i = 0; i < n; i++) {
if(ans[i] == 0) ans[i] = v.back();
}
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... |