fork download
  1. import Control.Monad
  2. import Control.Monad.Instances
  3.  
  4. monkeyNum :: Integer -> Integer
  5. monkeyNum = sum . map ((^ 5) . read . (:[])) . show
  6.  
  7. isMonkey :: Integer -> Bool
  8. isMonkey = monkeyNum >>= (==)
  9.  
  10. main :: IO ()
  11. main = print $ sum $ filter isMonkey [10..200000]
  12.  
Time limit exceeded #stdin #stdout 5s 3700KB
stdin
Standard input is empty
stdout
Standard output is empty