当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

5885:XM Reserves

题目描述
As an eligible Ingress Resistance Agent you should know your power source, the Exotic Matter.
We call it XM, which is the driving force behind all of our actions in Ingress.
XM allows us to construct items through hacking portals, to attack enemy portals, make links and create fields.

We try to collect XM from the ground. XM concentration come from location based services, meaning that areas with a lot of foot traffic have higher amounts versus places that don't.
You can collect XM by moving through those areas.
The XM will be automatically harvested by your Scanner when it is within your interaction circle/range.

Alice decides to select a location such that she can collect XM as much as possible.
To simplify the problem, we consider the city as a grid map with size `n*m' numbered from $(0,0)$ to $(n-1,m-1)$.
The XM concentration inside the block $(i,j)$ is $p(i,j)$.
The radius of your interaction circle is $r$.
We can assume that XM of the block $(i,j)$ are located in the centre of this block.
The distance between two blocks is the Euclidean distance between their centres.

Alice stands in the centre of one block and collects the XM.
For each block with the distance d smaller than r to Alice, and whose XM concertation is $p(i,j)$, Alice's scanner can collects $p(i,j)/(1+d)$ XM from it.

Help Alice to determine the maximum XM which she can collect once he stands in the centre of one block.
输入解释
There are multiple cases.
For each case, the first line consists two integers $n, m~(1\le n,m \le 500)$ and one float-point number $r~(0\le r \le 300)$.
Each of the following $n$ line consists $m$ non-negative float-point numbers corresponding to the XM concentrations inside each blocks.
输出解释
For each case, output the maximum XM which Alice can collect in one line.
Your answers should be rounded to three decimal places.
输入样例
3 3 1
1 3 6
7 9 4
2 8 1
3 3 2
1 3 6
7 9 4
2 8 1
5 5 1.5
4 3 2 9 1 
3 4 3 2 8
9 4 3 2 1
2 3 0 1 2
6 3 4 3 1
输出样例
9.000
24.142
17.956
来自杭电HDUOJ的附加信息
Recommend wange2014

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-5885

最后修改于 2020-10-25T23:26:27+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
10000/10000MS(Java/Others) 102400/102400K(Java/Others)