Submission #99368

# Submission time Handle Problem Language Result Execution time Memory
99368 2019-03-03T04:13:20 Z nad312 Carnival (CEOI14_carnival) C++17
0 / 100
9 ms 412 KB
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
const lli N=200;
lli n, a[N], col[N], st[N], cnt=0;
deque<lli> query, p;
lli Ask()
{
	cout<<query.size();
	for(auto v: query)
	{
		cout<<" "<<v;
	}
	cout<<endl;
	fflush(stdout);
	lli k;
	cin>>k;
	return k;
}
void Find(lli x)
{
	lli l=0, h=p.size()-1;
	while(l<h)
	{
		lli mid=(l+h)/2;
		query.clear();
		query.push_back(x);
		for(int i=l;i<=mid;i++)
		{
			query.push_back(p[i]);
		}
		if(Ask()>a[p[mid]])
		{
			l=mid+1;
		}
		else
		{
			h=mid;
		}
	}
	col[x]=col[p[l]];
}
int main()
{
	fill_n(&col[0], sizeof(col)/sizeof(col[0]), -1);
	cin>>n;
	a[0]=0;
	for(int i=1;i<=n;i++)
	{
		query.push_back(i);
		a[i]=Ask();
		if(a[i]>a[i-1])
		{
			cnt++;
			col[i]=cnt;
		}
	}
	for(int i=1;i<=n;i++)
	{
		if(col[i]==-1)
		{
			Find(i);
		}
		else
		{
			p.push_back(i);
		}
	}
	cout<<0;
	for(int i=1;i<=n;i++)
	{
		cout<<" "<<col[i];
	}
	cout<<endl;
	fflush(stdout);
}
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 256 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 412 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 332 KB Output is correct
2 Incorrect 8 ms 256 KB Incorrect
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 328 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 260 KB Output is correct
2 Incorrect 9 ms 384 KB Incorrect
3 Halted 0 ms 0 KB -