Submission #752693

# Submission time Handle Problem Language Result Execution time Memory
752693 2023-06-03T12:30:50 Z MSK17 Carnival (CEOI14_carnival) C++14
0 / 100
7 ms 208 KB
#include <bits/stdc++.h>

int main(){
	int n,ind{1},last{1};
	std::cin>>n;
	std::vector<int> col(n+1);
	std::vector<int> dist;
	col[1]=ind++;
	dist.push_back(1);
	for(int i{2}; i <= n; ++i){
		std::cout << i << std::endl;
		for(int j{1}; j <= i; ++j){
			std::cout << j << (j==i?"":" ");
		}
		std::cout << std::endl;
		int input;
		std::cin>>input;
		if(input>last){
			dist.push_back(i);
			col[i]=ind++;
		}
		last=input;
	}
	for(int i{1}; i<=n; ++i){
		if(col[i])
			continue;
		int l=0, r=dist.size()-1;
		while(l<r){
			int m=(l+r)/2;
			std::cout << m-l+2 << std::endl;
			for(int j{l}; j <= m; ++j)
				std::cout << dist[j] << " ";
			std::cout << i << std::endl;
			int input;
			std::cin>>input;
			if(input==m-l+1)
				r=m;
			else
				l=m+1;
		}
		col[i]=col[dist[l]];
	}
	for(int i{1}; i <= n; ++i)
		std::cout << col[i] << (i==n?"":" ");
	std::cout << std::endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 208 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 208 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 208 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 208 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 208 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -