|
|
back to boardJava BigInteger can also be useful here.... 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. |
|
|