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

You must create a class big integer for you to solve this problem in C++
Posted by Phan Hoài Nam (HUFLIT) 21 Sep 2010 09:47
You calculate f2 by this formula: f2 = f1 + f0
f2 may be small enough to be stored by an integer, but f1 and f0 may be very large.
For example:
1 = (-2935892358923598) + (2935892358923599)
Re: You must create a class big integer for you to solve this problem in C++
Posted by Vedernikoff Sergey (HSE: АОП) 21 Sep 2010 22:16
Since you know that

−2·109 ≤ Fk ≤ 2·109 (k = min(i, j, n), …, max(i, j, n)),

the problem is solvable with usual int