Submission #1177585


Source Code Expand

import Data.Set (fromList)

main :: IO ()
main = do
    l1 <- getLine
    l2 <- getLine
    let n = read l1
    let as = (map read . words) l2 :: [Int]
    putStrLn $ solve n as

solve :: Int -> [Int] -> String
solve n as = show . countRemain $ (dup, uniq)
    where
        uniq = length $ fromList as
        dup = n - uniq

countRemain :: (Int, Int) -> Int
countRemain (dup, uniq)
    | dup `mod` 2 == 0  = uniq
    | otherwise         = uniq - 1

Submission Info

Submission Time
Task D - Card Eater
User ykarako
Language Haskell (GHC 7.10.3)
Score 400
Code Size 470 Byte
Status AC
Exec Time 570 ms
Memory 31100 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 2
AC × 17
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt
All 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 2 ms 508 KB
00_example_02.txt AC 2 ms 508 KB
01.txt AC 2 ms 892 KB
02.txt AC 29 ms 2428 KB
03.txt AC 2 ms 1020 KB
04.txt AC 5 ms 1148 KB
05.txt AC 2 ms 892 KB
06.txt AC 454 ms 18812 KB
07.txt AC 454 ms 18812 KB
08.txt AC 570 ms 31100 KB
09.txt AC 452 ms 18812 KB
10.txt AC 445 ms 18812 KB
11.txt AC 564 ms 31100 KB
12.txt AC 460 ms 20860 KB
13.txt AC 536 ms 30076 KB
14.txt AC 467 ms 30076 KB
15.txt AC 428 ms 18812 KB