#P4133. [BJOI2012] 最多的方案
[BJOI2012] 最多的方案
Description
{{The second stage is related to the famous Fibonacci sequence. Every OIer on Earth knows:
$$F_n = \begin{cases} 1 & (n \le 2) \\ F_{n-1}+F_{n-2} & (n \ge 3) \end{cases}$$Each term is called a Fibonacci number.
Now given a positive integer , it can be written as a sum of some Fibonacci numbers. If we require that in each representation the Fibonacci numbers are distinct (no repetition), then for a given , how many different ways can it be written?}}
Input Format
{{A single integer .}}
Output Format
{{Output a single integer representing the number of ways.}}
16
4
Hint
{{Hint: 16 = 3 + 13 = 3 + 5 + 8 = 1 + 2 + 13 = 1 + 2 + 5 + 8.
Constraints
For 30% of the testdata, .
For 100% of the testdata, .}}
Translated by ChatGPT 5
京公网安备 11011102002149号