Distance from x by recursive

B=eval("raw_input(),"*10)
E=enumerate
for i,b in E(B):print"".join(`min(abs(i-r)+abs(j-c)for r,p in E(B)for c,q in E(p)if"."<q)`for j,c in E(b))

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

download

return to the top page