Submission #554265

# Submission time Handle Problem Language Result Execution time Memory
554265 2022-04-28T05:26:21 Z Gurban Carnival (CEOI14_carnival) C++17
100 / 100
19 ms 324 KB
#include "bits/stdc++.h"
using namespace std;

using ll = long long;

const int maxn=200;
int n;
int a[maxn];

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

	cin >> n;
	a[1] = 1;
	int now = 1;
	for(int i = 2;i <= n;i++){
		int l = 1,r = i - 1,md,jog=-1;
		while(l <= r){
			md = (l + r) >> 1;
			set<int>s;
			vector<int>quer;
			for(int j = md;j < i;j++){
				s.insert(a[j]);
				quer.push_back(j);
			}
			quer.push_back(i);
			cout<<(int)quer.size()<<' ';
			for(auto i : quer) cout<<i<<' ';
			cout<<endl;
			int jg; cin >> jg;
			if(jg > (int)s.size()) r = md - 1;
			else jog = a[md],l=md+1;
		}
		if(jog == -1) a[i] = ++now;
		else a[i] = jog;
	}
	cout<<"0 ";
	for(int i = 1;i <= n;i++) cout<<a[i]<<' ';
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 8 ms 208 KB Output is correct
2 Correct 10 ms 208 KB Output is correct
3 Correct 15 ms 208 KB Output is correct
4 Correct 12 ms 320 KB Output is correct
5 Correct 7 ms 208 KB Output is correct
6 Correct 8 ms 208 KB Output is correct
7 Correct 12 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 208 KB Output is correct
2 Correct 9 ms 320 KB Output is correct
3 Correct 7 ms 208 KB Output is correct
4 Correct 13 ms 316 KB Output is correct
5 Correct 10 ms 208 KB Output is correct
6 Correct 9 ms 208 KB Output is correct
7 Correct 10 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 208 KB Output is correct
2 Correct 7 ms 208 KB Output is correct
3 Correct 14 ms 316 KB Output is correct
4 Correct 17 ms 208 KB Output is correct
5 Correct 12 ms 320 KB Output is correct
6 Correct 10 ms 208 KB Output is correct
7 Correct 11 ms 320 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 208 KB Output is correct
2 Correct 8 ms 208 KB Output is correct
3 Correct 14 ms 308 KB Output is correct
4 Correct 16 ms 208 KB Output is correct
5 Correct 10 ms 208 KB Output is correct
6 Correct 12 ms 208 KB Output is correct
7 Correct 14 ms 316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 9 ms 208 KB Output is correct
2 Correct 13 ms 208 KB Output is correct
3 Correct 15 ms 304 KB Output is correct
4 Correct 14 ms 208 KB Output is correct
5 Correct 13 ms 208 KB Output is correct
6 Correct 13 ms 208 KB Output is correct
7 Correct 19 ms 324 KB Output is correct