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

Take care of your Binary Search !!!!!!!
Posted by Eazy jobb 28 Sep 2011 11:34
for(int m=i+2;m<=j;m++)
    if((m-i)%2==1)
    {
        t2+=t1;
        if(t2<-8000000000LL||(t2>8000000000LL))//Look at this line.
            break;
    }
    else
    {
        t1+=t2;
        if(t1<-8000000000LL||(t1>8000000000LL))//Look at this line.
            break;
    }

----
    Sorry for my bad English
Re: Take care of your Binary Search !!!!!!!
Posted by GastonFontenla 13 Jun 2016 14:12
You can also do equation system (IDK if it's the correct name). You can make two equations, with two incognitas. It can be solved because you have the same amount of equations and incognitas. Be careful, it's easier with java big integer rather than C++ long long or long double.