← All problemsSign in

Breezy Mode Problem

CodeChefRating 2344Open on judge ↗

For an array $B$, let $f(B) = $ the number of occurrences of the mode$^\dagger$ in $B$. For example, $f([2]) = 1, f([2, 3, 3]) = 2, f([3, 3, 3, 4, 4, 4]) = 3$. You’re given an array $A$ of length $N$ and $Q$ queries of the following type: - $P$ $X$: Given integers $P$ and $X$, - Set $A_P = X$; - Find the **minimum** value of $\displaystyle{\sum^{N}_{i=1} f([A_1,A_2,\ldots,A_i])}$ for any **

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start