Submission #116774

# Submission time Handle Problem Language Result Execution time Memory
116774 2019-06-13T19:52:45 Z ioilolcom Carnival (CEOI14_carnival) C++14
0 / 100
13 ms 384 KB
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int ll;
const int N=125;
int P[N],ans[N];
int cnt=0;
int query(int e,int a){
	if(a<=e) {
		cout<<e<<" ";
		for(int i=1; i<=e; i++) {
			cout<<i<<" ";
		}
		cout<<endl;
		fflush(stdout);
	}
	else{
		cout<<e+1<<" ";
		for(int i=1; i<=e; i++) {
			cout<<i<<" ";
		}
		cout<<a<<endl;
		fflush(stdout);
	}
	int cur;
	cin>>cur;
	return cur;
}
int main()
{
	int n; cin>>n;
	for(int i=1; i<=n; i++) {
		P[i]=query(i,0);
	}
	int nxt = 1;
	for (int i = 1; i <= n; i++) {
		int lo = 1, hi = i, mid;
		while (lo < hi) {
			mid = (lo + hi) / 2;
			if (P[mid] == query(mid, i)) hi = mid;
			else lo = mid + 1;
		}
		if (i == lo) ans[i] = nxt++;
		else ans[i] = ans[lo];
	}
	cout<<0<<" ";
	for(int i=1; i<=n; i++) {
		cout<<ans[i]<<" ";
	}
	cout<<endl;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 384 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 384 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 8 ms 384 KB Output is correct
2 Incorrect 7 ms 256 KB Incorrect
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 256 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 256 KB Incorrect
2 Halted 0 ms 0 KB -