← All problemsSign in

Count The Arrays

CodeChefRating 2861Open on judge ↗

Consider an array $A$ with $N$ positive integers. Let $B$ be defined as an array of $N$ integers such that for each $1 \le i \le N$: - $B_i = A_i - 1$, if $A_i$ is even. - $B_i = A_i + 1$, if $A_i$ is odd. You are given an array $C$ of size $2 \cdot N$ which is formed by taking all the elements of the arrays $A$ and $B$ and rearranging them. You need to find the number of distinct arrays $A$ w

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