Kanade's trio

TimeLimit:2000MS  MemoryLimit:524288KB
64-bit integer IO format:%I64d
未提交 | 登录后收藏
Problem Description
Give you an array $A[1..n]$,you need to calculate how many tuples $(i,j,k)$ satisfy that $(i<j<k)$ and $((A[i]~xor~A[j])<(A[j]~xor~A[k]))$

There are T test cases.

$1\leq T\leq 20$

$1\leq \sum n\leq 5*10^5$

$0\leq A[i] <2^{30}$
Input
There is only one integer T on first line.

For each test case , the first line consists of one integer $n$ ,and the second line consists of $n$ integers which means the array $A[1..n]$
Output
For each test case , output an integer , which means the answer.
SampleInput
1

5

1 2 3 4 5
SampleOutput
6
Submit
题目统计信息详细
总AC数1
通过人数1
尝试人数2
总提交量2
AC率50.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: