Submission #596440

#TimeUsernameProblemLanguageResultExecution timeMemory
596440SummersCarnival (CEOI14_carnival)C++14
0 / 100
1 ms208 KiB
#include<bits/stdc++.h> #pragma GCC optimize ("O3") #define endl '\n' using namespace std; long long a[10000], r[1000]; int main() { //ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long i,j,n,le,ri,mid,num=1,ans; cin>>n; a[1]=1;r[1]=1; for(i=2;i<=n;i++) { cout<<num+1; for(j=1;j<=num;j++)cout<<" "<<a[j]; cout<<" "<<i<<endl; cin>>ans; if(ans>num){num++;a[num]=i;r[i]=num;continue;} le=1; ri=num; while(le<=ri) { mid=(le+ri)/2; cout<<mid-le+2; for(j=le;j<=mid;j++)cout<<" "<<a[j]; cout<<" "<<i; cout<<endl; cin>>ans; if(ans==(mid-le+1))ri=mid-1; else le=mid+1; } r[i]=le; } cout<<0; for(i=1;i<=n;i++)cout<<" "<<r[i];cout<<endl; }

Compilation message (stderr)

carnival.cpp: In function 'int main()':
carnival.cpp:41:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   41 |     for(i=1;i<=n;i++)cout<<" "<<r[i];cout<<endl;
      |     ^~~
carnival.cpp:41:38: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   41 |     for(i=1;i<=n;i++)cout<<" "<<r[i];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...