結果

問題 No.652 E869120 and TimeZone
ユーザー aimy
提出日時 2018-02-25 00:37:00
言語 Haskell
(9.10.1)
結果
WA  
実行時間 -
コード長 434 bytes
コンパイル時間 6,464 ms
コンパイル使用メモリ 172,800 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-17 13:44:21
合計ジャッジ時間 2,744 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 5 WA * 25
権限があれば一括ダウンロードができます
コンパイルメッセージ
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

ソースコード

diff #

import Data.Char

main = do
  [a,b,s] <- words <$> getLine
  let m = read a * 60 + read b
  let sig = if any (=='+') s then 1 else (-1)
  let d = sig * (read $ takeWhile isDigit $ dropWhile (not.isDigit) s) - 9
  let f = if any (=='.') s then True else False
  let m' = mod (m + d * 60 + if f then 30 else 0 + 1440) 1440
  putStrLn $ show2 (div m' 60) ++ ":" ++ show2 (mod m' 60)

show2 = reverse . take 2 . reverse . ("0" ++) . show 
0