I - MEX is Fun
CodeChefOpen on judge ↗
Given two sequences $A$ and $B$ of length $N$, you need to perform the following operation to construct an array $C$ of length $N$: - For all indices $i$ ($1 \leq i \leq N$), set $C_i$ to either $A_i$ or $B_i$. Your task is to find the maximum value of $\text{MEX}(C_1, C_2, \ldots, C_i)$ for each $1 \leq i \leq N$ **independently**. Here $\text{MEX}$ (Minimum Excludant) of a sequence is the s
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