Submission #99263

# Submission time Handle Problem Language Result Execution time Memory
99263 2019-03-02T03:27:45 Z duy_tran Carnival (CEOI14_carnival) C++14
0 / 100
7 ms 384 KB
#include<bits/stdc++.h>
using namespace std;

const int maxn=(int)200;
int n,chk[maxn];
vector<int> a;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);

    cin>>n;

    for(int i=1;i<=n;++i)
    {
        int cnt=0;
        a.clear();
        a.push_back(0);
        for(int j=1;j<=n;++j)
        {
            if(!chk[j])
            {
                a.push_back(j);
                ++cnt;
            }
        }

        cout<<cnt<<" ";
        for(int j:a)cout<<j<<" ";
        cout<<endl;
        fflush(stdout);

        int c;
        cin>>c;

        if(c==1)
        {
            for(int j:a)chk[j]=c;

            cout<<0<<" ";
            for(int j=1;j<=n;++j)cout<<chk[j]<<" ";
            cout<<endl;
            fflush(stdout);


            exit(0);
        }

        else
        {
            int l=1;int r=a.size()-1;
            int mid;

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

                int nc;
                cout<<mid<<" ";
                for(int j=1;j<=mid;++j)cout<<a[j]<<" ";
                cout<<endl;
                fflush(stdout);

                cin>>nc;

                if(nc<c-1)l=mid+1;
                else r=mid-1;
            }

            chk[a[l]]=c;
        }
    }


}
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 384 KB Integer 0 violates the range [1, 137]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 256 KB Integer 0 violates the range [1, 145]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 384 KB Integer 0 violates the range [1, 133]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 384 KB Integer 0 violates the range [1, 143]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 7 ms 384 KB Integer 0 violates the range [1, 149]
2 Halted 0 ms 0 KB -