#include <bits/stdc++.h>
using namespace std;
int pai[155];
int cor[155];
void tenta(int i,int l,int r){
if(l==r){
if(l==i)return;
cout<<2<<" "<<i<<" "<<l<<endl;
int x;
cin>>x;
if(x==1)cor[l] = cor[i];
}else{
int m = (l+r)/2;
if(l!=m){
cout<<m-l+1;
for(int i=l;i<=m;i++)cout<<" "<<i;
cout<<endl;
int x;
cin>>x;
cout<<m-l+2<<" "<<i;
for(int i=l;i<=m;i++)cout<<" "<<i;
cout<<endl;
int y;
cin>>y;
if(x==y){
// cout<<l<<" "<<r<<"-> "<<l<<" "<<m<<endl;
tenta(i,l,m);
}
}else tenta(i,l,l);
if(r!=m+1){
cout<<r-(m+1) + 1;
for(int i=m+1;i<=r;i++)cout<<" "<<i;
cout<<endl;
int x;
cin>>x;
cout<<r-(m+1) + 1 <<" "<<i;
for(int i=m+1;i<=r;i++)cout<<" "<<i;
cout<<endl;
int y;
cin>>y;
if(x==y){
// cout<<l<<" "<<r<<"-> "<<m+1<<" "<<r<<endl;
tenta(i,m+1,r);
}
}else tenta(i,r,r);
}
}
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
int n;
cin>>n;
/*cout<<n;
for(int i=1;i<=n;i++)cout<<" "<<i;
cout<<endl;
int C;
cin>>C;
int comp = n;*/
for(int i=1;i<=n;i++)cor[i] = -1;
int cur=1;
for(int i=1;i<n;i++){
if(cor[i]!=-1)continue;
cor[i] = cur;
//cout<<i<<" "<<i+1<<" "<<n<<endl;
tenta(i,i+1,n);
cur++;
}
for(int i=1;i<=n;i++){
if(cor[i]==-1){
cor[i]=cur;
cur++;
}
}
cout<<0;
for(int i=1;i<=n;i++)cout<<" "<<cor[i];
cout<<endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2 ms |
248 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2 ms |
376 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2 ms |
248 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2 ms |
376 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
2 ms |
248 KB |
Time limit exceeded (wall clock) |
2 |
Halted |
0 ms |
0 KB |
- |