Lighthouses
There is a straight line with $N$ distant points marked $1, 2, \ldots, N$. The point $i$ is exactly $1$ unit distant along the positive axis from $i - 1$. Some of the points have lighthouses. You are given a binary string $S$ where $S_i = 1$ means that the $i$-th point has a lighthouse, and $S_i = 0$ otherwise. Each of the lighthouses can be set to have any arbitrary non-negative integer power $P
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