加载中…
We consider the problem of computing the optimal meeting point of a set of N crab submarines. First, we analyze the case where the submarines are allowed any position on the real line: we provide a constructive proof of optimality and we use it to provide a linear-time algorithm to find the optimal meeting point for the case of sorted starting points. Second, we use the results for the continuous case to solve the case where the crab submarines are restricted to integer locations: we show that, given the solution of the corresponding continuous problem, we can find the optimal integer solution in linear time.

生成讲解博客的中文版本

生成AI智能校验的中文版本