Created
September 4, 2015 06:02
-
-
Save ardfard/853cfda2e6a3948f59db to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Enter your code here. Read input from STDIN. Print output to STDOUT | |
| {-# Language OverloadedStrings #-} | |
| import Control.Monad | |
| import qualified Data.Text as T | |
| import qualified Data.Text.IO as TIO | |
| import qualified Data.Text.Read as TR | |
| main :: IO() | |
| main = parseInput >>= (mapM_ print) . applySolution | |
| where | |
| applySolution = map solution | |
| parseInput :: IO [[Integer]] | |
| parseInput = do | |
| numCase <- readLn :: IO Int | |
| forM [1..numCase] $ \_ -> do | |
| let parse = sequence . (map TR.decimal) . (T.splitOn " ") | |
| inputs <- fmap parse TIO.getLine | |
| case inputs of | |
| Right xs -> return $ map fst xs | |
| _ -> return [] | |
| -- create your solution here | |
| solution :: [Integer] -> Integer | |
| solution = undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment