We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
AFAIK, there's no easy way to do this problem in C++ with the libraries provided. In real life you'd use a bignum library like GNU MP or Boost.Multiprecision, but those libraries aren't available here.
You can certainly roll your own, but that seems a little extreme.
I've done all the other algorithm problems in C++, but for this one I switched to Java so I could use java.math.BigInteger.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Fibonacci Modified
You are viewing a single comment's thread. Return to all comments →
AFAIK, there's no easy way to do this problem in C++ with the libraries provided. In real life you'd use a bignum library like GNU MP or Boost.Multiprecision, but those libraries aren't available here.
You can certainly roll your own, but that seems a little extreme.
I've done all the other algorithm problems in C++, but for this one I switched to Java so I could use java.math.BigInteger.