Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

Share your thoughts on this with a beginner.

Правка en4, от black.af, 2020-12-11 19:18:17

[Your text to link here...]Hi everyone! I am a beginner in programming and I would like to have your opinion on this problem. In my opinion the program should return the number of partition of the number of bricks n (those containing only 1 and 2). On the other hand it seems that the sequence of bricks looks like a Fibonacci sequence. I am a bit confused. Please help me!

We build a wall by the brick, the height of the brick is twice as long as the width of the brick, and the height of the wall is equal to the height of the brick. Observe the figure below , 2 bricks has two possible building methods, 3 bricks has three possible building methods. Please design a program, input an non-negative integer less than 40, output the number of possible building methods. When entering 0, ends the loop. Input Your program receives a sequence of positive integers, one per line, each representing the length of a wall. The maximum value for the wall is length 40. The input terminates with a 0 Output For each wall length given in the input, your program must output the corresponding number of different patterns for such a wall in a separate line. See picture below !

Теги #recursion, #dp

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский black.af 2020-12-11 19:18:17 95
en3 Английский black.af 2020-12-11 14:31:45 7
en2 Английский black.af 2020-12-11 14:28:47 67 Tiny change: 'e below**_' -> 'e below**_\nhttps://codeforces.me/4c2684/Screenshot (16).jpg'
en1 Английский black.af 2020-12-11 14:27:03 1193 Initial revision (published)