# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
581087 | Josia | Art Collections (BOI22_art) | C++17 | 2277 ms | 68240 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;
map<deque<int>, int> dict;
int query(deque<int> a) {
if (dict.count(a)) return dict[a];
vector<int> blub;
for (int &i: a) blub.push_back(i+1);
return dict[a] = publish(blub);
}
void solve(int n) {
deque<int> a;
for (int i = 0; i<n; i++) {
a.push_back(i);
}
vector<int> res(n, -1);
int last = query(a);
for (int i = 0; i<n; i++) {
a.push_back(a[0]);
a.pop_front();
int q = query(a);
int rank = (n)/2.0 + ((last-q)/2.0);
cerr << rank << "\n";
res[rank] = a.back() + 1;
last = q;
}
answer(res);
}
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... |