# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
918511 | Aiperiii | Carnival (CEOI14_carnival) | C++14 | 6 ms | 848 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
#define int long long
#define ff first
#define ss second
#define pb push_back
#define all(x) x.begin(),x.end()
using namespace std;
signed main(){
ios_base::sync_with_stdio();
cin.tie(0);cout.tie(0);
int n;cin>>n;
vector <int> vis(n+1);
vector <int> uniq,v,p;
for(int i=1;i<=n;i++){
v.pb(i);
cout<<v.size()<<" ";
for(auto x : v)cout<<x<<" ";
cout<<endl;
int dt;cin>>dt;
if(p.size()==0 or dt>p.back()){
uniq.pb(i);
vis[i]=uniq.size();
}
p.pb(dt);
}
for(int i=1;i<=n;i++){
if(vis[i])continue;
int l=0,r=uniq.size();
while(l+1<r){
int md=(l+r)/2;
vector <int> v;
v.pb(i);
for(int j=md;j<uniq.size();j++){
v.pb(uniq[j]);
}
cout<<v.size()<<" ";
for(auto x : v)cout<<x<<" ";
cout<<endl;
int dt;cin>>dt;
if(dt==uniq.size()-md+1)r=md;
else l=md;
}
vis[i]=vis[uniq[l]];
}
for(int i=0;i<=n;i++)cout<<vis[i]<<" ";
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |