Submission #750211

# Submission time Handle Problem Language Result Execution time Memory
750211 2023-05-29T07:53:32 Z tlnk07 Carnival (CEOI14_carnival) C++17
0 / 100
9 ms 208 KB
#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
1 Incorrect 5 ms 208 KB Integer 19 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 208 KB Integer 6 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 208 KB Output is correct
2 Incorrect 5 ms 208 KB Integer 13 violates the range [1, 8]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 208 KB Integer 5 violates the range [1, 4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 208 KB Output is correct
2 Incorrect 9 ms 208 KB Integer 22 violates the range [1, 17]
3 Halted 0 ms 0 KB -