Tuesday, March 22, 2016

MJ [55] Best Merging Point

problem: robot merge point
input:
robot: 1
obstacle: X
[
    0   0   0   M   1
    0   1   X   0   0
    0   X   0   0   0
    0   0   0   1   0
    0   0   0   0   0
]
output:
best merge point: M
3 + 1 + 3 = 7

======
For every robot, compute its shortest distance to every point. The best merge point is the point with the smallest distance sum over all the robots.



No comments:

Post a Comment