#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector <ll>;
using ii = pair <ll, ll>;
using vii = vector <ii>;
ll fask (vll ve) {
if (ve.size() == 0) return 0;
cout << ve.size() << ' ';
for (ll i : ve) cout << i+1 << ' ';
cout << '\n' << flush;
ll res;
cin >> res;
return res;
}
void answer (vll ve) {
cout << "0 ";
for (ll i : ve) cout << i << ' ';
cout << '\n' << flush;
}
int main () {
cin.tie(nullptr) -> sync_with_stdio(false);
ll n;
cin >> n;
vll key(n, -16);
ll timer = 1;
for (ll i = 0; i < n; i++) {
ll j = 0;
while (j < i) {
if (fask({ j, i }) == 1) {
key[i] = key[j];
break;
}
j++;
}
if (j == i) key[i] = timer++;
}
answer(key);
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |