Submission #123125


Source Code Expand

Copy
import Data.List
import Control.Parallel

parallelmap :: (a -> b) -> [a] -> [b]
parallelmap f [] = []
parallelmap f (x:xs) = fx `par` fxs `pseq` (fx:fxs) where
    fx = f x
    fxs = parallelparallelMap f xs

main :: IO ()
main = do nk <- getLine
          rs <- getLine
          print $ maximum (parallelMap (foldl acc 0) (getPermitations rs nk)) where
              acc :: Float -> String -> Float
              acc n m = (n + (read m)) / 2
              getPermitations :: String -> String -> [[String]]
              getPermitations rs nk = parallelMap (take (getSndInt nk)) (permutations (words rs)) where
                  getSndInt :: String -> Int
                  getSndInt nk =  read $ last $ words nk

Submission Info

Submission Time
Task C - AtCoderプログラミング講座
User orumin
Language Haskell (GHC 7.4.1)
Score 0
Code Size 733 Byte
Status CE

Compile Error

Main.hs:8:11: Not in scope: `parallelparallelMap'

Main.hs:13:28:
    Not in scope: `parallelMap'
    Perhaps you meant `parallelmap' (line 5)

Main.hs:17:39:
    Not in scope: `parallelMap'
    Perhaps you meant `parallelmap' (line 5)