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

建议使用的浏览器:

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

6211:Pythagoras

题目描述
Given a list of integers $a_0,a_1,a_2,\cdots,a_{2^k-1}$. Pythagoras triples over $10^9$ are all solutions of $x^2+y^2=z^2$ where $x,y$ and $z$ are constrained to be positive integers less than or equal to $10^9$. You are to compute the sum of $a_{y~mod~2^k}$ of triples $(x,y,z)$ such that $x<y<z$ and they are relatively prime, i.e., have no common divisor larger than $1$.
输入解释
The first line is an integer $T~(1\le T\le 3)$ indicating the total number of cases.
For each test case the first line is the integer $k~(1\le k\le 17)$.
The second line contains $2^k$ integers corresponding to $a_0$ to $a_{2^k-1}$, where each $a_i$ satisfies $1\le a_i\le 255$.
输出解释
For each case output the sum of $a_{y~mod~2^k}$ in a line.
输入样例
3
2
0 0 0 1
2
1 0 0 0
2
1 1 1 1
输出样例
39788763
79577506
159154994
来自杭电HDUOJ的附加信息
Recommend liuyiding

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

源链接: HDU-6211

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

共提交 0

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