Submission #2555639
Source Code Expand
import Control.Applicative import Control.Monad import Data.List import qualified Data.ByteString.Char8 as B import Debug.Trace import System.IO readInt' :: B.ByteString -> Int readInt' bs | Just (n, _) <- B.readInt bs = n chk _ _ [] = "Yes" chk t' (x', y') ((t, (x,y)):ds) | ((t-t')-(abs(x-x')+abs(y-y')) >= 0 && even ((t-t')-(abs(x-x')+abs(y-y')))) = chk t (x,y) ds | otherwise = "No" main = do hSetBuffering stdout NoBuffering n <- readLn ds <- take n . fmap ( (\[t,x,y]->(readInt' t, (readInt' x, readInt' y))).B.words). B.lines <$> B.getContents putStrLn $ chk 0 (0,0) ds
Submission Info
Submission Time | |
---|---|
Task | ABC086C - Traveling |
User | mick0321 |
Language | Haskell (GHC 7.10.3) |
Score | 300 |
Code Size | 624 Byte |
Status | AC |
Exec Time | 34 ms |
Memory | 4348 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 1 ms | 380 KB |
0_001.txt | AC | 1 ms | 508 KB |
0_002.txt | AC | 1 ms | 508 KB |
1_003.txt | AC | 2 ms | 508 KB |
1_004.txt | AC | 34 ms | 4348 KB |
1_005.txt | AC | 3 ms | 2940 KB |
1_006.txt | AC | 29 ms | 2940 KB |
1_007.txt | AC | 6 ms | 1276 KB |
1_008.txt | AC | 2 ms | 636 KB |
1_009.txt | AC | 2 ms | 892 KB |
1_010.txt | AC | 1 ms | 508 KB |
1_011.txt | AC | 2 ms | 764 KB |
1_012.txt | AC | 2 ms | 508 KB |