Submission #534650

# Submission time Handle Problem Language Result Execution time Memory
534650 2022-03-08T12:48:40 Z haxorman Carnival (CEOI14_carnival) C++14
0 / 100
6 ms 316 KB
#include <bits/stdc++.h>
using namespace std;

const int mxN = 157;

int ans[mxN];
vector<int> c[mxN];

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

	int n;
	cin >> n;
	
	int cur = 1;
	ans[1] = cur;
	c[cur].push_back(1);
	
	for (int i = 2; i <= n; ++i) {
		cout << cur + 1 << ' ';
		for (int j = 1; j <= cur; ++j) {
			cout << c[j].back() << ' ';
		}
		cout << i << endl;

		int num;
		cin >> num;

		if (num == cur + 1) {
			ans[i] = ++cur;
			c[cur].push_back(i);
			continue;
		}
		
		int l = 1, r = cur;
		while (l <= r) {
			int mid = (l + r) / 2;
			
			cout << mid + 1 << ' ';
			for (int j = 1; j <= mid; ++j) {
				cout << c[j].back() << ' ';
			}
			cout << i << endl;

			cin >> num;

			if (num == 1) {
				ans[i] = mid;
				c[mid].push_back(i);
				break;
			}

			if (num == mid + 1) {
				l = mid + 1;
			}
			else {
				r = mid - 1;
			}
		}
	}


	cout << "0 ";
	for (int i = 1; i <= n; ++i) {
		cout << ans[i] << ' ';
	}
	cout << endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 200 KB Integer 0 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 200 KB Integer 0 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 316 KB Output is correct
2 Incorrect 6 ms 200 KB Integer 0 violates the range [1, 8]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 200 KB Integer 0 violates the range [1, 4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 200 KB Integer 0 violates the range [1, 2]
2 Halted 0 ms 0 KB -