Submission #308765
Source Code Expand
import Control.Applicative import Data.List main = do str <- getContents let times = tail $ lines str let pairs = sort $ map mkpair times print pairs print_loop $ loop pairs [] mkpair str = (normalize (kirisage st), normalize (kiriage ed)) where [st, ed] = map read $ [take 4 str, drop 5 str] normalize n = if drop 2 (show n) == "60" then n - 60 + 100 else n kiriage n = if n `mod` 5 == 0 then n else n + (5 - n `mod` 5) kirisage n = if n `mod` 5 == 0 then n else n - (n `mod` 5) myprint n = putStr $ replicate (4 - length s) '0' ++ s where s = show n loop [] acc = acc loop ((st, ed) : rest) acc = loop rest (update st ed acc) update st ed acc = f r where r = find (\(a, b) -> st <= b) acc f Nothing = acc ++ [(st,ed)] f (Just (a,b)) = sort $ (a, max b ed) : delete (a,b) acc print_loop [] = return () print_loop ((st, ed) : rest) = do myprint st putStr "-" myprint ed putStrLn "" print_loop rest
Submission Info
Submission Time | |
---|---|
Task | D - 感雨時刻の整理 |
User | lambdataro |
Language | Haskell (GHC 7.4.1) |
Score | 0 |
Code Size | 1018 Byte |
Status | WA |
Exec Time | 849 ms |
Memory | 27564 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, 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 | WA | 26 ms | 1132 KB |
00_sample_02.txt | WA | 25 ms | 1040 KB |
00_sample_03.txt | WA | 28 ms | 1172 KB |
cho_cho_chokudai.txt | WA | 497 ms | 8288 KB |
chokudai_ga_cho.txt | WA | 535 ms | 9116 KB |
test_01.txt | WA | 29 ms | 1568 KB |
test_02.txt | WA | 29 ms | 1624 KB |
test_03.txt | WA | 31 ms | 1628 KB |
test_04.txt | WA | 31 ms | 1696 KB |
test_05.txt | WA | 30 ms | 1628 KB |
test_06.txt | WA | 32 ms | 1656 KB |
test_07.txt | WA | 31 ms | 1692 KB |
test_08.txt | WA | 31 ms | 1624 KB |
test_09.txt | WA | 39 ms | 2140 KB |
test_10.txt | WA | 40 ms | 2268 KB |
test_11.txt | WA | 38 ms | 2204 KB |
test_12.txt | WA | 36 ms | 2040 KB |
test_13.txt | WA | 30 ms | 1780 KB |
test_14.txt | WA | 39 ms | 2144 KB |
test_15.txt | WA | 40 ms | 2272 KB |
test_16.txt | WA | 30 ms | 1820 KB |
test_17.txt | WA | 38 ms | 2136 KB |
test_18.txt | WA | 31 ms | 1756 KB |
test_19.txt | WA | 35 ms | 2044 KB |
test_20.txt | WA | 37 ms | 2016 KB |
test_21.txt | WA | 807 ms | 27532 KB |
test_22.txt | WA | 796 ms | 26460 KB |
test_23.txt | WA | 810 ms | 27484 KB |
test_24.txt | WA | 844 ms | 27484 KB |
test_25.txt | WA | 834 ms | 27564 KB |
test_26.txt | WA | 846 ms | 27488 KB |
test_27.txt | WA | 590 ms | 12120 KB |
test_28.txt | WA | 824 ms | 27488 KB |
test_29.txt | WA | 25 ms | 1060 KB |
test_30.txt | WA | 28 ms | 1500 KB |
test_31.txt | WA | 140 ms | 4956 KB |
test_32.txt | WA | 28 ms | 1568 KB |
test_33.txt | WA | 549 ms | 19292 KB |
test_34.txt | WA | 25 ms | 1112 KB |
test_35.txt | WA | 32 ms | 1760 KB |
test_36.txt | WA | 790 ms | 27488 KB |
test_37.txt | WA | 849 ms | 27484 KB |
test_38.txt | WA | 804 ms | 27488 KB |
test_39.txt | WA | 819 ms | 26456 KB |
test_40.txt | WA | 771 ms | 25504 KB |
test_41.txt | WA | 485 ms | 8288 KB |
test_42.txt | WA | 776 ms | 27480 KB |
test_43.txt | WA | 525 ms | 9052 KB |