You are viewing a single comment's thread. Return to all comments →
Not memoization but works fine.
import Control.Monad import Control.Applicative main = do n <- readLn mapM_ prettyprint =<< map (\x -> fibs !! x) <$> map read <$> replicateM n getLine fibs = 0 : 1 : zipWith (+) fibs (tail fibs) prettyprint n = print $ n `mod` 100000007
Seems like cookies are disabled on this browser, please enable them to open this website
Fibonacci
You are viewing a single comment's thread. Return to all comments →
Not memoization but works fine.