HBC236061[SHOI2010]扫雷机器人,栈,数据结构Laser Trap题解

凸凸曼凸凸 算法基础篇 101 0
挑战自我,勇攀编程高峰!全网最全C++题库,助您成为编程达人。
BaoBao is playing the famous gameElden Ringthese days. It's an open-world game in which you can control your character to travel from places to places. However, your character could also enter a trap and you need to figure out how to escape. Right now, BaoBao's character is stuck in a 2-dimensional plane with deadly lasers. There are nnn laser generators shooting laser beams between every pair of them . The beams start and end at generator points and do not stretch to infinity. Starting at point (0,0)(0,0)(0,0), BaoBao wants to escape to point without touching any laser beam or generator. In order to do so, BaoBao can ask her friend DreamGrid to remove any number of laser generators, together with any laser beam that starts or ends at these generators. Output the minimum number of laser generators that need to be erased for the escape. Note that BaoBao does not need to move in a specific direction to escape. Her escaping route can even be a curve if necessary.

BaoBao is playing the famous gameElden Ringthese days. It's an open-world game in which you can control your character to travel from places to places. However, your character could also enter a trap and you need to figure out how to escape. Right now, BaoBao's character is stuck in a 2-dimensional plane with deadly lasers. There are nnn laser generators (each can be regarded as a point) shooting laser beams between every pair of them (so there are n(n−1)2frac{n(n-1)}{2}2n(n−1)​ laser beams in total). The beams start and end at generator points and do not stretch to infinity. Starting at point (0,0)(0,0)(0,0), BaoBao wants to escape to point (1010101010,1010101010)(10^{10^{10^{10^{10}}}}, 10^{10^{10^{10^{10}}}})(1010101010,1010101010) without touching any laser beam or generator. In order to do so, BaoBao can ask her friend DreamGrid to remove any number of laser generators, together with any laser beam that starts or ends at these generators. Output the minimum number of laser generators that need to be erased for the escape. Note that BaoBao does not need to move in a specific direction to escape. Her escaping route can even be a curve if necessary.

HBC236061[SHOI2010]扫雷机器人,栈,数据结构Laser Trap题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断挑战自我,才能突破极限!全网最全C++题库,让您在编程道路上越走越远。

标签: HBC236061[SHOI2010]扫雷机器人 数据结构Laser Trap题解