#include <bits/stdc++.h>
using namespace std;
#define ll long long
const ll sz=200;
ll ans[sz];
map<vector<ll>, ll>mp;
ll query(vector<ll>c)
{
if(mp[c]) return mp[c];
cout<<c.size()<<endl;
for(auto i:c){
cout<<i<<' ';
}
cout<<endl;
ll cur;
cin>>cur;
mp[c]=cur;
return cur;
}
int main(){
ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
ll n;
cin>>n;
ll cur=0;
vector<ll>v;
for(int i=1; i<=n; i++){
v.push_back(i);
ll res=query(v);
if(res>cur){
cur=res;
ans[i]=cur;
}
else{
v.pop_back();
ll l=0, r=v.size()-1;
while(l<r){
vector<ll>g;
ll mid=(l+r)/2;
for(int i=0; i<=mid; i++){
g.push_back(v[i]);
}
ll x=query(g);
g.push_back(i);
ll y=query(g);
if(y>x){
l=mid+1;
}
else{
r=mid;
}
}
ans[i]=ans[v[l]];
}
}
cout<<0<<' ';
for(int i=1; i<=n; i++){
cout<<ans[i]<<' ';
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
716 KB |
Output is correct |
2 |
Correct |
5 ms |
708 KB |
Output is correct |
3 |
Correct |
3 ms |
972 KB |
Output is correct |
4 |
Correct |
2 ms |
456 KB |
Output is correct |
5 |
Correct |
2 ms |
968 KB |
Output is correct |
6 |
Correct |
2 ms |
712 KB |
Output is correct |
7 |
Correct |
4 ms |
1292 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
456 KB |
Output is correct |
2 |
Correct |
5 ms |
1472 KB |
Output is correct |
3 |
Correct |
3 ms |
712 KB |
Output is correct |
4 |
Correct |
2 ms |
712 KB |
Output is correct |
5 |
Correct |
4 ms |
456 KB |
Output is correct |
6 |
Correct |
3 ms |
972 KB |
Output is correct |
7 |
Correct |
3 ms |
856 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
712 KB |
Output is correct |
2 |
Correct |
4 ms |
708 KB |
Output is correct |
3 |
Correct |
6 ms |
768 KB |
Output is correct |
4 |
Correct |
3 ms |
1224 KB |
Output is correct |
5 |
Correct |
4 ms |
716 KB |
Output is correct |
6 |
Correct |
5 ms |
708 KB |
Output is correct |
7 |
Correct |
5 ms |
972 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
708 KB |
Output is correct |
2 |
Correct |
3 ms |
976 KB |
Output is correct |
3 |
Correct |
3 ms |
460 KB |
Output is correct |
4 |
Correct |
2 ms |
708 KB |
Output is correct |
5 |
Correct |
5 ms |
712 KB |
Output is correct |
6 |
Correct |
4 ms |
808 KB |
Output is correct |
7 |
Correct |
4 ms |
712 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
456 KB |
Output is correct |
2 |
Correct |
5 ms |
452 KB |
Output is correct |
3 |
Correct |
6 ms |
488 KB |
Output is correct |
4 |
Correct |
5 ms |
964 KB |
Output is correct |
5 |
Correct |
5 ms |
968 KB |
Output is correct |
6 |
Correct |
3 ms |
968 KB |
Output is correct |
7 |
Correct |
2 ms |
560 KB |
Output is correct |