Submission #944654

# Submission time Handle Problem Language Result Execution time Memory
944654 2024-03-13T02:42:22 Z rocketsri Carnival (CEOI14_carnival) C++17
0 / 100
2 ms 344 KB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n; cin >> n;
	vector<bool> a(n+1), c(n+1); int size=0, cnt=0;

	for(int i=1; i<=n; i++) {
		a[i]=true;
		size++;
		cout << size << " ";
		for(int j=1; j<=i; j++) {
			if(a[j]) cout << j << " ";
		}
		cout << endl;

		int x; cin >> x;
		if(x == size) {
			c[i] = ++cnt;
			continue;
		}

		int l=1, r=size;
		while(l < r-1) {
			int mid = (l+r)/2, sum=0;
			cout << mid-l+1 << " ";

			for(int j=1; j<i; j++) {
				sum += a[j];
				if(a[j] && sum>=l && sum<mid) cout << j << " ";
			}
			cout << i << endl;

			cin >> x;
			if(x == mid-l+1) {
				l = mid;
			}
			else {
				r = mid;
			}
		}

		for(int j=1; j<i; j++) {
			l -= a[j];
			if(a[j] && l==0) c[i] = c[j];
		}
		a[i]=0;
		size--;
	}

	cout << 0 << " ";
	for(int i=1; i<=n; i++) {
		cout << c[i] << " ";
	}
	cout << endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Incorrect 2 ms 344 KB Incorrect
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 344 KB Incorrect
2 Halted 0 ms 0 KB -