# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
978168 | AlphaMale06 | Carnival (CEOI14_carnival) | C++14 | 4 ms | 344 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>
using namespace std;
#define pb push_back
int main()
{
int n;
cin >> n;
vector<int> qry;
qry.pb(1);
int c[n+1];
c[1]=1;
for(int i=2; i<=n; i++){
qry.pb(i);
cout << qry.size();
for(int e : qry)cout << " " << e;
cout << endl;
int ans;
cin >> ans;
if(ans==qry.size()){
c[i]=qry.size();
}
else{
qry.pop_back();
int l=0, r = qry.size()-1;
while(l<r){
int s = l+r>>1;
cout << s-l+1;
for(int i=l; i<s; i++)cout << " " << qry[i];
cout << " " << i << endl;
int anss;
cin >> anss;
if(anss==s-l+1)r=s;
else l=s+1;
}
c[i]=c[qry[l]];
}
}
cout << 0;
for(int i=1; i<=n; i++)cout << " " << c[i];
cout << endl;
}
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... |