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;
using ll = long long;
const int maxn=200;
int n;
int a[maxn];
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cin >> n;
a[1] = 1;
int now = 1;
for(int i = 2;i <= n;i++){
int l = 1,r = i - 1,md,jog=-1;
while(l <= r){
md = (l + r) >> 1;
set<int>s;
vector<int>quer;
for(int j = md;j < i;j++){
s.insert(a[j]);
quer.push_back(j);
}
quer.push_back(i);
cout<<(int)quer.size()<<' ';
for(auto i : quer) cout<<i<<' ';
cout<<endl;
int jg; cin >> jg;
if(jg > (int)s.size()) r = md - 1;
else jog = a[md],l=md+1;
}
if(jog == -1) a[i] = ++now;
else a[i] = jog;
}
for(int i = 1;i <= n;i++) cout<<a[i]<<' ';
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... |