結果

問題 No.734 Careful Engineer
コンテスト
ユーザー tak
提出日時 2019-02-17 15:43:33
言語 F#
(F# 10.0)
コンパイル:
fsharp_c _filename_
実行:
/usr/bin/dotnet_wrap
結果
RE  
実行時間 -
コード長 657 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 13,028 ms
コンパイル使用メモリ 207,580 KB
実行使用メモリ 38,528 KB
最終ジャッジ日時 2026-04-12 14:55:39
合計ジャッジ時間 15,300 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 3 WA * 7 RE * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (219 ミリ秒)。
  main -> /home/judge/data/code/bin/Release/net10.0/main.dll
  main -> /home/judge/data/code/bin/Release/net10.0/publish/

ソースコード

diff #
raw source code

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
0