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

建议使用的浏览器:

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

6022:MG loves set

题目描述
MG is an intelligent boy. One day he was challenged by the famous master called Douer:
if the sum of the square of every element in a set is less than or equal to the square of the sum of all the elements, then we regard this set as ”A Harmony Set”.

Now we give a set with $n$ different elements, ask you how many nonempty subset is “A Harmony Set”.

MG thought it very easy and he had himself disdained to take the job. As a bystander, could you please help settle the problem and calculate the answer?
输入解释
The first line is an integer $T$ which indicates the case number.($1<=T<=10$)

And as for each case, there are $1$ integer $n$ in the first line which indicate the size of the set($n<=30$).

Then there are $n$ integers $V$ in the next line, the x-th integer means the x-th element of the set($0<=|V|<=100000000$).
输出解释
As for each case, you need to output a single line.

There should be one integer in the line which represents the number of “Harmony Set”.
输入样例
3
4
1 2 3 4
5
1 -1 2 3 -3
6
0 2 4 -4 -5 8
输出样例
15
12
25
来自杭电HDUOJ的附加信息
Recommend wange2014

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

题目来源 BestCoder Round #93

源链接: HDU-6022

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

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 262144/262144K(Java/Others)