#include <bits/stdc++.h>
using namespace std;
/// 15:08
const int Nmax = 155;
int n, i, x, C=0, a[Nmax], cnt[Nmax];
int bs(int id)
{
int st, dr, mid, x, j;
st = 1, dr = id-1;
while(st <= dr)
{
mid = (st+dr)/2;
cout << mid+1 << ' ';
for(j=1; j<=mid; ++j) cout << j << ' ';
cout << id << '\n';
fflush(stdout);
cin >> x;
if(x != cnt[mid]) st = mid+1;
else dr = mid-1;
}
return a[st];
}
int main()
{
cin >> n;
for(i=1; i<=n; ++i)
{
x = bs(i);
if(x) a[i] = x;
else a[i] = ++C;
cnt[i] = C;
}
cout << 0;
for(i=1; i<=n; ++i) cout << ' ' << a[i];
cout << '\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
376 KB |
Output is correct |
2 |
Correct |
12 ms |
376 KB |
Output is correct |
3 |
Correct |
11 ms |
388 KB |
Output is correct |
4 |
Correct |
9 ms |
428 KB |
Output is correct |
5 |
Correct |
8 ms |
572 KB |
Output is correct |
6 |
Correct |
7 ms |
572 KB |
Output is correct |
7 |
Correct |
10 ms |
572 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
572 KB |
Output is correct |
2 |
Correct |
7 ms |
572 KB |
Output is correct |
3 |
Correct |
9 ms |
572 KB |
Output is correct |
4 |
Correct |
12 ms |
572 KB |
Output is correct |
5 |
Correct |
8 ms |
572 KB |
Output is correct |
6 |
Correct |
6 ms |
572 KB |
Output is correct |
7 |
Correct |
9 ms |
572 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
572 KB |
Output is correct |
2 |
Correct |
6 ms |
572 KB |
Output is correct |
3 |
Correct |
11 ms |
572 KB |
Output is correct |
4 |
Correct |
10 ms |
572 KB |
Output is correct |
5 |
Correct |
9 ms |
572 KB |
Output is correct |
6 |
Correct |
13 ms |
572 KB |
Output is correct |
7 |
Correct |
10 ms |
572 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
8 ms |
572 KB |
Output is correct |
2 |
Correct |
9 ms |
572 KB |
Output is correct |
3 |
Correct |
15 ms |
572 KB |
Output is correct |
4 |
Correct |
14 ms |
572 KB |
Output is correct |
5 |
Correct |
10 ms |
572 KB |
Output is correct |
6 |
Correct |
11 ms |
572 KB |
Output is correct |
7 |
Correct |
12 ms |
572 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
10 ms |
572 KB |
Output is correct |
2 |
Correct |
7 ms |
572 KB |
Output is correct |
3 |
Correct |
20 ms |
572 KB |
Output is correct |
4 |
Correct |
14 ms |
572 KB |
Output is correct |
5 |
Correct |
14 ms |
572 KB |
Output is correct |
6 |
Correct |
12 ms |
572 KB |
Output is correct |
7 |
Correct |
20 ms |
572 KB |
Output is correct |