Magical Coins
CodeChefOpen on judge ↗
Mr.X has 1 magical coin initially with him. With each passing day, the number of coins gets double the value which was on previous day. Now Mr.X is tired and he needs some sleep. When he wakes up after N days, he wants to know how many magic coins are there with him now. Since he is a little weak in maths, therefore he needs your help in counting the number of magic coins. This number can be very
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