Xorderable Array
시간 제한1초메모리 제한2048 MB
u<v인 쌍 (X_u, X_v) 가운데, A를 재배열해 앞 원소를 p, q로 각각 xor한 값이 뒤 원소의 xor 값 이하가 되도록 만들 수 있는 쌍의 개수를 센다.
문제
You are given an array of integers: .
The array is -xorderable if it is possible to rearrange such that for each pair that satisfies , the following conditions must be satisfied after the rearrangement: and . The operator represents the bitwise xor.
You are given another array of length : . Calculate the number of pairs where array is -xorderable for .
입력
The first line consists of two integers ().
The second line consists of integers ().
The third line consists of integers ().
출력
Output a single integer representing the number of pairs where array is -xorderable for .