#include <bits/stdc++.h>
using namespace std;
const int mxN = 157;
int ans[mxN];
vector<int> c[mxN];
int32_t main() {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n;
cin >> n;
int cur = 1;
ans[1] = cur;
c[cur].push_back(1);
for (int i = 2; i <= n; ++i) {
cout << cur + 1 << ' ';
for (int j = 1; j <= cur; ++j) {
cout << c[j].back() << ' ';
}
cout << i << endl;
int num;
cin >> num;
if (num == cur + 1) {
ans[i] = ++cur;
c[cur].push_back(i);
continue;
}
int l = 1, r = cur, res = 0;
while (l <= r) {
int mid = (l + r) / 2;
cout << mid + 1 << ' ';
for (int j = 1; j <= mid; ++j) {
cout << c[j].back() << ' ';
}
cout << i << endl;
cin >> num;
if (num == mid + 1) {
l = mid + 1;
}
else {
r = mid - 1;
res = mid;
}
}
ans[i] = res;
c[res].push_back(i);
}
cout << "0 ";
for (int i = 1; i <= n; ++i) {
cout << ans[i] << ' ';
}
cout << endl;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
200 KB |
Output is correct |
2 |
Correct |
7 ms |
212 KB |
Output is correct |
3 |
Correct |
5 ms |
200 KB |
Output is correct |
4 |
Correct |
3 ms |
200 KB |
Output is correct |
5 |
Correct |
4 ms |
200 KB |
Output is correct |
6 |
Correct |
3 ms |
200 KB |
Output is correct |
7 |
Correct |
6 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
200 KB |
Output is correct |
2 |
Correct |
9 ms |
316 KB |
Output is correct |
3 |
Correct |
4 ms |
200 KB |
Output is correct |
4 |
Correct |
3 ms |
200 KB |
Output is correct |
5 |
Correct |
6 ms |
200 KB |
Output is correct |
6 |
Correct |
5 ms |
308 KB |
Output is correct |
7 |
Correct |
6 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
200 KB |
Output is correct |
2 |
Correct |
7 ms |
200 KB |
Output is correct |
3 |
Correct |
9 ms |
200 KB |
Output is correct |
4 |
Correct |
3 ms |
316 KB |
Output is correct |
5 |
Correct |
6 ms |
200 KB |
Output is correct |
6 |
Correct |
7 ms |
200 KB |
Output is correct |
7 |
Correct |
7 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
200 KB |
Output is correct |
2 |
Correct |
7 ms |
200 KB |
Output is correct |
3 |
Correct |
5 ms |
200 KB |
Output is correct |
4 |
Correct |
3 ms |
200 KB |
Output is correct |
5 |
Correct |
5 ms |
200 KB |
Output is correct |
6 |
Correct |
6 ms |
200 KB |
Output is correct |
7 |
Correct |
8 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
200 KB |
Output is correct |
2 |
Correct |
7 ms |
308 KB |
Output is correct |
3 |
Correct |
7 ms |
308 KB |
Output is correct |
4 |
Correct |
6 ms |
200 KB |
Output is correct |
5 |
Correct |
7 ms |
200 KB |
Output is correct |
6 |
Correct |
3 ms |
312 KB |
Output is correct |
7 |
Correct |
3 ms |
200 KB |
Output is correct |