Submission #33541


Source Code Expand

Copy
import Control.Arrow

main :: IO ()
main = interact $ lines >>> map (words >>> map read) >>> solve >>> show >>> (++"\n")

solve :: [[Int]] -> Int
solve [e,[b],l] = ans b l $ length $ filter (==(True,True)) $ map (flip elem e &&& flip elem l) [0..9]

ans :: Int -> [Int] -> Int -> Int
ans b l 5 = if elem b l then 2 else 3
ans _ _ 6 = 1
ans _ _ x
  | x < 3     = 0
  | otherwise = 8-x

Submission Info

Submission Time
Task A - 宝くじ
User phi16
Language Haskell (GHC 7.4.1)
Score 100
Code Size 396 Byte
Status AC
Exec Time 39 ms
Memory 1432 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 51
Set Name Test Cases
All 00_1_01.txt, 00_1_02.txt, 00_2_01.txt, 00_2_02.txt, 00_3_01.txt, 00_3_02.txt, 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 00_sample_05.txt, 01_rand_00.txt, 01_rand_01.txt, 01_rand_02.txt, 01_rand_03.txt, 01_rand_04.txt, 01_rand_05.txt, 01_rand_06.txt, 01_rand_07.txt, 01_rand_08.txt, 01_rand_09.txt, 01_rand_10.txt, 01_rand_11.txt, 01_rand_12.txt, 01_rand_13.txt, 01_rand_14.txt, 01_rand_15.txt, 01_rand_16.txt, 01_rand_17.txt, 01_rand_18.txt, 01_rand_19.txt, 01_rand_20.txt, 01_rand_21.txt, 01_rand_22.txt, 01_rand_23.txt, 01_rand_24.txt, 01_rand_25.txt, 01_rand_26.txt, 01_rand_27.txt, 01_rand_28.txt, 01_rand_29.txt, 01_rand_30.txt, 01_rand_31.txt, 01_rand_32.txt, 01_rand_33.txt, 01_rand_34.txt, 01_rand_35.txt, 01_rand_36.txt, 01_rand_37.txt, 01_rand_38.txt, 01_rand_39.txt
Case Name Status Exec Time Memory
00_1_01.txt AC 26 ms 1420 KB
00_1_02.txt AC 25 ms 1404 KB
00_2_01.txt AC 25 ms 1336 KB
00_2_02.txt AC 25 ms 1340 KB
00_3_01.txt AC 25 ms 1396 KB
00_3_02.txt AC 25 ms 1364 KB
00_sample_01.txt AC 25 ms 1336 KB
00_sample_02.txt AC 27 ms 1340 KB
00_sample_03.txt AC 25 ms 1424 KB
00_sample_04.txt AC 25 ms 1344 KB
00_sample_05.txt AC 25 ms 1404 KB
01_rand_00.txt AC 25 ms 1340 KB
01_rand_01.txt AC 25 ms 1336 KB
01_rand_02.txt AC 25 ms 1364 KB
01_rand_03.txt AC 25 ms 1340 KB
01_rand_04.txt AC 25 ms 1316 KB
01_rand_05.txt AC 25 ms 1332 KB
01_rand_06.txt AC 24 ms 1344 KB
01_rand_07.txt AC 25 ms 1336 KB
01_rand_08.txt AC 27 ms 1428 KB
01_rand_09.txt AC 26 ms 1424 KB
01_rand_10.txt AC 28 ms 1428 KB
01_rand_11.txt AC 25 ms 1356 KB
01_rand_12.txt AC 26 ms 1396 KB
01_rand_13.txt AC 25 ms 1424 KB
01_rand_14.txt AC 25 ms 1368 KB
01_rand_15.txt AC 27 ms 1428 KB
01_rand_16.txt AC 39 ms 1336 KB
01_rand_17.txt AC 26 ms 1332 KB
01_rand_18.txt AC 25 ms 1332 KB
01_rand_19.txt AC 26 ms 1336 KB
01_rand_20.txt AC 25 ms 1340 KB
01_rand_21.txt AC 25 ms 1336 KB
01_rand_22.txt AC 25 ms 1336 KB
01_rand_23.txt AC 25 ms 1336 KB
01_rand_24.txt AC 27 ms 1432 KB
01_rand_25.txt AC 25 ms 1340 KB
01_rand_26.txt AC 25 ms 1336 KB
01_rand_27.txt AC 26 ms 1340 KB
01_rand_28.txt AC 24 ms 1424 KB
01_rand_29.txt AC 25 ms 1364 KB
01_rand_30.txt AC 24 ms 1428 KB
01_rand_31.txt AC 26 ms 1400 KB
01_rand_32.txt AC 26 ms 1336 KB
01_rand_33.txt AC 25 ms 1404 KB
01_rand_34.txt AC 25 ms 1340 KB
01_rand_35.txt AC 26 ms 1396 KB
01_rand_36.txt AC 27 ms 1340 KB
01_rand_37.txt AC 26 ms 1416 KB
01_rand_38.txt AC 26 ms 1356 KB
01_rand_39.txt AC 26 ms 1332 KB