Submission #185073
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 merge (s0,e1) xs else [(s0,e0)] ++ merge (s1,e1) xs
Submission Info
Submission Time | |
---|---|
Task | A - 積雪深差 |
User | ngym |
Language | Haskell (GHC 7.4.1) |
Score | 0 |
Code Size | 870 Byte |
Status | RE |
Exec Time | 40 ms |
Memory | 1192 KB |
Judge Result
Set Name | all | ||
---|---|---|---|
Score / Max Score | 0 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
all | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.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 |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
00_sample_01.txt | RE | 40 ms | 1116 KB |
00_sample_02.txt | RE | 24 ms | 1188 KB |
00_sample_03.txt | RE | 27 ms | 1180 KB |
test_01.txt | RE | 24 ms | 1188 KB |
test_02.txt | RE | 24 ms | 1188 KB |
test_03.txt | RE | 24 ms | 1116 KB |
test_04.txt | RE | 24 ms | 1188 KB |
test_05.txt | RE | 24 ms | 1192 KB |
test_06.txt | RE | 25 ms | 1184 KB |
test_07.txt | RE | 24 ms | 1120 KB |
test_08.txt | RE | 25 ms | 1116 KB |
test_09.txt | RE | 24 ms | 1120 KB |
test_10.txt | RE | 24 ms | 1120 KB |
test_11.txt | RE | 24 ms | 1140 KB |
test_12.txt | RE | 24 ms | 1188 KB |
test_13.txt | RE | 24 ms | 1112 KB |
test_14.txt | RE | 26 ms | 1132 KB |
test_15.txt | RE | 24 ms | 1116 KB |
test_16.txt | RE | 24 ms | 1188 KB |
test_17.txt | RE | 24 ms | 1116 KB |