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>
using namespace std;
int main(){
int nums; cin >> nums;
vector<int> ans(nums + 1), ind(nums + 1);
ans[1] = 1; ind[1] = 1;
int curr = 1;
for (int i = 2; i <= nums; i++){
int w, wo;
cout << i << ' ';
for (int j = 1; j <= i; j++) cout << j << ' ';
cout << endl;
cin >> w;
cout << i - 1 << ' ';
for (int j = 1; j < i; j++) cout << j << ' ';
cout << endl;
cin >> wo;
if (w > wo){
curr++;
ans[i] = curr;
ind[curr] = i;
continue;
}
int l = 1, r = curr;
while (l <= r){
if (l == r) break;
int m = (l + r) >> 1;
int num = m - l + 1;
cout << num + 1 << ' ';
for (int j = l; j <= m; j++) cout << ind[j] << ' ';
cout << i << endl;
cin >> w;
if (w > num) l = m + 1;
else r = m;
}
ans[i] = l;
}
cout << 0 << ' ';
for (int i = 1; i <= nums; i++) cout << ans[i] << ' ';
cout << endl;
return 0;
}
# | 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... |