Submission #300869

# Submission time Handle Problem Language Result Execution time Memory
300869 2020-09-17T14:39:51 Z JovanK26 Carnival (CEOI14_carnival) C++14
0 / 100
1 ms 384 KB
#include <bits/stdc++.h>

using namespace std;
int n;
int ind[151];
int color[151];
int query(int m,int x)
{
    cout << m+1 <<' ';
    for(int i=1;i<=m;i++)
    {
        cout << ind[i] <<' ';
    }
    cout << x << endl;
    int rez;
    cin >> rez;
    return rez;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    int colors=1;
    for(int i=1;i<=n;i++)
    {
        if(query(colors,i)==colors+1)
        {
            ind[colors]=i;
            color[i]=colors;
            colors++;
        }
        else
        {
            int l=1;
            int r=colors;
            int m;
            while(l<r)
            {
                m=(l+r)/2;
                if(query(m,i)==m+1)
                {
                    l=m+1;
                }
                else
                {
                    r=m;
                }
            }
            color[i]=l;
        }
    }
    cout << 0;
    for(int i=1;i<=n;i++)
    {
        cout << ' ' <<color[i];
    }
    cout << endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Integer 0 violates the range [1, 137]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Integer 0 violates the range [1, 145]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 384 KB Integer 0 violates the range [1, 133]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 288 KB Integer 0 violates the range [1, 143]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 384 KB Integer 0 violates the range [1, 149]
2 Halted 0 ms 0 KB -