# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
731388 | nguyentunglam | Art Collections (BOI22_art) | C++17 | 1713 ms | 680 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;
const int N = 4010;
bool taken[N];
int query[N], cnt[N];
void solve(int n) {
vector<int> ask, ret;
for(int i = 1; i <= n; i++) ask.push_back(i);
int init = publish(ask);
for(int i = 2; i <= n; i++) {
ask = {i};
for(int j = 1; j <= n; j++) if (j != i) ask.push_back(j);
query[i] = publish(ask);
cnt[i] = i - 1;
}
for(int loop = 1; loop <= n; loop++) {
int idx = 1;
for(int i = 2; i <= n; i++) if (!taken[i] && init - cnt[i] == query[i]) idx = i;
ret.push_back(idx);
taken[idx] = 1;
for(int i = idx + 1; i <= n; i++) cnt[i]--, query[i]--;
}
answer(ret);
}
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... |