Submission #1012136

# Submission time Handle Problem Language Result Execution time Memory
1012136 2024-07-01T17:23:06 Z zsombor Carnival (CEOI14_carnival) C++17
0 / 100
6 ms 344 KB
#include <iostream>
#include <vector>
using namespace std;

int n;
vector <int> v(200, 1);
vector <int> d(200, 1);

int query(int x, int r) {
	cout << r + 1 << " ";
	for (int i = 1; i <= r; i++) cout << i << " ";
	cout << x << endl;
	cin >> x;
	return x;
}

void solve(int x) {
	int l = 0, r = x, m;
	while (r - l > 1) {
		m = (l + r) / 2;
		query(x, m) > d[m] ? l = m : r = m;
	}
	v[x] = r;
	d[x] = d[x - 1] + (v[x] == x);
}

int main() {
	cin >> n;
	for (int i = 2; i <= n; i++) solve(i);
	cout << "0 ";
	for (int i = 1; i <= n; i++) cout << v[i] << " ";
}
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 344 KB Integer 19 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 344 KB Integer 6 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 344 KB Output is correct
2 Incorrect 6 ms 344 KB Integer 11 violates the range [1, 8]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 344 KB Integer 5 violates the range [1, 4]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 344 KB Output is correct
2 Incorrect 5 ms 344 KB Integer 20 violates the range [1, 17]
3 Halted 0 ms 0 KB -