Submission #5453462


Source Code Expand

Copy
import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B

main :: IO ()
main = getLine >>= putStrLn . solve

solve :: String -> String
solve s
    | 0 < x && x < 13 && 0 < y && y < 13 = "AMBIGUOUS"
    | 0 < x && x < 13 = "MMYY"
    | 0 < y && y < 13 = "YYMM"
    | otherwise = "NA" 
    where
        (a, b) = splitAt 2 s
        x = read a :: Int
        y = read b :: Int

readLine :: IO [Int]
readLine = unfoldr (fmap (second (maybe B.empty snd . B.uncons)) . B.readInt) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine

Submission Info

Submission Time
Task B - YYMM or MMYY
User lodnix
Language Haskell (GHC 7.10.3)
Score 200
Code Size 632 Byte
Status
Exec Time 1 ms
Memory 508 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 01.txt, 02.txt, 03.txt
All 200 / 200 01.txt, 02.txt, 03.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt
Case Name Status Exec Time Memory
01.txt 1 ms 508 KB
02.txt 1 ms 508 KB
03.txt 1 ms 508 KB
11.txt 1 ms 508 KB
12.txt 1 ms 508 KB
13.txt 1 ms 508 KB
14.txt 1 ms 380 KB
15.txt 1 ms 380 KB
16.txt 1 ms 380 KB
17.txt 1 ms 380 KB