結果

問題 No.598 オーバーフローファンタジー
ユーザー taktak
提出日時 2018-06-19 16:35:56
言語 F#
(F# 4.0)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 553 bytes
コンパイル時間 4,080 ms
コンパイル使用メモリ 153,508 KB
実行使用メモリ 25,064 KB
最終ジャッジ日時 2023-09-13 07:09:20
合計ジャッジ時間 6,903 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
24,832 KB
testcase_01 AC 82 ms
22,900 KB
testcase_02 AC 81 ms
22,836 KB
testcase_03 AC 81 ms
22,860 KB
testcase_04 AC 84 ms
22,876 KB
testcase_05 AC 83 ms
23,004 KB
testcase_06 AC 82 ms
23,024 KB
testcase_07 AC 81 ms
22,844 KB
testcase_08 AC 81 ms
22,904 KB
testcase_09 AC 81 ms
22,908 KB
testcase_10 AC 81 ms
22,828 KB
testcase_11 AC 81 ms
25,064 KB
testcase_12 AC 82 ms
20,836 KB
testcase_13 AC 82 ms
22,884 KB
testcase_14 AC 81 ms
22,900 KB
testcase_15 AC 82 ms
24,968 KB
testcase_16 AC 81 ms
24,904 KB
testcase_17 AC 80 ms
20,936 KB
testcase_18 AC 81 ms
22,860 KB
testcase_19 AC 81 ms
22,896 KB
testcase_20 AC 81 ms
22,852 KB
testcase_21 AC 81 ms
24,988 KB
testcase_22 AC 82 ms
20,760 KB
testcase_23 AC 84 ms
22,908 KB
testcase_24 AC 83 ms
22,860 KB
testcase_25 AC 84 ms
25,012 KB
testcase_26 AC 80 ms
20,868 KB
testcase_27 AC 81 ms
24,888 KB
testcase_28 AC 81 ms
24,892 KB
testcase_29 AC 81 ms
22,872 KB
testcase_30 AC 81 ms
24,896 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

// ----   / ̄ ̄ ̄ ̄ ̄ ̄ ̄/
//-+--+- /  maybe AC. /
// |  | ∠____________/

let f n x a b =
    let minOverFlow = pown 2L (n - 1)
    let zero        = 0L    
    let calStep diff y =
        match diff % y with
        | 0L -> diff / y
        | _  -> diff / y + 1L    
    let attackStep = calStep (x - zero)        a
    let healStep   = calStep (minOverFlow - x) b
    min attackStep healStep     

let R () = stdin.ReadLine ()

let N = R () |> int
let X = R () |> int64
let A = R () |> int64
let B = R () |> int64

f N X A B |> printfn "%i"
0