#include<iostream>
using namespace std;
int nrg;
int G[155],Rez[155];
bool group(int dr, int x) //returneaza 1 daca grupa lui x este una din grupele [1,dr]
{
cout<<dr+1<<" ";
for(int i=1; i<=dr; i++)
cout<<G[i]<<" ";
cout<<x<<endl;
int len;
cin>>len;
if(len<dr+1)
return 1;
return 0;
}
int src(int x)
{
int rez=0;
for(int i=7; i>=0; i--)
{
if(rez+(1<<i)<nrg && !group(rez+(1<<i),x))
rez+=(1<<i);
}
rez++;
return rez;
}
int main()
{
int n;
cin>>n;
int last=0;
for(int i=1; i<=n; i++)
{
cout<<i<<" ";
for(int j=1; j<=i; j++)
cout<<j<<" ";
cout<<endl;
int len;
cin>>len;
if(len!=last)
{
nrg++;
G[nrg]=i;
Rez[i]=nrg;
}
last=len;
}
for(int i=1; i<=n; i++)
{
if(!Rez[i])
{
Rez[i]=src(i);
}
}
cout<<"0 ";
for(int i=1; i<=n; i++)
cout<<Rez[i]<<" ";
cout<<endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
384 KB |
Output is correct |
2 |
Correct |
12 ms |
384 KB |
Output is correct |
3 |
Correct |
9 ms |
256 KB |
Output is correct |
4 |
Correct |
9 ms |
256 KB |
Output is correct |
5 |
Correct |
9 ms |
304 KB |
Output is correct |
6 |
Correct |
9 ms |
256 KB |
Output is correct |
7 |
Correct |
13 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
256 KB |
Output is correct |
2 |
Correct |
15 ms |
384 KB |
Output is correct |
3 |
Correct |
9 ms |
256 KB |
Output is correct |
4 |
Correct |
7 ms |
256 KB |
Output is correct |
5 |
Correct |
12 ms |
384 KB |
Output is correct |
6 |
Correct |
12 ms |
256 KB |
Output is correct |
7 |
Correct |
11 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
384 KB |
Output is correct |
2 |
Correct |
11 ms |
384 KB |
Output is correct |
3 |
Correct |
14 ms |
256 KB |
Output is correct |
4 |
Correct |
7 ms |
256 KB |
Output is correct |
5 |
Correct |
13 ms |
304 KB |
Output is correct |
6 |
Correct |
16 ms |
256 KB |
Output is correct |
7 |
Correct |
14 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
256 KB |
Output is correct |
2 |
Correct |
10 ms |
384 KB |
Output is correct |
3 |
Correct |
9 ms |
256 KB |
Output is correct |
4 |
Correct |
7 ms |
256 KB |
Output is correct |
5 |
Correct |
13 ms |
384 KB |
Output is correct |
6 |
Correct |
12 ms |
384 KB |
Output is correct |
7 |
Correct |
14 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
384 KB |
Output is correct |
2 |
Correct |
13 ms |
384 KB |
Output is correct |
3 |
Correct |
14 ms |
256 KB |
Output is correct |
4 |
Correct |
12 ms |
384 KB |
Output is correct |
5 |
Correct |
11 ms |
256 KB |
Output is correct |
6 |
Correct |
9 ms |
256 KB |
Output is correct |
7 |
Correct |
8 ms |
256 KB |
Output is correct |