Very simple. If MAXOR of the entire input set is not equal to zero, there 
are no subsets with equal MAXORs. If MAXOR of the entire set is zero, then 
any two complementary subsets have equal MAXORs. Since there are 2^N (^ is 
the exponential operator) subsets of a set of N elements, Little Panda 
needs to calculate mod((2^N)!,1000000007) (! is the factorial symbol). 

Dave

On Monday, October 5, 2015 at 10:48:11 PM UTC-5, gopi wrote:

> Little Black Panda is mad about XOR operation. Presently he has gone mad 
> and he won't stop performing XOR operation on various numbers.
> Given an array of N numbers, for each subset of the array Little Panda 
> performs MAXOR operation for the subset. MAXOR operation means that he 
> finds XOR of all elements in that subset (if the subset is [1,2,3] then 
> MAXOR is 1^2^3=0) . Little Panda is now exhausted and wants to do something 
> else. Little Panda wants to pick any two subsets the MAXOR of whose are 
> same. Little Panda needs to find the number of selections that he can make. 
> He is very very weak in programming so he wants the answer from you. Please 
> help little panda in finding out his query.
> Since the output can be very large output it modulo 1000000007.
>
> Input Format
> The first line contains N i.e. the length of the array.
> N lines follow, each containing a non-negative integer.
>
> Output Format
> Output Little Panda's Query in a single line.
>
> Constraints
> 1 <= N <= 100000
> 0 <= A[i] <= 100
> (where A[i] denotes the value of array element)
>

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to algogeeks+unsubscr...@googlegroups.com.

Reply via email to