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

建议使用的浏览器:

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

5653:Bomber Man wants to bomb an Array.

题目描述
Given an array and some positions where to plant the bombs, You have to print the Total Maximum Impact.

Each Bomb has some left destruction capability $L$ and some right destruction capability $R$ which means if a bomb is dropped at $i$th location it will destroy $L$ blocks on the left and $R$ blocks on the right.
Number of Blocks destroyed by a bomb is $L + R + 1$
Total Impact is calculated as product of number of blocks destroyed by each bomb.
If $i$th bomb destroys $Xi$ blocks then $Total Impact = X1 * X2 * .... Xm$

Given the bombing locations in the array, print the Maximum Total Impact such that every block of the array is destoryed exactly once(i.e it is effected by only one bomb).

### Rules of Bombing
1. Bomber Man wants to plant a bomb at every bombing location.
2. Bomber Man wants to destroy each block with only once.
3. Bomber Man wants to destroy every block.

输入解释
There are multi test cases denote by a integer $T(T \leq 20)$ in the first line.

First line two Integers $N$ and $M$ which are the number of locations and number of bombing locations respectivly.
Second line contains $M$ distinct integers specifying the Bombing Locations.

1 <= N <= 2000

1 <= M <= N
输出解释
as Maximum Total Impact can be very large print the floor(1000000 * log2(Maximum Total Impact)).

Hint:
Sample 1:



Sample 2:

输入样例
2
10 2
0 9
10 3
0 4 8
输出样例
4643856
5169925
来自杭电HDUOJ的附加信息
Recommend wange2014

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

源链接: HDU-5653

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

共提交 0

通过率 --%
时间上限 内存上限
4000/2000MS(Java/Others) 65536/65536K(Java/Others)