HOME
PROBLEM
STATUS
CONTEST
练习
积分
趣味
正式
DIY
RANK
荣誉榜
活跃榜
现役榜
组队榜
DISCUSS
CHALLENGE
MALL
Register
Login
First One
TimeLimit: 4000/2000 MS (Java/Others) MemoryLimit: 131072/131072 K (Java/Others)
64-bit integer IO format:
%I64d
未提交
|
登录后收藏
Problem Description
soda has an integer array
a
1
,
a
2
,
…
,
a
n
. Let
S
(
i
,
j
)
be the sum of
a
i
,
a
i
+
1
,
…
,
a
j
. Now soda wants to know the value below:
∑
i
=
1
n
∑
j
=
i
n
(
⌊
log
2
S
(
i
,
j
)
⌋
+
1
)
×
(
i
+
j
)
Note: In this problem, you can consider
log
2
0
as 0.
Input
There are multiple test cases. The first line of input contains an integer
T
, indicating the number of test cases. For each test case:
The first line contains an integer
n
(
1
≤
n
≤
10
5
)
, the number of integers in the array.
The next line contains
n
integers
a
1
,
a
2
,
…
,
a
n
(
0
≤
a
i
≤
10
5
)
.
Output
For each test case, output the value.
SampleInput
1 2 1 1
SampleOutput
12
Submit
题目统计信息
详细
总AC数
3
通过人数
3
尝试人数
4
总提交量
15
AC率
20.00%
标签——1475
name
rating
暴力
200
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签
出处
【暑假集训组队模拟赛】万一很难呢
T^T Online Judge
[
BUG反馈
] [
FAQ
] [
闽ICP备17026590号-1
]
当前版本:
3.24
系统时间: