結果

問題 No.296 n度寝
ユーザー 情報学生情報学生
提出日時 2019-08-24 12:21:40
言語 Haskell
(9.8.2)
結果
WA  
実行時間 -
コード長 776 bytes
コンパイル時間 2,645 ms
コンパイル使用メモリ 158,640 KB
実行使用メモリ 7,340 KB
最終ジャッジ日時 2023-08-03 17:57:50
合計ジャッジ時間 4,326 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE TypeApplications #-}

import Control.Applicative ((<$>))
import Data.Char (isSpace)
import Data.List (unfoldr)
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B

getL :: (ByteString -> [Int]) -> IO [Int]
getL f = f <$> B.getLine

readIL :: (ByteString -> Maybe (Int, ByteString)) -> (ByteString -> [Int])
readIL f = unfoldr g
    where
        g s = do
            (n, s') <- f s
            return (n, B.dropWhile isSpace s')

main :: IO ()
main = putStrLn =<< unlines . solve <$> getL (readIL B.readInt)

solve :: [Int] -> [String]
solve [n, h, m, t] = [x, y]
    where
        p = (n - 1) * t + m
        (a, b) = p `divMod` 60
        c = (a + h) `mod` 24
        x = show c
        y = show b
0