結果

問題 No.734 Careful Engineer
ユーザー taktak
提出日時 2019-02-17 15:45:07
言語 F#
(.NET 7)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 678 bytes
コンパイル時間 21,547 ms
コンパイル使用メモリ 193,364 KB
実行使用メモリ 32,800 KB
最終ジャッジ日時 2023-10-26 02:27:55
合計ジャッジ時間 8,191 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 59 ms
31,036 KB
testcase_01 AC 59 ms
31,036 KB
testcase_02 AC 57 ms
31,080 KB
testcase_03 AC 59 ms
31,084 KB
testcase_04 AC 58 ms
31,084 KB
testcase_05 AC 59 ms
31,084 KB
testcase_06 AC 58 ms
31,084 KB
testcase_07 AC 58 ms
31,084 KB
testcase_08 AC 57 ms
32,800 KB
testcase_09 AC 58 ms
31,084 KB
testcase_10 AC 59 ms
31,084 KB
testcase_11 AC 59 ms
31,084 KB
testcase_12 AC 58 ms
31,084 KB
testcase_13 AC 57 ms
31,084 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.fsproj を復元しました (1.09 sec)。
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: int64) = x * 1L<s>
type [<Measure>] m =
  static member m2s (m: int64<m>) = m * 60L<s/m>
  static member toM (x: int64) = x * 1L<m>
type [<Measure>] h =
  static member h2s (h: int64<h>) = h * 3600L<s/h>
  static member toH (x: int64) = x * 1L<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 < 0L<s> -> None
  | x, y when x % y = 0L<s> -> Some(x / y)
  | x, y -> Some(x / y + 1L)

let A, B, C =
  let t = stdin.ReadLine().Split() |> Array.map int64
  m.toM t.[0], s.toS t.[1], h.toH t.[2]

solve A B C
|> function | Some(x) -> x | None -> -1L
|> stdout.WriteLine
0