Submission #1009868

#TimeUsernameProblemLanguageResultExecution timeMemory
1009868giorgi_pkhaladzeCarnival (CEOI14_carnival)C++17
0 / 100
14 ms344 KiB
#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=1; a[1]=x; 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 (stderr)

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;
      |                                      ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...