Блог пользователя pistone

Автор pistone, 15 лет назад, По-английски

for me it wa quite a problem , since i strictly used C++ to solve it.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

15 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

my fault , sorry 

actually the problem is :  finding the minimum c++ variable type(byte,short,int,long etc)  in which nth fibonacci number can be accomodated .
 
if it cant be accomodated in c++ standard var types then print  "BigInteger" .

15 лет назад, скрыть # |
← Rev. 2  
Проголосовать: нравится 0 Проголосовать: не нравится

You can just generate locally all those Fib numbers and remember n values: ai is such that Fai is a max number that fits in ith type.
After that just some if's.