Submission #1084329

# Submission time Handle Problem Language Result Execution time Memory
1084329 2024-09-05T22:07:32 Z 4QT0R Carnival (CEOI14_carnival) C++17
0 / 100
6 ms 344 KB
#include <bits/stdc++.h>
using namespace std;

int odp[152];

int comm(int l, int r, int ind){
	if (l==r)return l;
	int md=(l+r)/2;

	int query;
	cout << md-l+2 << ' ';
	for (int j = l; j<=md; j++)cout << j << ' ';
	cout << ind << endl;
	cin >> query;
	if (query<(md-l+2))return comm(l,md,ind);
	else return comm(md+1,r,ind);
}

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n;
	odp[1]=1;
	int spoj=1;
	int k;
	for (int i = 2; i<=n; i++){
		cout << i << ' ';
		for (int j = 1; j<=i; j++)cout << j << ' ';
		cout << endl;
		cin >> k;
		if (k>spoj){
			odp[i]=++spoj;
			continue;
		}
		odp[i]=comm(1,i-1,i);
	}
	cout << "0 ";
	for (int i = 1; i<=n; i++)cout << odp[i] << ' ';
	cout << '\n';
}
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 344 KB Integer 14 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 344 KB Output is correct
2 Incorrect 5 ms 344 KB Incorrect
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 344 KB Output is correct
2 Incorrect 5 ms 344 KB Incorrect
3 Halted 0 ms 0 KB -