Responsive image

问题 D: Kanade's trio

问题 D: Kanade's trio

时间限制: 4 Sec  内存限制: 128 MB
提交: 6  解决: 1
[提交][状态][讨论版][命题人:]

题目描述

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≤T≤20

1≤∑n≤5∗105

0≤A[i]<230

输入描述

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]

输出描述

For each test case , output an integer , which means the answer.

样例输入

1

5

1 2 3 4 5

样例输出

6

提示

标程代码  中const int N=510000;  改为  const int N=100000; 否则会运行错误

[提交][状态]
ACM算法攻关部