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>
#define ll long long
#define all(v) begin(v), end(v)
#define pi pair<int, int>
#define vi vector<int>
using namespace std;
int n, id[155] = {0, 1};
vector<int> rf;
int main(){
cin >> n;
int prev = 1, k;
rf.push_back(1);
for(int i = 2; i <= n; i++){
cout << i << " ";
for(int j = 1; j <= i; j++) cout << j << " ";
cout << endl;
cin >> k;
if(k > prev){
prev = k;
rf.push_back(i);
id[i] = prev;
}
}
for(int i = 1; i <= n; i++){
if(id[i]) continue;
int l = 0, r = rf.size() - 1, mid;
while(l<=r){
mid = (l+r)>>1;
cout << mid+2 << " " << i << " ";
for(int i = 0; i <= mid; i++) cout << rf[i] << " ";
cout << "\n";
cin >> k;
if(k < mid+2) r = mid-1;
else l = mid+1;
}
id[i] = id[rf[l]];
}
cout << 0 << " ";
for(int i = 1; i <= n; i++) cout << id[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... |