# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
769638 | pedroslrey | Super Dango Maker (JOI22_dango3) | C++17 | 223 ms | 596 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;
void Solve(int a, int b) {
int n = a*b;
vector<int> free;
for (int i = 1; i <= n; ++i)
free.push_back(i);
for (int i = 0; i < b; ++i) {
vector<int> know;
int r = free.size() - 1;
for (int j = 0; j < a; ++j) {
int l = 0;
while (l < r) {
int m = (l + r)/2;
vector<int> qs;
for (int k = 0; k <= m; ++k)
qs.push_back(free[k]);
for (int x: know)
qs.push_back(free[x]);
if (Query(qs) >= 1) r = m;
else l = m + 1;
}
know.push_back(r);
--r;
}
vector<int> ans;
for (int x: know)
ans.push_back(free[x]);
Answer(ans);
vector<int> nxt; int ptr = a - 1;
for (int j = 0; j < free.size(); ++j) {
if (know[ptr] == j) --ptr;
else nxt.push_back(free[j]);
}
free = nxt;
}
}
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... |