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

Java BigInteger can also be useful here....
Posted by Nisarg Shah 13 Dec 2008 11:25
As mentioned in the previous topic, we just need to store 1/fib(n) and fib(n-1)/fib(n) because fib(i+1)=fib(j)/fib(j-i) - (fib(j-i-1)/fib(j-i))*fib(i) . But I used Java BigInteger to store fib(n) instead of the fractions to maintain precision and it got AC.