# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
119009 | HungAnhGoldIBO2020 | Carnival (CEOI14_carnival) | C++14 | 22 ms | 384 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
using namespace std;
set<int> lis;
set<int> cac1;
vector<int> fuck;
int ans[152];
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
srand(time(0));
int n,i,j,k,l,now,now1,ohyeah=0;
cin>>n;
cout<<n<<" ";
for(i=1;i<=n;i++){
cout<<i<<" ";
lis.insert(i);
}
cout<<endl;
cin>>now;
while(lis.size()&&now!=1){
k=0;
while(k<=1000){
j=(rand()*rand())%n+1;
if(lis.count(j)){
lis.erase(lis.find(j));
cout<<lis.size()<<" ";
for(auto ite=lis.begin();ite!=lis.end();ite++){
cout<<*ite<<" ";
}
cout<<endl;
cin>>now1;
if(now!=now1){
ohyeah++;
ans[j]=ohyeah;
for(auto ite=cac1.begin();ite!=cac1.end();ite++){
cout<<"2 "<<j<<" "<<*ite<<endl;
cin>>l;
if(l==1){
ans[*ite]=ohyeah;
fuck.push_back(*ite);
}
}
for(i=0;i<fuck.size();i++){
cac1.erase(fuck[i]);
}
fuck.clear();
}
else{
cac1.insert(j);
}
now=now1;
break;
}
k++;
if(k==1001){
auto ite=lis.begin();
j=*ite;
lis.erase(lis.find(j));
cout<<lis.size()<<" ";
for(auto ite=lis.begin();ite!=lis.end();ite++){
cout<<*ite<<" ";
}
cout<<endl;
cin>>now1;
if(now!=now1){
ohyeah++;
ans[j]=ohyeah;
for(auto ite=cac1.begin();ite!=cac1.end();ite++){
cout<<"2 "<<j<<" "<<*ite<<endl;
cin>>l;
if(l==1){
ans[*ite]=ohyeah;
fuck.push_back(*ite);
}
}
for(i=0;i<fuck.size();i++){
cac1.erase(fuck[i]);
}
fuck.clear();
}
else{
cac1.insert(j);
}
now=now1;
}
}
}
ohyeah++;
cout<<"0 ";
for(i=1;i<=n;i++){
if(!ans[i]){
cout<<ohyeah<<" ";
}
else{
cout<<ans[i]<<" ";
}
}
cout<<endl;
return 0;
}
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... |