Submission #1014389

# Submission time Handle Problem Language Result Execution time Memory
1014389 2024-07-04T19:55:40 Z vjudge1 Carnival (CEOI14_carnival) C++17
100 / 100
9 ms 604 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define fir first 
#define sec second 

int main(){
    int n;
    vector<ll>v;
    cin >> n;
    vector<ll>ans(n+1);
    map<vector<ll>, ll>m;
    ll max_ = 0;
    for(int i = 1; i <=n; i++) {
        v.pb(i);  
        int val = 0;
        if(!m[v]){
            cout << v.size() << " ";
            for(int i : v) cout << i << " ";
            cout << endl;
            cin >> val;
            m[v]=val;
        }
        else{
            val = m[v];
        }
        if(val<=max_){
            v.pop_back();
            ll a=0;
            ll l = 0, r = v.size()-1;
            while(l < r){
                
                ll mid = (l+r)/2;
                cout << mid +1 << " ";
                for(int j = 0; j <=mid; j++){
                    cout << v[j] << " ";
                }
                cout << endl;
                cin >> a;
                cout << mid + 2 << " ";
                for(int j= 0; j<=mid; j++){
                    cout << v[j] << " ";
                }
                cout <<i << endl;
                
                ll b =0;
                cin >>b;
                if(a==b) r= mid;
                else l = mid+1;
            }
            ans[i] = ans[v[l]];
        }
        else{
            max_ = val;
            ans[i]=max_;
        }
    }
    cout << 0 << " ";
    for(int i = 1; i <=n; i++){
        cout << ans[i] << " ";
    }
    cout << endl;
    
    
    
}
# Verdict Execution time Memory Grader output
1 Correct 8 ms 344 KB Output is correct
2 Correct 8 ms 468 KB Output is correct
3 Correct 4 ms 344 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 4 ms 444 KB Output is correct
6 Correct 2 ms 420 KB Output is correct
7 Correct 5 ms 456 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 344 KB Output is correct
2 Correct 7 ms 460 KB Output is correct
3 Correct 4 ms 600 KB Output is correct
4 Correct 3 ms 344 KB Output is correct
5 Correct 5 ms 436 KB Output is correct
6 Correct 5 ms 344 KB Output is correct
7 Correct 5 ms 440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 4 ms 344 KB Output is correct
3 Correct 7 ms 344 KB Output is correct
4 Correct 3 ms 344 KB Output is correct
5 Correct 6 ms 444 KB Output is correct
6 Correct 8 ms 348 KB Output is correct
7 Correct 7 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 600 KB Output is correct
2 Correct 5 ms 344 KB Output is correct
3 Correct 4 ms 344 KB Output is correct
4 Correct 3 ms 344 KB Output is correct
5 Correct 8 ms 600 KB Output is correct
6 Correct 4 ms 344 KB Output is correct
7 Correct 6 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 600 KB Output is correct
2 Correct 6 ms 344 KB Output is correct
3 Correct 9 ms 344 KB Output is correct
4 Correct 5 ms 456 KB Output is correct
5 Correct 4 ms 344 KB Output is correct
6 Correct 3 ms 344 KB Output is correct
7 Correct 3 ms 344 KB Output is correct