# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
746465 | Szil | Art Collections (BOI22_art) | C++17 | 1705 ms | 676 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"
#include <bits/stdc++.h>
using namespace std;
int ask(int first, int n) {
vector<int> q;
for (int i = first; i <= n; i++) {
q.push_back(i);
}
for (int i = 1; i < first; i++) {
q.push_back(i);
}
return publish(q);
}
void solve(int n) {
int x = ask(1, n);
cerr << x << endl;
vector<int> ans(n);
for (int i = 2; i <= n; i++) {
int y = ask(i, n);
int delta = x-y;
int rank = (delta + 1 + n) / 2;
ans[rank-1] = i-1;
x = y;
}
for (int &i : ans) {
if (i == 0) {
i = n;
break;
}
}
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... |