답안 #1012137

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1012137 2024-07-01T17:33:29 Z zsombor 사육제 (CEOI14_carnival) C++17
100 / 100
10 ms 420 KB
#include <iostream>
#include <vector>
using namespace std;

int n, c = 2;
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 == x ? c++ : v[r]);
	d[x] = d[x - 1] + (r == 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] << " ";
}
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 344 KB Output is correct
2 Correct 5 ms 344 KB Output is correct
3 Correct 6 ms 344 KB Output is correct
4 Correct 8 ms 344 KB Output is correct
5 Correct 4 ms 344 KB Output is correct
6 Correct 5 ms 344 KB Output is correct
7 Correct 5 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 344 KB Output is correct
2 Correct 6 ms 344 KB Output is correct
3 Correct 4 ms 344 KB Output is correct
4 Correct 10 ms 344 KB Output is correct
5 Correct 4 ms 344 KB Output is correct
6 Correct 4 ms 344 KB Output is correct
7 Correct 7 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 344 KB Output is correct
2 Correct 3 ms 344 KB Output is correct
3 Correct 5 ms 344 KB Output is correct
4 Correct 6 ms 344 KB Output is correct
5 Correct 4 ms 344 KB Output is correct
6 Correct 5 ms 344 KB Output is correct
7 Correct 5 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 344 KB Output is correct
2 Correct 4 ms 344 KB Output is correct
3 Correct 7 ms 344 KB Output is correct
4 Correct 7 ms 344 KB Output is correct
5 Correct 5 ms 344 KB Output is correct
6 Correct 5 ms 344 KB Output is correct
7 Correct 5 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 344 KB Output is correct
2 Correct 4 ms 344 KB Output is correct
3 Correct 5 ms 420 KB Output is correct
4 Correct 6 ms 344 KB Output is correct
5 Correct 5 ms 344 KB Output is correct
6 Correct 6 ms 344 KB Output is correct
7 Correct 7 ms 344 KB Output is correct