void mutation() //变异函数
{
int g,p,q,s,temp ;
g=rand()%pmax;
p=rand()%H;
q=rand()%R;
s=rand()%omaxn[g];
temp=human[g][p][s];
human[g][p][s]=robot[g][q][s];
robot[g][q][s]=temp;
}
void mutation() //变异函数
{
int g,p,q,s,temp ;
g=rand()%pmax;
p=rand()%H;
q=rand()%R;
s=rand()%omaxn[g];
temp=human[g][p][s];
human[g][p][s]=robot[g][q][s];
robot[g][q][s]=temp;
}
#include
void function();
void main()
{
int t;
printf("input t\n");
scanf("%d",&t);
while(0
function();
}
void function()
{
int i,j,n,a[100][100],a1[100]={0},k=0,i1,j1;
printf("input n\n");
scanf("%d",&n);
for(i=0;i
{
printf("%2d:",i+1);
scanf("%d",&a[i][0]);
for(j=1;j
scanf("%d",&a[i][j]);
}
for(i=1;i
for(j=n-1;j>=0;j--)
if(a[j][0]==0)
{
a1[k++]=j+1;
for(i1=0;i1<n;i1++)
for(j1=1;j1<=a[i1][0];j1++)
if(a[i1][j1]==j+1)
{
a[i1][0]--;
break;
}
a[j][0]=200;
break;
}
if(k==n)
{
for(i=0;i<k;i++)
printf("%d ",a1[i]);
printf("\n");
}
else
printf("-1\n");
}