HBC202151Portal题解

旧巴黎 算法基础篇 43 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
Alice and Bob are living in ``Rectangle Kingdom''. There are two portals in the world. Standing at the portal, people can jump into it, and instantly travel to the other portal. Portals do not disappear after you do that. Of course you can walk past a portal and do not jump into it, but why waste such fun?It's known that Bob dates Alice so frequently that almost everyone in Rectangle Kingdom becomes jealous and wants to do something evil to stop them from seeing each other. You, for instance, want to separate them by moving their apartments to be as far as possible. Hopefully after your plan, Bob should spend much more effort walking to Alice's apartment, making him feel reluctant to do that, until eventually of course, they stop seeing each other and everyone is happy again.You may assume ``Rectangle Kingdom'' is a 2D rectangle and Alice and Bob's apartments should be in the rectangle. The distances are Euclidean and walking one distance unit takes one time unit. Bob always chooses the shortest path from his apartment to Alice's apartment.

Alice and Bob are living in ``Rectangle Kingdom''. There are two portals in the world. Standing at the portal, people can jump into it, and instantly travel to the other portal. Portals do not disappear after you do that. Of course you can walk past a portal and do not jump into it, but why waste such fun? It's known that Bob dates Alice so frequently that almost everyone in Rectangle Kingdom becomes jealous and wants to do something evil to stop them from seeing each other. You, for instance, want to separate them by moving their apartments to be as far as possible. Hopefully after your plan, Bob should spend much more effort walking to Alice's apartment, making him feel reluctant to do that, until eventually of course, they stop seeing each other and everyone is happy again. You may assume ``Rectangle Kingdom'' is a 2D rectangle and Alice and Bob's apartments should be in the rectangle. The distances are Euclidean and walking one distance unit takes one time unit. Bob always chooses the shortest path from his apartment to Alice's apartment.

HBC202151Portal题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
不断学习,不断挑战,才能在编程领域中脱颖而出!全网最全C++题库,助您成为编程高手!

标签: HBC202151Portal题解