#include <bits/stdc++.h>
using namespace std;
using ll = long long;
void solve() {
int n; cin >> n;
vector<int> dif;
int cur = 0;
for(int i = 0; i < n; i++) {
cout << i + 1 << ' ';
for(int j = 0; j <= i; j++) {
cout << j + 1 << ' ';
}
cout << endl;
int x; cin >> x;
if(x > cur) {
cur = x;
dif.push_back(i);
}
}
auto dnc = [&](auto &&self, int l, int r, int j) -> int {
if(l == r) return dif[l];
int m = (l + r) >> 1;
cout << m - l + 1 + 1 << ' ';
cout << j + 1 << ' ';
for(int i = l; i <= m; i++) {
cout << dif[i] + 1 << ' ';
}
cout << endl;
int x; cin >> x;
if(x < m - l + 1 + 1) {
return self(self, l, m, j);
} else {
return self(self, m + 1, r, j);
}
};
cout << 0 << ' ';
for(int i = 0; i < n; i++) {
if(binary_search(dif.begin(), dif.end(), i)) {
cout << i + 1 << ' ';
} else {
cout << dnc(dnc, 0, dif.size() - 1, i) + 1 << ' ';
}
}
cout << endl;
}
signed main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
solve();
}
| # | 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... |