#include <iostream>
using namespace std;
const int N = 150;
int v[N];
int ans[N];
int main()
{
int n, m = 1, i, j;
cin >> n;
v[1] = 1;
ans[1] = 1;
for (i = 2; i <= n; i++)
{
cout << m + 1 << " " << i;
for (j = 1; j <= m; j++)
cout << " " << v[j];
cout << endl;
int k;
cin >> k;
if (k == m + 1)
{
v[++m] = i;
ans[i] = m;
continue;
}
int st = 1, dr = m;
while (st < dr)
{
int mid = (st + dr) / 2;
int l = mid - st + 1;
cout << l + 1;
for (j = st; j <= mid; j++)
cout << " " << v[j];
cout << " " << i;
cout << endl;
cin >> k;
if (k == l)
dr = mid;
else
st = mid + 1;
}
ans[i] = st;
}
cout << 0;
for (i = 1; i <= n; i++)
cout << " " << ans[i];
cout << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
284 KB |
Output is correct |
2 |
Correct |
4 ms |
200 KB |
Output is correct |
3 |
Correct |
6 ms |
200 KB |
Output is correct |
4 |
Correct |
4 ms |
200 KB |
Output is correct |
5 |
Correct |
5 ms |
200 KB |
Output is correct |
6 |
Correct |
5 ms |
200 KB |
Output is correct |
7 |
Correct |
9 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
200 KB |
Output is correct |
2 |
Correct |
8 ms |
200 KB |
Output is correct |
3 |
Correct |
5 ms |
200 KB |
Output is correct |
4 |
Correct |
5 ms |
200 KB |
Output is correct |
5 |
Correct |
6 ms |
200 KB |
Output is correct |
6 |
Correct |
8 ms |
200 KB |
Output is correct |
7 |
Correct |
6 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
216 KB |
Output is correct |
2 |
Correct |
7 ms |
200 KB |
Output is correct |
3 |
Correct |
7 ms |
200 KB |
Output is correct |
4 |
Correct |
4 ms |
200 KB |
Output is correct |
5 |
Correct |
9 ms |
200 KB |
Output is correct |
6 |
Correct |
9 ms |
200 KB |
Output is correct |
7 |
Correct |
11 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
200 KB |
Output is correct |
2 |
Correct |
8 ms |
200 KB |
Output is correct |
3 |
Correct |
6 ms |
200 KB |
Output is correct |
4 |
Correct |
4 ms |
200 KB |
Output is correct |
5 |
Correct |
11 ms |
200 KB |
Output is correct |
6 |
Correct |
6 ms |
200 KB |
Output is correct |
7 |
Correct |
10 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
200 KB |
Output is correct |
2 |
Correct |
7 ms |
200 KB |
Output is correct |
3 |
Correct |
8 ms |
200 KB |
Output is correct |
4 |
Correct |
8 ms |
200 KB |
Output is correct |
5 |
Correct |
6 ms |
256 KB |
Output is correct |
6 |
Correct |
9 ms |
200 KB |
Output is correct |
7 |
Correct |
5 ms |
200 KB |
Output is correct |