Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

变态青蛙跳问题.py #3

Open
kyuer opened this issue Aug 30, 2018 · 1 comment
Open

变态青蛙跳问题.py #3

kyuer opened this issue Aug 30, 2018 · 1 comment

Comments

@kyuer
Copy link

kyuer commented Aug 30, 2018

如果是等比数列求和,解法是2^n - 1
return 2**n-1 ,与正确答案不符合。
所以f(n)=f(n-1)+f(n-2)+...+f(1)+f(0)
因为f(n-1)=f(n-2)+f(n-3)+...+f(1)+f(0)
f(0)=1,不是太懂,望指教。

@Simon717
Copy link

因为f(0)=f(1)=1 少加了一个1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants