Medicine Strength
There are $N$ types of medicines and $M$ types of diseases where medicine types are numbered from $1$ to $N$ and disease types are numbered from $1$ to $M$. You have **infinite** medicines of each type. For every disease $d$, you have a strength $f(d)$. Initially, $f(d) = 0$ for all $1 \le d \le M$. The $i^{th}$ medicine increments your strength for a particular disease (say $x_i$) and decrement
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