# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
595610 | pedroslrey | Art Collections (BOI22_art) | C++17 | 1520 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>
#include "art.h"
using namespace std;
int query(int k, int n) {
vector<int> xs;
for (int i = k + 1; i <= n; ++i)
xs.push_back(i);
for (int i = 1; i <= k; ++i)
xs.push_back(i);
return publish(xs);
}
void solve(int n) {
int lst = query(0, n);
vector<int> ans(n, -1);
for (int i = 1; i < n; ++i) {
int val = query(i, n);
ans[(lst - val + n - 1)/2] = i;
lst = val;
}
for (int &x: ans)
if (x == -1) x = n;
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... |