#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;
ll n,i,a[155],te;
ll tanya(ll aa,ll bb)
{
cout<<bb-aa+1<<" ";
ll ii;
for(ii=aa;ii<=bb;ii++)
if(ii<bb)cout<<ii<<" ";
else cout<<ii<<endl;
ll H;
cin>>H;
return H;
}
ll tanya2(ll cc,ll aa,ll bb)
{
cout<<bb-aa+2<<" "<<cc<<" ";
ll ii;
for(ii=aa;ii<=bb;ii++)
if(ii<bb)cout<<ii<<" ";
else cout<<ii<<endl;
ll H;
cin>>H;
return H;
}
int main()
{
//ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>n;
for(i=1;i<=n;i++)
{
if(a[i]==0)a[i]=++te;
ll L=i+1;
ll R=n;
ll C;
while(L<R)
{
C=(L+R)/2;
if(tanya(L,C)==tanya2(i,L,C))R=C;
else L=C+1;
}
if(L>R)continue;
if(tanya(L,R)==tanya2(i,L,R))a[L]=a[i];
}
cout<<0<<" ";
for(i=1;i<=n;i++)
if(i<n)cout<<a[i]<<" ";
else cout<<a[n]<<endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
17 ms |
248 KB |
Output is correct |
2 |
Correct |
17 ms |
248 KB |
Output is correct |
3 |
Correct |
14 ms |
376 KB |
Output is correct |
4 |
Correct |
18 ms |
376 KB |
Output is correct |
5 |
Correct |
18 ms |
248 KB |
Output is correct |
6 |
Correct |
20 ms |
252 KB |
Output is correct |
7 |
Correct |
20 ms |
248 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
9 ms |
376 KB |
Output is correct |
2 |
Correct |
22 ms |
248 KB |
Output is correct |
3 |
Correct |
16 ms |
376 KB |
Output is correct |
4 |
Correct |
18 ms |
252 KB |
Output is correct |
5 |
Correct |
26 ms |
376 KB |
Output is correct |
6 |
Correct |
24 ms |
248 KB |
Output is correct |
7 |
Correct |
19 ms |
248 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
17 ms |
248 KB |
Output is correct |
2 |
Correct |
20 ms |
248 KB |
Output is correct |
3 |
Correct |
21 ms |
404 KB |
Output is correct |
4 |
Correct |
15 ms |
248 KB |
Output is correct |
5 |
Correct |
20 ms |
248 KB |
Output is correct |
6 |
Correct |
18 ms |
248 KB |
Output is correct |
7 |
Correct |
21 ms |
376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
23 ms |
248 KB |
Output is correct |
2 |
Correct |
29 ms |
248 KB |
Output is correct |
3 |
Correct |
18 ms |
376 KB |
Output is correct |
4 |
Correct |
19 ms |
252 KB |
Output is correct |
5 |
Correct |
22 ms |
248 KB |
Output is correct |
6 |
Correct |
10 ms |
308 KB |
Output is correct |
7 |
Correct |
19 ms |
376 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
13 ms |
292 KB |
Output is correct |
2 |
Correct |
19 ms |
248 KB |
Output is correct |
3 |
Correct |
12 ms |
376 KB |
Output is correct |
4 |
Correct |
17 ms |
376 KB |
Output is correct |
5 |
Correct |
21 ms |
248 KB |
Output is correct |
6 |
Correct |
20 ms |
504 KB |
Output is correct |
7 |
Correct |
24 ms |
248 KB |
Output is correct |