답안 #743388

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
743388 2023-05-17T11:04:36 Z NintsiChkhaidze 사육제 (CEOI14_carnival) C++17
0 / 100
4 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 + 1<<" ";
			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;
}
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2 ms 208 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2 ms 208 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 208 KB Output is correct
2 Execution timed out 4 ms 208 KB Time limit exceeded (wall clock)
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 2 ms 208 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 208 KB Output is correct
2 Execution timed out 2 ms 208 KB Time limit exceeded (wall clock)
3 Halted 0 ms 0 KB -