Yet Another Subsequence Problem
CodeChefOpen on judge ↗
We are given two arrays of equal length $N$, say $A$ and $B$, and we need to find all good subsequence of permutation $(1,2,..,N)$. Consider a **non-empty** subsequence of permutation $(1,2,...,N)$ of length k, $(i_1, i_2, i_3, ..., i_k)$. This subsequence is called good if maximum of all elements in the first array at positions $i_1$, $i_2$, ..., $i_k$ is greater than or equal to maximum of the
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