#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
ll n; cin >> n;
ll ans[n]; ans[0]=1;
vector<ll> v; ll c = 1;
v.push_back(1);
for(ll i = 1; i < n; i++){
ll l = 0, r = v.size()-1;
cout << r-l+2 << " ";
for(ll j = l; j <= r; j++){
cout << v[j] << " ";
}
cout << i+1 << endl;
ll x,y; cin >> x;
if(x>r-l+1){
c++;ans[i]=c;
v.push_back(i+1);
continue;
}
while(l<r){
cout << (l+r+1)/2-l+1 << " ";
for(ll j = l; j < (l+r+1)/2; j++){
cout << v[j] << " ";
}
cout << i+1 << endl; cin >> x;
if((l+r+1)/2-l==1){
y=1;
if(x<=y){
r=(l+r+1)/2-1;
}
else{
l=(l+r+1)/2;
}
continue;
}
cout << (l+r+1)/2-l<< " ";
for(ll j = l; j < (l+r+1)/2; j++){
cout << v[j] << " ";
}
cout << endl;cin >> y;
if(x<=y){
r=(l+r+1)/2-1;
}
else{
l=(l+r+1)/2;
}
}
ans[i]=ans[(l+r+1)/2];
}
cout << 0 << " ";
for(ll i:ans){
cout << i << " ";
}
cout << endl;
}
//21231
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
9 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
7 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Incorrect |
8 ms |
208 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
6 ms |
208 KB |
Incorrect |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
208 KB |
Output is correct |
2 |
Incorrect |
11 ms |
208 KB |
Incorrect |
3 |
Halted |
0 ms |
0 KB |
- |