#include<bits/stdc++.h>
using namespace std;
int ans[155];
int col[155];
int cnt;
signed main() {
int n;
cin>>n;
ans[1]=1;
cnt=1;
col[1]=1;
for(int i=2 ; i<=n ; i++) {
int l=1;
int r=i-1;
cout<<i<<" ";
for(int j=1 ; j<=i ; j++) cout<<j<<" ";
cout<<endl;
int x;
cin>>x;
if(x==cnt+1) {
cnt++;
ans[i]=cnt;
col[i]=col[i-1]+1;
}
else {
col[i]=col[i-1];
while(l<r) {
int mid=(l+r)/2;
cout<<mid+1<<" ";
for(int j=1 ; j<=mid ; j++) {
cout<<j<<" ";
}
cout<<i<<endl;
int x;
cin>>x;
if(x==col[mid]) {
r=mid;
}
else l=mid+1;
}
ans[i]=ans[l];
}
}
cout<<0<<" ";
for(int i=1 ; i<=n ; i++) cout<<ans[i]<<" ";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
14 ms |
384 KB |
Output is correct |
2 |
Correct |
17 ms |
256 KB |
Output is correct |
3 |
Correct |
10 ms |
256 KB |
Output is correct |
4 |
Correct |
8 ms |
384 KB |
Output is correct |
5 |
Correct |
15 ms |
256 KB |
Output is correct |
6 |
Correct |
15 ms |
384 KB |
Output is correct |
7 |
Correct |
16 ms |
384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
15 ms |
384 KB |
Output is correct |
2 |
Correct |
16 ms |
256 KB |
Output is correct |
3 |
Correct |
8 ms |
384 KB |
Output is correct |
4 |
Correct |
8 ms |
256 KB |
Output is correct |
5 |
Correct |
18 ms |
256 KB |
Output is correct |
6 |
Correct |
19 ms |
256 KB |
Output is correct |
7 |
Correct |
16 ms |
384 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
17 ms |
384 KB |
Output is correct |
2 |
Correct |
15 ms |
256 KB |
Output is correct |
3 |
Correct |
14 ms |
384 KB |
Output is correct |
4 |
Correct |
8 ms |
256 KB |
Output is correct |
5 |
Correct |
13 ms |
256 KB |
Output is correct |
6 |
Correct |
17 ms |
256 KB |
Output is correct |
7 |
Correct |
17 ms |
256 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
18 ms |
256 KB |
Output is correct |
2 |
Correct |
17 ms |
384 KB |
Output is correct |
3 |
Correct |
10 ms |
384 KB |
Output is correct |
4 |
Correct |
9 ms |
384 KB |
Output is correct |
5 |
Correct |
13 ms |
384 KB |
Output is correct |
6 |
Correct |
11 ms |
384 KB |
Output is correct |
7 |
Correct |
17 ms |
432 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
20 ms |
256 KB |
Output is correct |
2 |
Correct |
19 ms |
256 KB |
Output is correct |
3 |
Correct |
12 ms |
384 KB |
Output is correct |
4 |
Correct |
11 ms |
256 KB |
Output is correct |
5 |
Correct |
11 ms |
256 KB |
Output is correct |
6 |
Correct |
9 ms |
256 KB |
Output is correct |
7 |
Correct |
8 ms |
384 KB |
Output is correct |