Permutations LCS
For two sequences $X$ and $Y$, we define $LCS(X, Y)$ as the length of their longest common subsequence. You are given $4$ integers $N, A, B, C$. Determine if there exist $3$ permutations $P, Q, R$ of integers from $1$ to $N$, such that: - $LCS(P, Q) = A$ - $LCS(P, R) = B$ - $LCS(Q, R) = C$ If such permutations exist, find any such triple of permutations. A permutation $P$ of integers from $1
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