Submission #185076
Source Code Expand
import Data.List import Control.Applicative import Control.Monad import Text.Printf main = do n <- readLn memo <- sort <$> (replicateM n $ sande <$> getLine) mapM (\(s,e) -> printf "%04d-%04d\n" s e) $ merge (head memo) (tail memo) return () sande xs = (myfloor . read . take 4 $ xs , myceil.read . drop 5 $ xs) myfloor n = if n `mod` 10 < 5 then n `div` 10 * 10 else n `div` 10 * 10 + 5 myceil n | n `mod` 10 == 0 = n | n `mod` 10 <= 5 = n `div` 10 * 10 + 5 | n `mod` 100 > 55 = (n `div` 100 + 1 ) * 100 | otherwise = n `div` 10 * 10 + 10 merge :: (Int,Int) -> [(Int,Int)] -> [(Int,Int)] merge x [] = [x] merge (s0,e0) ((s1,e1):xs) = if e0 >= s1 then if e1 >= e0 then merge (s0,e1) xs else merge (s0,e0) xs else [(s0,e0)] ++ merge (s1,e1) xs
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | ngym |
Language | Haskell (GHC 7.4.1) |
Score | 100 |
Code Size | 948 Byte |
Status | AC |
Exec Time | 658 ms |
Memory | 31904 KB |
Judge Result
Set Name | all | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
all | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, cho_cho_chokudai.txt, chokudai_ga_cho.txt, 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, test_31.txt, test_32.txt, test_33.txt, test_34.txt, test_35.txt, test_36.txt, test_37.txt, test_38.txt, test_39.txt, test_40.txt, test_41.txt, test_42.txt, test_43.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | AC | 44 ms | 1312 KB |
00_sample_02.txt | AC | 26 ms | 1204 KB |
00_sample_03.txt | AC | 25 ms | 1300 KB |
cho_cho_chokudai.txt | AC | 445 ms | 21624 KB |
chokudai_ga_cho.txt | AC | 479 ms | 23584 KB |
test_01.txt | AC | 29 ms | 1828 KB |
test_02.txt | AC | 29 ms | 1820 KB |
test_03.txt | AC | 30 ms | 1828 KB |
test_04.txt | AC | 30 ms | 1808 KB |
test_05.txt | AC | 29 ms | 1832 KB |
test_06.txt | AC | 29 ms | 1820 KB |
test_07.txt | AC | 29 ms | 1832 KB |
test_08.txt | AC | 29 ms | 1856 KB |
test_09.txt | AC | 35 ms | 2216 KB |
test_10.txt | AC | 36 ms | 2340 KB |
test_11.txt | AC | 35 ms | 2232 KB |
test_12.txt | AC | 33 ms | 2080 KB |
test_13.txt | AC | 30 ms | 1828 KB |
test_14.txt | AC | 35 ms | 2188 KB |
test_15.txt | AC | 38 ms | 2328 KB |
test_16.txt | AC | 30 ms | 1812 KB |
test_17.txt | AC | 35 ms | 2208 KB |
test_18.txt | AC | 30 ms | 1816 KB |
test_19.txt | AC | 33 ms | 2076 KB |
test_20.txt | AC | 34 ms | 2212 KB |
test_21.txt | AC | 626 ms | 31800 KB |
test_22.txt | AC | 619 ms | 31864 KB |
test_23.txt | AC | 642 ms | 31852 KB |
test_24.txt | AC | 658 ms | 31784 KB |
test_25.txt | AC | 646 ms | 31784 KB |
test_26.txt | AC | 626 ms | 31788 KB |
test_27.txt | AC | 531 ms | 24804 KB |
test_28.txt | AC | 630 ms | 31780 KB |
test_29.txt | AC | 26 ms | 1192 KB |
test_30.txt | AC | 28 ms | 1680 KB |
test_31.txt | AC | 104 ms | 6308 KB |
test_32.txt | AC | 27 ms | 1708 KB |
test_33.txt | AC | 407 ms | 21596 KB |
test_34.txt | AC | 47 ms | 1312 KB |
test_35.txt | AC | 29 ms | 1944 KB |
test_36.txt | AC | 633 ms | 31904 KB |
test_37.txt | AC | 633 ms | 31764 KB |
test_38.txt | AC | 651 ms | 31780 KB |
test_39.txt | AC | 657 ms | 31764 KB |
test_40.txt | AC | 615 ms | 31780 KB |
test_41.txt | AC | 466 ms | 21544 KB |
test_42.txt | AC | 623 ms | 31824 KB |
test_43.txt | AC | 465 ms | 23720 KB |