← All problemsSign in

Bitwise Tuples

CodeChefRating 1634Open on judge ↗

Chef has two numbers $N$ and $M$. Help Chef to find number of integer $N$-tuples $(A_1, A_2, \ldots, A_N)$ such that $0 \leq A_1, A_2, \ldots, A_N \leq 2^M - 1$ and $A_1 \& A_2 \& \ldots \& A_N = 0$, where $\&$ denotes the [bitwise AND](https://en.wikipedia.org/wiki/Bitwise_operation#AND) operator. Since the number of tuples can be large, output it modulo $10^9+7$. ### Input - The first line co

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start