結果
問題 |
No.734 Careful Engineer
|
ユーザー |
![]() |
提出日時 | 2019-02-17 15:43:33 |
言語 | F# (F# 4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 657 bytes |
コンパイル時間 | 14,950 ms |
コンパイル使用メモリ | 187,000 KB |
実行使用メモリ | 31,104 KB |
最終ジャッジ日時 | 2024-09-25 10:27:53 |
合計ジャッジ時間 | 16,757 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 3 WA * 7 |
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (390 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
type [<Measure>] s = static member toS (x: int) = x * 1<s> type [<Measure>] m = static member m2s (m: int<m>) = m * 60<s/m> static member toM (x: int) = x * 1<m> type [<Measure>] h = static member h2s (h: int<h>) = h * 3600<s/h> static member toH (x: int) = x * 1<h> let solve a b c = let a' = a |> m.m2s let c' = c |> h.h2s let x = (c', a' - b) match x with | _, x when x < 0<s> -> None | x, y when x % y = 0<s> -> Some(x / y) | x, y -> Some(x / y + 1) let A, B, C = let t = stdin.ReadLine().Split() |> Array.map int m.toM t.[0], s.toS t.[1], h.toH t.[2] solve A B C |> function | Some(x) -> x | None -> -1 |> stdout.WriteLine