Parity Permutation
You are given an array $A$ of length $N$ containing **distinct** integers and an integer $K$ (either $0$ or $1$). Your task is to find the total number of permutations of array $A$ such that for **all** pairs $(i, j)$ with $1 \leq i \lt j \leq N$, and $(i + j)$ being an **odd** number: - $(A_i+A_j) \% 2$ $= K$ You should output the count of such permutations modulo $10^9+7$. ### Input - The f
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.
Sign in to chat with the tutor and save your progress.
Sign in to start