結果
| 問題 |
No.296 n度寝
|
| コンテスト | |
| ユーザー |
情報学生
|
| 提出日時 | 2019-08-24 12:21:40 |
| 言語 | Haskell (9.10.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 776 bytes |
| コンパイル時間 | 3,573 ms |
| コンパイル使用メモリ | 180,924 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-13 15:03:45 |
| 合計ジャッジ時間 | 4,232 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 16 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.8.2/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
{-# 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
情報学生