# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1037257 | juicy | Super Dango Maker (JOI22_dango3) | C++17 | 672 ms | 996 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 "dango3.h"
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
void dc(vector<int> cands, int lay) {
if (lay == 1) {
Answer(cands);
return;
}
int md = lay / 2;
vector<bool> vs(cands.size());
vector<int> lt, rt;
for (int i = 0; i < cands.size(); ++i) {
vector<int> nw;
for (int j = 0; j < cands.size(); ++j) {
if (!vs[j] && i != j) {
nw.push_back(cands[j]);
}
}
if (Query(nw) >= md) {
vs[i] = 1;
rt.push_back(cands[i]);
} else {
lt.push_back(cands[i]);
}
}
dc(lt, md);
dc(rt, lay - md);
}
void Solve(int N, int M) {
vector<int> res(N * M);
iota(res.begin(), res.end(), 1);
dc(res, M);
}
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... |