atcoder#TOKIOMARINE2020E. O(rand)
O(rand)
Score : points
Problem Statement
Given are pairwise distinct non-negative integers . Find the number of ways to choose a set of between and numbers (inclusive) from the given numbers so that the following two conditions are satisfied:
- The bitwise AND of the chosen numbers is .
- The bitwise OR of the chosen numbers is .
Constraints
- ()
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3 3 0 3
1 2 3
2
The conditions are satisfied when we choose or .
5 3 1 7
3 4 9 1 5
2
5 4 0 15
3 4 9 1 5
3