#include <bits/stdc++.h>
using namespace std;
#define ll long long
// #define endl '\n'
#define all(x) x.begin(), x.end()
#define INF 0x3f3f3f3f
#define INFLL (ll)0x3f3f3f3f3f3f3f3f
const int MOD = 1e9 + 7, SZ = 1e5 + 10;
int ask(vector<int> vec){
cout.flush() << vec.size() << ' ';
for(int i : vec) cout.flush() << i << ' ';
cout.flush() << endl;
int res;
cin >> res;
return res;
}
int32_t main(){
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n;
cin >> n;
int a[n + 1] = {};
for(int i = 1; i <= n; i++){
vector<int> vec(i);
iota(all(vec), 1);
a[i] = ask(vec);
}
int ans[n + 1], x = 0, num[n + 1];
for(int i = 1; i <= n; i++){
if(a[i] == a[i - 1] + 1){
ans[i] = ++x;
num[x] = i;
}
else{
for(int j = 1; j <= x; j++){
if(ask({num[j], i}) == 1){
ans[i] = ans[j];
break;
}
}
}
}
cout.flush() << 0 << ' ';
for(int i = 1; i <= n; i++){
cout.flush() << ans[i] << ' ';
}
cout.flush() << endl;
return 0;
}
// by me
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
712 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
7 ms |
712 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
704 KB |
Output is correct |
2 |
Incorrect |
7 ms |
968 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
968 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
448 KB |
Output is correct |
2 |
Incorrect |
11 ms |
452 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |