답안 #1009862

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1009862 2024-06-28T07:00:24 Z giorgi_pkhaladze 사육제 (CEOI14_carnival) C++17
0 / 100
4 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;
			ans=0;
			while(l<=r){
				int md=(l+r)/2;
				if(solve(md,k)-1==solve(md,k-1))r=md-1;
				else l=md+1,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 Execution timed out 4 ms 344 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1 ms 340 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1 ms 344 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1 ms 344 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1 ms 340 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -