Counting Pairs
시간 제한1초메모리 제한2048 MB
정수 목록이 주어질 때, 이진법 자리별 합을 2로 나눈 값과 사진법 자리별 합을 4로 나눈 값이 서로 같은 쌍의 개수를 센다.
문제
Consider the binary operator that is defined for as follows. First, convert both and into base . Then, for each corresponding digit pair, the resulting digit can be calculated by adding the digit pair modulo . Finally, convert the result back to base ten. Notice that is the bitwise XOR operator.
For instance, can be calculated as follows. The base four representations of and are and , respectively. After the addition for each digit pair, the result is , or in base ten.
You are given a list of integers, .
Determine the number of pairs such that and .
입력
The first line consists of an integer ().
The next line consists of integers ().
출력
Output a single integer representing the number of pairs such that and .