Selling Donuts
Chef owns a donut shop, which sells $N$ different types of donuts, numbered from $1$ to $N$. Today, he baked $A_i$ donuts of the $i$-th type. $M$ customers will visit the shop. The $i$-th customer wants to buy **exactly one** donut of type $B_i$. If Chef has no remaining donuts of type $i$, the $i$-th customer will become sad. How many customers will become sad? ### Input - The first line of
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