Graph by yuyarin

n,i;m[144];x[12];r(p,s,d){x[s]+=!p;for(d=n;d--;)p*m[s*n+d]&&r(p-1,d);}main(p){for(;~scanf("%d%d",&p,&n);){for(i=n*n;i--;x[i]=0)scanf("%d",m+i);for(r(p,i=n-1);i--;)printf("%d%c",x[i],i?32:10);}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page