結果

問題 No.734 Careful Engineer
ユーザー taktak
提出日時 2019-02-17 15:43:33
言語 F#
(F# 4.0)
結果
WA  
実行時間 -
コード長 657 bytes
コンパイル時間 14,728 ms
コンパイル使用メモリ 193,336 KB
実行使用メモリ 32,656 KB
最終ジャッジ日時 2023-10-26 02:25:02
合計ジャッジ時間 14,312 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 57 ms
31,076 KB
testcase_07 AC 57 ms
31,076 KB
testcase_08 AC 58 ms
32,656 KB
testcase_09 AC 58 ms
31,076 KB
testcase_10 WA -
testcase_11 AC 59 ms
31,080 KB
testcase_12 AC 60 ms
31,076 KB
testcase_13 AC 59 ms
31,084 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (960 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

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