#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define FOR(i, x, y) for(ll i = x; i < y; i++)
typedef long long ll;
using namespace std;
ll a[151];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
ll n, id = 1;
cin >> n;
vector<ll> v;
FOR(i, 1, n + 1) {
cout << v.size() + 1 << ' ';
for (auto& j : v) cout << j << ' ';
cout << i << endl;
ll x;
cin >> x;
if (x == id) {
a[i] = id++;
v.push_back(i);
} else {
ll l = 0, r = v.size() - 1;
while (l != r) {
ll mid = (l + r) / 2;
cout << mid - l + 2 << ' ' << i << ' ';
FOR(j, l, mid + 1) cout << v[j] << ' ';
cout << endl;
ll k;
cin >> k;
if (k == mid - l + 2) r = mid;
else l = mid + 1;
}
a[i] = a[l];
}
}
cout << "0 ";
FOR(i, 1, n + 1) cout << a[i] << ' ';
cout << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
256 KB |
Integer 0 violates the range [1, 11] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
304 KB |
Integer 0 violates the range [1, 5] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
256 KB |
Integer 0 violates the range [1, 1] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
384 KB |
Integer 0 violates the range [1, 4] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
Integer 0 violates the range [1, 2] |
2 |
Halted |
0 ms |
0 KB |
- |