← All problemsSign in

Building Towers

CodeChefRating 1693Open on judge ↗

Chef is given a contract to build towers in Chefland which are made by stacking blocks one above the other. Initially, there is only $1$ block in the inventory and no tower has been built. Chef follows the following $2$ steps in each operation: - Either build a new tower or update an existing tower that has been built in previous operations using **any** number of blocks currently present in the

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