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;
/// 15:08
const int Nmax = 155;
int n, i, x, C=0, a[Nmax], cnt[Nmax];
int bs(int id)
{
int st, dr, mid, x, j;
st = 1, dr = id-1;
while(st <= dr)
{
mid = (st+dr)/2;
cout << mid+1 << ' ';
for(j=1; j<=mid; ++j) cout << j << ' ';
cout << id << '\n';
fflush(stdout);
cin >> x;
if(x != cnt[mid]) st = mid+1;
else dr = mid-1;
}
return a[st];
}
int main()
{
cin >> n;
for(i=1; i<=n; ++i)
{
x = bs(i);
if(x) a[i] = x;
else a[i] = ++C;
cnt[i] = C;
}
cout << 0;
for(i=1; i<=n; ++i) cout << ' ' << a[i];
cout << '\n';
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... |