Блог пользователя chinaxjh

Автор chinaxjh, история, 3 года назад, По-английски

We define a function $$$f(x)$$$.And we know the function expression as following.

$$$f(x)=f(x-e)+f(x-2) (x>=3)$$$
$$$f(x)=1 (0<x<3)$$$

ps. $$$e$$$ means the natural base. We will give you an interger $$$x(0<x<=1*10^7)$$$.Please give us the $$$f(x)$$$ in 2 seconds.

For example

Input1

14

Output1

38

Input2

5

Output2

3

Thanks for my friend Kevin.He solved this problem and taught me how to solve it.

  • Проголосовать: нравится
  • +4
  • Проголосовать: не нравится

»
3 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Auto comment: topic has been updated by chinaxjh (previous revision, new revision, compare).

»
3 года назад, # |
  Проголосовать: нравится +4 Проголосовать: не нравится

Hi, would you mind sharing me the approach of this problem? Thanks a lot!