답안 #596444

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
596444 2022-07-14T18:43:41 Z daisy2 사육제 (CEOI14_carnival) C++14
0 / 100
1 ms 208 KB
#include<iostream>
using namespace std;
int n,m[300],num=0,a,l,r,mid,re[300];
int main()
{
   cin>>n;

   m[1]=1;num=1;re[1]=1;

   for(int i=2;i<=n;i++)
   {
       cout<<num+1<<" ";
       for(int j=1;j<=num;j++)
        cout<<m[j]<<" ";cout<<endl;

       cin>>a;
       if(a==num+1)
       {
           num++;m[num]=i;re[i]=num;
           continue;
       }

       l=1;r=num;
       while(l<=r)
       {
           mid=(l+r)/2;

           cout<<mid+1<<" "<<i<<" ";
           for(int j=1;j<=mid;j++)
             cout<<m[j]<<" ";cout<<endl;

            cin>>a;

            if(a==mid+1) l=mid+1;
            else r=mid-1;
       }
       re[i]=l;
   }
   cout<<0<<" ";

   for(int i=1;i<=n;i++)
    cout<<re[i]<<" ";
   cout<<endl;

}

Compilation message

carnival.cpp: In function 'int main()':
carnival.cpp:13:8: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   13 |        for(int j=1;j<=num;j++)
      |        ^~~
carnival.cpp:14:25: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   14 |         cout<<m[j]<<" ";cout<<endl;
      |                         ^~~~
carnival.cpp:29:12: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
   29 |            for(int j=1;j<=mid;j++)
      |            ^~~
carnival.cpp:30:30: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
   30 |              cout<<m[j]<<" ";cout<<endl;
      |                              ^~~~
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 0 ms 208 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1 ms 208 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 0 ms 208 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 0 ms 208 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1 ms 208 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -