Submission #2243021


Source Code Expand

import Data.Maybe
import Data.List

main :: IO ()
main = do
  input <- getContents
  putStrLn $ trim (solve (trim input))

--処理
solve :: String -> String
solve s | x < 10    = show x
        | otherwise = "error"
 where
  [a, b] = fmap read (words s) :: [Int]
  x      = a + b

trimHead :: String -> String
trimHead = dropWhile (\s -> isJust (elemIndex s [' ', '\t', '\n', '\r']))

trim :: String -> String
trim = reverse . trimHead . reverse . trimHead

Submission Info

Submission Time
Task A - Restricted
User kgtkr
Language Haskell (GHC 7.10.3)
Score 100
Code Size 477 Byte
Status AC
Exec Time 1 ms
Memory 508 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 100 / 100
Status
AC × 2
AC × 8
Set Name Test Cases
Sample a01, a02
All a01, a02, b03, b04, b05, b06, b07, b08
Case Name Status Exec Time Memory
a01 AC 1 ms 380 KB
a02 AC 1 ms 380 KB
b03 AC 1 ms 380 KB
b04 AC 1 ms 380 KB
b05 AC 1 ms 508 KB
b06 AC 1 ms 508 KB
b07 AC 1 ms 508 KB
b08 AC 1 ms 380 KB