HBC216002栗酱的文明2,排序,枚举CertainScientificRailgun题解

上官魅 算法基础篇 97 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
Consider Academy City as a 2-dimensional plane. There are. (0,0) and her railgun ability will terminate all robots sharing the same. y-coordinate with her. More formally, if Misaka is now located at. As Misaka hates decimals and Euclidean geometry, she will only move from one integer point to another integer point and can only move horizontally (parallel to the. y-axis). As moving among the city is quite tiresome, Misaka asks you to calculate the minimum distance she has to move to terminate all robots.

Misaka Mikoto is the third-ranked Level 5 esper in Academy City and has been nicknamed Railgun due to her signature move. One day, several evil robots invade Academy City and Misaka is planning to terminate all of them. Consider Academy City as a 2-dimensional plane. There are n n robots in total and the position of the i i-th robot is (x_i, y_i) (x i ​ ,y i ​ ). Misaka will start moving from (0, 0) (0,0) and her railgun ability will terminate all robots sharing the same x x- or y y-coordinate with her. More formally, if Misaka is now located at (x_m, y_m) (x m ​ ,y m ​ ), all robots whose x_i = x_m x i ​ =x m ​ or y_i = y_m y i ​ =y m ​ will be terminated. As Misaka hates decimals and Euclidean geometry, she will only move from one integer point to another integer point and can only move horizontally (parallel to the x x-axis) or vertically (parallel to the y y-axis). As moving among the city is quite tiresome, Misaka asks you to calculate the minimum distance she has to move to terminate all robots. Recall that an integer point is a point whose x x-coordinate and y y-coordinate are both integers.

HBC216002栗酱的文明2,排序,枚举CertainScientificRailgun题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)

标签: HBC216002栗酱的文明2 排序 枚举CertainScientificRailgun题解