#include <bits/stdc++.h>
using namespace std;
const int mxn=155;
int n,comp[mxn],sz,cnt;
bool a[mxn];
int main(){
cin>>n;
for(int i=1;i<=n;i++){
a[i]=1;
sz++;
cout<<sz<<endl;
for(int j=1;j<=i;j++){
if(a[j])cout<<j<<endl;
}
int x;
cin>>x;
if(x==sz){
comp[i]=++cnt;
continue;
}
int L=1,R=sz;
while(R-L>1){
int mid=(L+R)/2,sum=0;
cout<<mid-L+1<<endl;
for(int j=1;j<=i;j++){
sum+=a[j];
if(a[j] && sum>=L && sum<mid)cout<<j<<endl;
}
cout<<i<<endl;
cin>>x;
if(x==mid-L+1)
L=mid;
else
R=mid;
}
comp[i]=comp[L];
a[i]=0;
sz--;
}
for(int i=1;i<=n;i++)
cout<<comp[i]<<endl;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
3 ms |
344 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
344 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Unexpected end of file - int32 expected |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
4 ms |
344 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
344 KB |
Same person came twice to the party. |
2 |
Halted |
0 ms |
0 KB |
- |