Diskurs
시간 제한2초메모리 제한1024 MB
모든 값이 2^m 미만인 배열에서 각 원소마다 다른 원소와의 해밍 거리의 최댓값을 구한다.
문제
You are given non negative integers less than . For each of them you are to find the maximum possible hamming distance between it and some other element of the array .
The hamming distance of two non negative integers is defined as the number of positions in the binary representation of these numbers in which they differ (we add leading zeros if necessary).
Formally, for each calculate:
입력
The first line contains two integers and (, ).
The second line contains numbers ()
출력
Output numbers seperated with spaces, where the -th number is the maximum hamming distance between and some other number in .
힌트
Clarification of the third example: The numbers , , , can be represented as , , , , in binary. Numbers and differ at places, same as numbers and . On the other hand, the number differs in at most places with all other numbers.