Submission #743390

# Submission time Handle Problem Language Result Execution time Memory
743390 2023-05-17T11:06:58 Z NintsiChkhaidze Carnival (CEOI14_carnival) C++17
0 / 100
7 ms 208 KB
#include <bits/stdc++.h>
#define ll long long
#define s second
#define pb push_back
#define f first
using namespace std;
 
const int N = 155;

int a[N],c[N];
bool f[N];

signed main (){
    ios_base::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
    
    int n;
    cin>>n;
    
	int m = 1;
	a[1] = 1;
	f[1] = 1;
	
	for (int i = 2; i <= n; i++){
		cout<<m + 1<<" ";
		for (int j = 1; j <= m; j++)
			cout<<a[j]<<" ";
		cout<<i<<endl;
		
		int k;
		cin>>k;
		if (k == m + 1){
			++m;
			a[m] = i;
			f[i] = 1;
		}
	}    
	
	for (int i = 1; i <= m; i++)
		c[a[i]] = i;
	
	for (int i = 2; i <= n; i++){
		if (f[i]) continue;
		int res=0,l = 1,r = m;
		
		while (l <= r){
			int mid = (l + r)>>1;
			if (l == r){
				res=a[l];
				break;
			}
			cout<<mid - l + 2<<" ";
			for (int j = l; j <= mid; j++)
				cout<<a[j]<<" ";
			cout<<i<<endl;
			
			int k;
			cin>>k;
			if (k == mid + 1){
				l = mid + 1;
			}else{
				r = mid;
			}
		}
		
		c[i] = c[a[res]];
	}
	
	cout<<0<<" ";
	for (int i = 1; i <= n; i++)
		cout<<c[i]<<" ";
	cout<<endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 208 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 208 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 208 KB Output is correct
2 Incorrect 6 ms 208 KB Incorrect
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 208 KB Incorrect
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 208 KB Output is correct
2 Incorrect 7 ms 208 KB Incorrect
3 Halted 0 ms 0 KB -