#include<bits/stdc++.h>
using namespace std;
const int maxn=1000;
int n,all[maxn],res[maxn],now;
int main(){
// ios::sync_with_stdio(0);
// cin.tie(0);
// cout.tie(0);
res[1]=1;
now=2;
cin>>n;
for(int i=2;i<=n;i++){
int low=0,high=i,mid;
while(high-low>1){
mid=(high+low)>>1;
cout<<i-mid+1<<" ";
for(int j=mid;j<=i;j++){
cout<<j<<" ";
}
cout<<endl;
int x;
cin>>x;
cout<<i-mid<<" ";
for(int j=mid;j<i;j++){
cout<<j<<" ";
}
cout<<endl;
int xx;
cin>>xx;
if(x==xx){
low=mid;
}else{
high=mid;
}
}
if(low==0){
res[i]=now;
now++;
}else{
res[i]=res[low];
}
}
cout<<0<<" ";
for(int i=1;i<=n;i++){
cout<<res[i]<<" ";
}
cout<<endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
344 KB |
Output is correct |
2 |
Correct |
9 ms |
344 KB |
Output is correct |
3 |
Correct |
12 ms |
344 KB |
Output is correct |
4 |
Correct |
11 ms |
344 KB |
Output is correct |
5 |
Correct |
7 ms |
344 KB |
Output is correct |
6 |
Correct |
12 ms |
344 KB |
Output is correct |
7 |
Correct |
10 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
344 KB |
Output is correct |
2 |
Correct |
10 ms |
344 KB |
Output is correct |
3 |
Correct |
10 ms |
344 KB |
Output is correct |
4 |
Correct |
13 ms |
344 KB |
Output is correct |
5 |
Correct |
9 ms |
344 KB |
Output is correct |
6 |
Correct |
11 ms |
344 KB |
Output is correct |
7 |
Correct |
9 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
6 ms |
344 KB |
Output is correct |
2 |
Correct |
12 ms |
344 KB |
Output is correct |
3 |
Correct |
11 ms |
344 KB |
Output is correct |
4 |
Correct |
12 ms |
344 KB |
Output is correct |
5 |
Correct |
10 ms |
344 KB |
Output is correct |
6 |
Correct |
10 ms |
344 KB |
Output is correct |
7 |
Correct |
10 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
344 KB |
Output is correct |
2 |
Correct |
9 ms |
344 KB |
Output is correct |
3 |
Correct |
14 ms |
344 KB |
Output is correct |
4 |
Correct |
13 ms |
344 KB |
Output is correct |
5 |
Correct |
9 ms |
344 KB |
Output is correct |
6 |
Correct |
11 ms |
344 KB |
Output is correct |
7 |
Correct |
13 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
14 ms |
344 KB |
Output is correct |
2 |
Correct |
9 ms |
344 KB |
Output is correct |
3 |
Correct |
17 ms |
344 KB |
Output is correct |
4 |
Correct |
15 ms |
344 KB |
Output is correct |
5 |
Correct |
13 ms |
344 KB |
Output is correct |
6 |
Correct |
11 ms |
344 KB |
Output is correct |
7 |
Correct |
12 ms |
344 KB |
Output is correct |