Submission #432555
Source Code Expand
{-# LANGUAGE BangPatterns #-} import Data.List import Control.Monad import Control.Applicative main :: IO () main = do [n, a, b] <- map read . words <$> getLine ds <- replicateM n $ words <$> getLine let go !x [] = do case signum x of 1 -> putStrLn $ "East " ++ show x 0 -> print 0 -1 -> putStrLn $ "West " ++ show (abs x) go !x ([s, d]: rest) = let x' = case s of "East" -> x + dx "West" -> x - dx dx = max a $ min b $ read d in go x' rest go 0 ds return ()
Submission Info
Submission Time | |
---|---|
Task | B - 双子とスイカ割り |
User | tanakh |
Language | Haskell (Haskell Platform 2014.2.0.0) |
Score | 100 |
Code Size | 600 Byte |
Status | AC |
Exec Time | 401 ms |
Memory | 1940 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 100 / 100 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample-01.txt, sample-02.txt, sample-03.txt |
All | test-01.txt, test-02.txt, test-03.txt, test-04.txt, test-05.txt, test-06.txt, test-07.txt, test-08.txt, test-09.txt, test-10.txt, test-11.txt, test-12.txt, test-13.txt, test-14.txt, test-15.txt, test-16.txt, test-17.txt, test-18.txt, test-19.txt, test-20.txt, test-21.txt, test-22.txt, test-23.txt, test-24.txt, test-25.txt, test-26.txt, test-27.txt, test-28.txt, test-29.txt, test-30.txt, sample-01.txt, sample-02.txt, sample-03.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
sample-01.txt | AC | 401 ms | 1308 KB |
sample-02.txt | AC | 26 ms | 1328 KB |
sample-03.txt | AC | 28 ms | 1352 KB |
test-01.txt | AC | 25 ms | 1304 KB |
test-02.txt | AC | 26 ms | 1336 KB |
test-03.txt | AC | 28 ms | 1380 KB |
test-04.txt | AC | 31 ms | 1552 KB |
test-05.txt | AC | 28 ms | 1432 KB |
test-06.txt | AC | 28 ms | 1556 KB |
test-07.txt | AC | 28 ms | 1556 KB |
test-08.txt | AC | 28 ms | 1708 KB |
test-09.txt | AC | 30 ms | 1820 KB |
test-10.txt | AC | 30 ms | 1800 KB |
test-11.txt | AC | 32 ms | 1816 KB |
test-12.txt | AC | 30 ms | 1940 KB |
test-13.txt | AC | 31 ms | 1816 KB |
test-14.txt | AC | 30 ms | 1812 KB |
test-15.txt | AC | 32 ms | 1812 KB |
test-16.txt | AC | 33 ms | 1816 KB |
test-17.txt | AC | 34 ms | 1804 KB |
test-18.txt | AC | 29 ms | 1752 KB |
test-19.txt | AC | 28 ms | 1820 KB |
test-20.txt | AC | 30 ms | 1748 KB |
test-21.txt | AC | 29 ms | 1812 KB |
test-22.txt | AC | 31 ms | 1816 KB |
test-23.txt | AC | 33 ms | 1936 KB |
test-24.txt | AC | 28 ms | 1816 KB |
test-25.txt | AC | 29 ms | 1820 KB |
test-26.txt | AC | 30 ms | 1816 KB |
test-27.txt | AC | 37 ms | 1752 KB |
test-28.txt | AC | 31 ms | 1792 KB |
test-29.txt | AC | 31 ms | 1800 KB |
test-30.txt | AC | 31 ms | 1816 KB |