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

I solve recurrence equation by using characteristic equation
Posted by BigBin 22 Jul 2008 23:16
I solve recurrence equation by using characteristic equation

F(n) = c1*pow(Phi, n) + c2*pow(phi, n); by

c2 = ( fp*pow(Phi, q) - fq*pow(Phi, p) )/( pow(Phi, q)*pow(phi, p) - pow(Phi, p)*pow(phi, q) );
    c1 = ( fq - c2*pow(phi, q) ) / pow(Phi, q);

i use long double to keep and round the answer but i got WA in test case 12. Anyone can help me please?
Re: I solve recurrence equation by using characteristic equation
Posted by wrbuaa2005 4 Sep 2008 14:13
Me too.. but why???