#687
Unrated
All Pairs Similarity
시간 제한
2s
메모리 제한
1024MB
제출
0
정답
0
맞힌 사람
0
정답 비율
0.0%

문제

Note: The memory limit for this problem is 512MB, twice the default.

Farmer John's NN (1N51051\le N\le 5\cdot 10^5) cows are each assigned a bitstring of length KK that is not all zero (1K201\le K\le 20). Different cows may be assigned the same bitstring.

The Jaccard similarity of two bitstrings is defined as the number of set bits in their bitwise intersection divided by the number of set bits in their bitwise union. For example, the Jaccard similarity of the bitstrings 11001\texttt{11001} and 11010\texttt{11010} would be 2/42/4.

For each cow, output the sum of her bitstring's Jaccard similarity with each of the NN cows' bitstrings including her own, modulo 109+710^9+7. Specifically, if the sum is equal to a rational number a/ba/b where aa and bb are integers sharing no common factors, output the unique integer xx in the range [0,109+7)[0,10^9+7) such that bxabx-a is divisible by 109+710^9+7.

입력

The first line contains NN and KK.

The next NN lines each contain an integer i(0,2K)i\in (0,2^K), representing a cow associated with the length-KK binary representation of ii.

예제 입력 1

4 2
1
1
2
3

예제 출력 1

500000006
500000006
500000005
500000006

점수

Inputs 2-15: There will be two test cases for each of K{10,15,16,17,18,19,20}K\in \{10,15,16,17,18,19,20\}.

코드 제출

코드를 제출하려면 로그인이 필요합니다.

로그인
내 제출
제출 내역이 없습니다.
맞은 사람
아직 맞은 사람이 없습니다.
난이도 투표
Unrated0명 투표
로그인 후 AC 받으면 투표할 수 있습니다.
전체 제출
제출 내역이 없습니다.