HBC210237SocialDistancing题解

水水月牙 算法基础篇 37 0
挑战自我,勇攀编程高峰!全网最全C++题库,助您成为编程达人。
Nowadays, the Kingdom of Dreamgrid is suffering from a national pandemic. Fortunately, president Baobao is working effectively with the Center for Disease Control and they are trying their best to make everything under control. President Baobao has announced a policy of Social Distancing to prevent the diffusion of the virus. As the chief of CDC, you are required to research on the following problem: There are n people who need to be observed and you have already set a monitor in (0,0) on a 2-dimensional plane. Everyone should stay within the distance of r to the monitor. You also have to keep them stay away from each other as far as possible. To simplify the problem, you can only allocate them to integers coordinates. Please maximize ∑i=1n1∑j=i+1nd(i,j)2,sum_{i=1}^{n-1}sum_{j=i+1}^{n}d(i,j)^2,∑i=1n1∑j=i+1nd(i,j)2, where d(i,j) means the Euclidean distance between the i-th and the j-th person.

Nowadays, the Kingdom of Dreamgrid is suffering from a national pandemic. Fortunately, president Baobao is working effectively with the Center for Disease Control (CDC) and they are trying their best to make everything under control. President Baobao has announced a policy of Social Distancing to prevent the diffusion of the virus. As the chief of CDC, you are required to research on the following problem: There are n people who need to be observed and you have already set a monitor in (0,0) on a 2-dimensional plane. Everyone should stay within the distance of r to the monitor. You also have to keep them stay away from each other as far as possible. To simplify the problem, you can only allocate them to integers coordinates. Please maximize ∑i=1n−1∑j=i+1nd(i,j)2,sum_{i=1}^{n-1}sum_{j=i+1}^{n}d(i,j)^2,∑i=1n−1​∑j=i+1n​d(i,j)2, where d(i,j) means the Euclidean distance between the i-th and the j-th person.

HBC210237SocialDistancing题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
全网最全C++题库,助您挑战自我,突破极限,成为编程领域的佼佼者!

标签: HBC210237SocialDistancing题解