Submission #569086

# Submission time Handle Problem Language Result Execution time Memory
569086 2022-05-26T15:47:21 Z beaconmc Carnival (CEOI14_carnival) C++14
100 / 100
9 ms 428 KB
#include <bits/stdc++.h>

typedef long long ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(ll i=x; i>y; i--)

using namespace std;

int main(){
	ll n;
	cin >> n;
	ll c;

	cout<< n << " ";
	FOR(i,1,n+1) cout << i << " " ;
	cout << endl;
	cin >> c;

	vector<vector<ll>> tings(c);
	set<ll> sussy;


	ll prev = c;

	FORNEG(i,n-1,0){
		ll sus = 0;
		cout << i << " ";

		FOR(j,1,i+1){
			cout << j << " ";
		}
		cout << endl;
		cin >> sus;

		if (sus != prev){
			sussy.insert(i+1);
			tings[c-prev].push_back(i+1);

			prev = sus;
		}
	}
	tings[c-1].push_back(1);
	sussy.insert(1);




	FOR(i,1,n+1){
		if (sussy.count(i)) continue;

		ll lo = 0;
		ll hi = c-1;
		while (lo<hi){
			ll mid = (lo+hi)/2;
			cout << mid-lo+2 << " ";
			cout << i << " ";
			FOR(j,lo,mid+1){
				cout << tings[j][0] << " ";
			}
			cout << endl;
			ll idk;
			cin >> idk;


			if (idk < mid-lo+2){
				hi = mid;
			}else{
				lo = mid + 1;
			}

		}
		tings[lo].push_back(i);

	}

	vector<ll> ans(n);

	FOR(i,0,c){
		for (auto&j : tings[i]){
			ans[j-1] = i+1;
		}
	}


	cout << 0 << " ";

	for (auto&i : ans){
		cout << i << " ";
	}
	cout << endl;






}
# Verdict Execution time Memory Grader output
1 Correct 8 ms 296 KB Output is correct
2 Correct 7 ms 296 KB Output is correct
3 Correct 5 ms 300 KB Output is correct
4 Correct 3 ms 208 KB Output is correct
5 Correct 4 ms 208 KB Output is correct
6 Correct 4 ms 296 KB Output is correct
7 Correct 7 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 208 KB Output is correct
2 Correct 9 ms 304 KB Output is correct
3 Correct 4 ms 208 KB Output is correct
4 Correct 4 ms 208 KB Output is correct
5 Correct 9 ms 304 KB Output is correct
6 Correct 7 ms 428 KB Output is correct
7 Correct 8 ms 208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 300 KB Output is correct
2 Correct 6 ms 208 KB Output is correct
3 Correct 7 ms 300 KB Output is correct
4 Correct 4 ms 312 KB Output is correct
5 Correct 8 ms 304 KB Output is correct
6 Correct 6 ms 208 KB Output is correct
7 Correct 9 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 208 KB Output is correct
2 Correct 7 ms 272 KB Output is correct
3 Correct 6 ms 208 KB Output is correct
4 Correct 3 ms 300 KB Output is correct
5 Correct 7 ms 300 KB Output is correct
6 Correct 8 ms 300 KB Output is correct
7 Correct 7 ms 304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 208 KB Output is correct
2 Correct 9 ms 296 KB Output is correct
3 Correct 6 ms 308 KB Output is correct
4 Correct 7 ms 208 KB Output is correct
5 Correct 7 ms 300 KB Output is correct
6 Correct 8 ms 208 KB Output is correct
7 Correct 3 ms 312 KB Output is correct