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;
long long n, a[1001], cur = 2, inp, color[1001];
int main()
{
cin >> n;
a[1] = 1;
color[1] = 1;
for(int i = 2; i <= n; ++i)
{
color[i] = 0;
cout.flush() << cur << " ";
for(int j = 1; j < cur; ++j)
{
cout.flush() << a[j] << " ";
}
cout.flush() << i << "\n";
cin >> inp;
if(inp == cur)
{
a[cur] = i;
color[i] = cur;
++cur;
}
}
for(int i = 1; i <= n; ++i)
{
if(!color[i])
{
long long r = cur - 1, l = 1;
while(r > l)
{
long long mid = (l + r) / 2;
cout.flush() << mid - l + 2 << " ";
for(int j = l; j <= mid; ++j)
{
cout.flush() << a[j] << " ";
}
cout.flush() << i << "\n";
cin >> inp;
if(inp == mid - l + 1)
{
r = mid - 1;
}
else
{
l = mid + 1;
}
}
color[i] = a[l];
}
}
cout.flush() << 0;
for(int i = 1; i <= n; ++i)
{
cout.flush() << " " << color[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... |