Submission #918439

# Submission time Handle Problem Language Result Execution time Memory
918439 2024-01-29T20:33:37 Z ayankarimova Carnival (CEOI14_carnival) C++14
0 / 100
3 ms 1232 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll sz=200;
ll ans[sz];
map<vector<ll>, ll>mp;
ll query(vector<ll>c)
{
    if(mp[c]) return mp[c];
    cout<<c.size()<<endl;
    for(auto i:c){
        cout<<i<<' ';
    }
    cout<<endl;
    ll cur;
    cin>>cur;
    mp[c]=cur;
    return cur;
}
int main(){

    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    ll n;
    cin>>n;
    ll cur=0;
    vector<ll>v;
    for(int i=1; i<=n; i++){
        v.push_back(i);
        ll res=query(v);
        if(res>cur){
            cur=res;
            ans[i]=cur;
        }
        else{
            v.pop_back();
            ll l=0, r=v.size()-1;
            while(l<r){
                vector<ll>g;
                ll mid=(l+r)/2;
                for(int i=0; i<=mid; i++){
                    g.push_back(v[i]);
                }
                ll x=query(g);
                g.push_back(i);
                ll y=query(g);
                if(y>x){
                    l=mid+1;
                }
                else{
                    r=mid;
                }
            }
            ans[i]=ans[v[l]];
        }
    }
    for(int i=1; i<=n; i++){
        cout<<ans[i]<<' ';
    }
}
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 716 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 712 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 456 KB Unexpected end of file - int32 expected
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 1232 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 456 KB Same person came twice to the party.
2 Halted 0 ms 0 KB -