Of What Holds the Universe
CodeChefOpen on judge ↗
Dr Brand has realized the connection between the gravity equation and $3$-regular numbers. A $3$-regular number is a number which can be written as a sum of distinct powers of $3$. For example: $1$, $3$, $28$, $273$ are $3$-regular numbers: - $1=1$ - $3=3$ - $28=1+27$ - $273=3+27+243$ It can be proved that $2$, $5$ and $26$ are not $3$-regular numbers. Given a number $n$, calculate
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