Submission #995934

# Submission time Handle Problem Language Result Execution time Memory
995934 2024-06-10T04:38:07 Z vjudge1 Carnival (CEOI14_carnival) C++17
0 / 100
1 ms 344 KB
#include<bits/stdc++.h>
#define int long long
using namespace std;
int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n,tmp=0;
    cin>>n;
    vector<int> v(n+1),res(n+1,0);
    for(int i=1;i<=n;i++){
        cout<<i<<" ";
        for(int j=1;j<=i;j++) cout<<j<<" ";
        int x;
        cin>>x;
        if(x>tmp){
            tmp++;
            v[tmp]=i;
            res[i]=tmp;
        }
    }
    for(int i=1;i<=n;i++){
        if(res[i]==0){
            int l=1,r=tmp;
            while(l<r){
                int m=(l+r)/2;
                cout<<m+1<<" ";
                for(int j=1;j<=m;j++) cout<<v[j]<<" ";
                int x;cin>>x;
                if(x>m) r=m-1;
                else l=m;
            }
            res[i]=l;
        }
    }
    for(int i=1;i<=n;i++) cout<<res[i]<<" ";
}
# Verdict Execution time Memory Grader output
1 Execution timed out 1 ms 344 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1 ms 344 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1 ms 344 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 0 ms 344 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 0 ms 344 KB Time limit exceeded (wall clock)
2 Halted 0 ms 0 KB -