답안 #944656

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
944656 2024-03-13T02:43:01 Z rocketsri 사육제 (CEOI14_carnival) C++17
100 / 100
4 ms 348 KB
#include <bits/stdc++.h>
using namespace std;
const int mxn=155;
int n,comp[mxn],sz,cnt;
bool a[mxn];
int main(){
	cin>>n;
	for(int i=1;i<=n;i++){
		a[i]=1;
		sz++;
		cout<<sz<<" ";
		for(int j=1;j<=i;j++){
			if(a[j])cout<<j<<" ";
		}
		cout<<endl;
		int x;
		cin>>x;
		if(x==sz){
			comp[i]=++cnt;
			continue;
		}
		int L=1,R=sz;
		while(R-L>1){
			int mid=(L+R)/2,sum=0;
			cout<<mid-L+1<<" ";
			for(int j=1;j<i;j++){
				sum+=a[j];
				if(a[j] && sum>=L && sum<mid)cout<<j<<" ";
			}
			cout<<i<<endl;
			cin>>x;
			if(x==mid-L+1)
				L=mid;
			else
				R=mid;
		}
		for(int j=1;j<i;j++){
			L-=a[j];
			if(a[j] && L==0)comp[i]=comp[j];
		}
		a[i]=0;
		sz--;
	}
	cout<<0<<" ";
	for(int i=1;i<=n;i++)
		cout<<comp[i]<<" ";
	cout<<endl;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 3 ms 344 KB Output is correct
3 Correct 2 ms 344 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
5 Correct 1 ms 344 KB Output is correct
6 Correct 2 ms 344 KB Output is correct
7 Correct 3 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 3 ms 344 KB Output is correct
3 Correct 3 ms 344 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 2 ms 344 KB Output is correct
6 Correct 3 ms 344 KB Output is correct
7 Correct 4 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 3 ms 344 KB Output is correct
3 Correct 4 ms 344 KB Output is correct
4 Correct 3 ms 344 KB Output is correct
5 Correct 2 ms 344 KB Output is correct
6 Correct 2 ms 344 KB Output is correct
7 Correct 3 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 344 KB Output is correct
2 Correct 2 ms 344 KB Output is correct
3 Correct 2 ms 344 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 3 ms 344 KB Output is correct
6 Correct 4 ms 344 KB Output is correct
7 Correct 4 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 3 ms 344 KB Output is correct
3 Correct 4 ms 348 KB Output is correct
4 Correct 3 ms 344 KB Output is correct
5 Correct 3 ms 344 KB Output is correct
6 Correct 2 ms 344 KB Output is correct
7 Correct 2 ms 344 KB Output is correct