#include <bits/stdc++.h>
#define int long long
// #define endl '\n'
using namespace std;
signed main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n;
cin>>n;
vector<int>v(n+1);
vector<int>vct(n+1);
vct[1]=1;
v[1]=1;
int cnt=1;
for(int i=2;i<=n;i++){
int l=1,r=cnt,mid,f=0;
while(l<=r){
mid=(l+r)/2;
cout<<mid+1<<' ';
for(int w=1;w<=mid;w++)cout<<v[w]<<' ';
cout<<i<<' ';
cout<<endl;
int x;
cin>>x;
if(x==mid){f=mid;r=mid-1;}
else l=mid+1;
}
if(f==0){
cnt++;
v[cnt]=i;
vct[i]=cnt;
}else{
vct[i]=f;
}
}
for(auto i:vct)cout<<i<<' ';
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
200 KB |
Output is correct |
2 |
Correct |
8 ms |
200 KB |
Output is correct |
3 |
Correct |
12 ms |
200 KB |
Output is correct |
4 |
Correct |
11 ms |
200 KB |
Output is correct |
5 |
Correct |
3 ms |
200 KB |
Output is correct |
6 |
Correct |
2 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 |
10 ms |
200 KB |
Output is correct |
3 |
Correct |
11 ms |
200 KB |
Output is correct |
4 |
Correct |
13 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 |
5 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
200 KB |
Output is correct |
2 |
Correct |
5 ms |
200 KB |
Output is correct |
3 |
Correct |
9 ms |
200 KB |
Output is correct |
4 |
Correct |
13 ms |
200 KB |
Output is correct |
5 |
Correct |
7 ms |
200 KB |
Output is correct |
6 |
Correct |
6 ms |
200 KB |
Output is correct |
7 |
Correct |
9 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
200 KB |
Output is correct |
2 |
Correct |
4 ms |
200 KB |
Output is correct |
3 |
Correct |
14 ms |
200 KB |
Output is correct |
4 |
Correct |
14 ms |
260 KB |
Output is correct |
5 |
Correct |
3 ms |
200 KB |
Output is correct |
6 |
Correct |
9 ms |
200 KB |
Output is correct |
7 |
Correct |
9 ms |
200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
200 KB |
Output is correct |
2 |
Correct |
6 ms |
200 KB |
Output is correct |
3 |
Correct |
9 ms |
200 KB |
Output is correct |
4 |
Correct |
10 ms |
200 KB |
Output is correct |
5 |
Correct |
12 ms |
200 KB |
Output is correct |
6 |
Correct |
11 ms |
200 KB |
Output is correct |
7 |
Correct |
17 ms |
200 KB |
Output is correct |