結果
問題 | No.734 Careful Engineer |
ユーザー |
|
提出日時 | 2018-10-01 00:42:24 |
言語 | Haskell (9.10.1) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 609 bytes |
コンパイル時間 | 5,549 ms |
コンパイル使用メモリ | 178,176 KB |
実行使用メモリ | 5,760 KB |
最終ジャッジ日時 | 2025-01-18 00:05:49 |
合計ジャッジ時間 | 6,272 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 11 |
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.10.1/environments/default [1 of 2] Compiling Main ( Main.hs, Main.o ) [2 of 2] Linking a.out
ソースコード
main::IO()main = getContents >>= putStrLn . show . listToValue . (map readDouble) . wordsreadDouble::Char->IntreadDouble = readhours::Int->Inthours x = x * 3600minutes::Int->Intminutes x = x * 60listToValue::Int->IntlistToValue (x:y:z:_)| minutes x == y = -1| result < 0 = -1| otherwise = resultwhere-- calc :: (RealFrac a , Integral b) => a -> a -> a -> bcalc::Int->Int->Int->Intcalc x y z = ceiling ( ( (toDouble (hours z)) / (toDouble ((minutes x) - y))))result = calc x y ztoDouble::Int->DoubletoDouble x = fromIntegral x