Greedy Thanos
CodeChefOpen on judge ↗
Thanos is week in maths and needs your help. Thanos now wants to destroy the entire universe excluding him, each time he snaps his fingers half of the universe gets destroyed .Help Thanos in finding the minimim number of snaps to destroy the whole universe excluding him . Note :- when the population is odd then the greater half of it is destroyed. eg when p=5,then after one snap remaining popula
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