26
Last seen 8 years ago
Member for 10 years, 7 months, 5 days
Difficulty Normal
[Did you mean](http://tr.im/4tbdr):
checkio = (lambda N, H, R=range, L=len:
(lambda *_:0)(*map(*reversed((R(L(H)), lambda i:
(lambda *_:0)(*map(*reversed((R(L(H[i])), lambda j:
(lambda _:_())(lambda I = i + L(N), J = j + L(N[0]):
0 i
More
tmp = sqrt((s%4-(g+v)%4)**2+(s//4-(g+v)//4)**2)
Tip: you don't need sqrt here. If you are only comparing distances, you can take advantage of the fact that sqrt(a) < sqrt(b) if and only if a < b. It doesn't matter much in this task, but generally it can be quite useful to work with
More
You're right, it's enough to call eval(e) if x and y are already in locals().
More
Nice solution.
By the way, the value you attach to the game states is always -1000 or 1000 so you could have used 0 and 1 (or equivalently, False and True) as well.
More