답안 #1009866

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1009866 2024-06-28T07:02:10 Z giorgi_pkhaladze 사육제 (CEOI14_carnival) C++14
0 / 100
18 ms 344 KB
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
using namespace std;
int n,m,k,j,ans,a[200001],d[200001];
int solve(int l, int r){
	cout<<r-l+1<<" ";
	for(int i=l; i<=r; i++)cout<<i<<" "; cout<<endl;
	int p; cin>>p;
	return p;
}
int main() {
	cin>>n;
	int x=0;
	for(k=2; k<=n; k++){
		if(solve(1,k)==solve(1,k-1)){
			int l=1; int r=k-1;
			ans=0;
			while(l<r){
				int md=(l+r+1)/2;
				if(solve(md,k)-1==solve(md,k-1))r=md-1;
				else l=md,ans=md;
			}
			a[k]=a[ans];
		}
		else a[k]=x,x++;
	}
	cout<<0<<" ";
	for(k=1; k<=n; k++)cout<<a[k]<<" "; cout<<endl;
}

Compilation message

carnival.cpp: In function 'int solve(int, int)':
carnival.cpp:9:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
    9 |  for(int i=l; i<=r; i++)cout<<i<<" "; cout<<endl;
      |  ^~~
carnival.cpp:9:39: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
    9 |  for(int i=l; i<=r; i++)cout<<i<<" "; cout<<endl;
      |                                       ^~~~
carnival.cpp: In function 'int main()':
carnival.cpp:30:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   30 |  for(k=1; k<=n; k++)cout<<a[k]<<" "; cout<<endl;
      |  ^~~
carnival.cpp:30:38: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   30 |  for(k=1; k<=n; k++)cout<<a[k]<<" "; cout<<endl;
      |                                      ^~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 344 KB Integer 0 violates the range [1, 11]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 14 ms 344 KB Integer 0 violates the range [1, 5]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 14 ms 344 KB Integer 0 violates the range [1, 1]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 18 ms 344 KB Integer 0 violates the range [1, 4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 12 ms 344 KB Integer 0 violates the range [1, 2]
2 Halted 0 ms 0 KB -