Submission #119255

# Submission time Handle Problem Language Result Execution time Memory
119255 2019-06-20T18:48:02 Z medk Carnival (CEOI14_carnival) C++14
100 / 100
15 ms 504 KB
#include <bits/stdc++.h>

using namespace std;

int main()
{
    int n; cin>>n;
    set<int> st;
    vector<int> cst(151,1), pre(151,1);
    for(int i=2;i<=n;i++)
    {
        cout<<i<<" ";
        for(int j=1;j<=i;j++) cout<<j<<" ";
        cout<<endl;
        cin>>pre[i];
        if(pre[i]>pre[i-1]) cst[i]=pre[i];
        else
        {
            int l=1, r=i-1;
            while(l<r)
            {
                int mid=(l+r)/2;
                st.clear();
                cout<<mid-l+2<<" ";
                for(int j=l;j<=mid;j++)
                {
                    cout<<j<<" ";
                    st.insert(cst[j]);
                }
                cout<<i<<" "<<endl;
                int get; cin>>get;
                if(get==int(st.size()))
                    r=mid;
                else
                    l=mid+1;
            }
            cst[i]=cst[l];
        }
    }
    cout<<0<<" ";
    for(int i=1;i<=n;i++) cout<<cst[i]<<" ";
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 14 ms 384 KB Output is correct
2 Correct 12 ms 384 KB Output is correct
3 Correct 7 ms 384 KB Output is correct
4 Correct 3 ms 316 KB Output is correct
5 Correct 10 ms 384 KB Output is correct
6 Correct 6 ms 256 KB Output is correct
7 Correct 8 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 11 ms 384 KB Output is correct
2 Correct 6 ms 328 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 13 ms 384 KB Output is correct
6 Correct 10 ms 384 KB Output is correct
7 Correct 14 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 14 ms 384 KB Output is correct
2 Correct 10 ms 256 KB Output is correct
3 Correct 8 ms 256 KB Output is correct
4 Correct 4 ms 256 KB Output is correct
5 Correct 15 ms 432 KB Output is correct
6 Correct 12 ms 504 KB Output is correct
7 Correct 11 ms 256 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 256 KB Output is correct
2 Correct 7 ms 256 KB Output is correct
3 Correct 4 ms 320 KB Output is correct
4 Correct 3 ms 256 KB Output is correct
5 Correct 10 ms 256 KB Output is correct
6 Correct 5 ms 388 KB Output is correct
7 Correct 11 ms 384 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 256 KB Output is correct
2 Correct 9 ms 252 KB Output is correct
3 Correct 8 ms 256 KB Output is correct
4 Correct 9 ms 384 KB Output is correct
5 Correct 9 ms 384 KB Output is correct
6 Correct 4 ms 328 KB Output is correct
7 Correct 4 ms 384 KB Output is correct