Total Meth
CodeChefOpen on judge ↗
Heisenberg has already cooked N packets of Meth and the ith packet contains i grams of Meth. Now after a lots of experiments he formulated a chemical and put it in all the packets. The chemical will increase the weight of the Meth inside packet by a mathematical formula. If the weight previously was X then now after putting the chemical it will become X*f(X). f(X) = No. of 1 bits in binary repres
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