#include "chameleon.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
int variable_example = 1;
} // namespace
void Solve(int N) {
vector <int> ve(2 * N);
iota(ve.begin(), ve.end(), 1);
for (int times = 0; times < N; times++) {
int low = 1, high = ve.size() - 1, posL = -1, posR = -1;
while (low <= high) {
int mid = (low + high) >> 1;
vector <int> ask(ve.begin(), ve.begin() + mid + 1);
if (Query(ask) < ask.size())
high = (posR = mid) - 1;
else low = mid + 1;
}
low = 0, high = posR - 1;
while (low <= high) {
int mid = (low + high) >> 1;
vector <int> ask(ve.begin() + mid, ve.begin() + posR + 1);
if (Query(ask) < ask.size())
low = (posL = mid) + 1;
else high = mid - 1;
}
Answer(ve[posL], ve[posR]);
ve.erase(ve.begin() + posR);
ve.erase(ve.begin() + posL);
}
}
| # | 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... |