Anupam and Raja
CodeChefOpen on judge ↗
Recently Anupam was working with a function defined as follows: The function takes an integer $N$ as argument. Suppose there are $N$ people sitting in a circular queue numbered $1$ to $N$. The function returns the number of ways we can select a subset of them such that no $2$ selected people are adjacent to each other. Rajarshi heard of this function, and made the following problem: You a
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