[HDU1109]Run Away(模拟退火,爬山算法)

发布于 2018-04-05  5 次阅读


本文章由SYCstudio或本站其它作者所有,严禁转载,转载必究

本文链接地址:[HDU1109]Run Away(模拟退火,爬山算法)

Description

One of the traps we will encounter in the Pyramid is located in the Large Room. A lot of small holes are drilled into the floor. They look completely harmless at the first sight. But when activated, they start to throw out very hot java, uh ... pardon, lava. Unfortunately, all known paths to the Center Room (where the Sarcophagus is) contain a trigger that activates the trap. The ACM were not able to avoid that. But they have carefully monitored the positions of all the holes. So it is important to find the place in the Large Room that has the maximal distance from all the holes. This place is the safest in the entire room and the archaeologist has to hide there.

Tag

模拟退火,爬山算法

题目大意

给出矩形内若干个点,现在要求求出一个点,使得这个点到给出所有点中距离的最小值最大。

解决思路

在平面上随机一个/多个点,然后随机向四周走,看是否更优。若更优,则直接走,否则,退火算法是一定概率接受这个不优的解,而爬山是只接受更优的解。

代码

下面的代码使用爬山实现(其实似乎是爬山与退火的混合?)

本文章由SYCstudio或本站其它作者所有,严禁转载,转载必究

本文链接地址:[HDU1109]Run Away(模拟退火,爬山算法)


HNCJ OIer 一枚