Odd Split
For an array $B$ consisting of **distinct** integers, its number of inversions is equal to the number of pairs $(i, j)$ with $1\le i < j \le M$ such that $B_i > B_j$, where $M$ is the size of $B$. If this number is odd, we will call array $B$ **odd**. Otherwise, we will call it **even**. Let's call a permutation $P$ of integers from $1$ to $K$ **good**, if there exists a way to split it into two
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