ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1133. Fibonacci Sequence

Vladimir Yakovlev (USU) Re: Please help me Wa15, in c++ with BINARY SEARCH [3] // Problem 1133. Fibonacci Sequence 24 Jun 2010 20:05
Try this test:
1 1 3 2 2
Qafqaz_Ferhad Cebiyev Re: Please help me Wa15, in c++ with BINARY SEARCH // Problem 1133. Fibonacci Sequence 24 Jun 2010 23:10
Oqromnaya Spasibo  Vladimir Yakovlev. You are GREAT.
What should it give you?
Regarding 1 1 3 2 2, it means that first element is 1, and third element is 2.
Since first+second=third, second is obviously 1. And that is the answer.
Howevewer, mine solution is okay with this test and still WA15 for now.
fibonacci(N) = Nth term in fibonacci series
fibonacci(N) = fibonacci(N - 1) + fibonacci(N - 2);
whereas, fibonacci(0) = 0 and fibonacci(1) = 1
http://www.techcrashcourse.com/2014/10/c-program-to-generate-fibonacci-series.html
http://www.techcrashcourse.com/2015/03/c-program-fibonacci-series-using-recursion.html