結果

問題 No.598 オーバーフローファンタジー
ユーザー taktak
提出日時 2018-06-19 16:33:49
言語 F#
(F# 4.0)
結果
RE  
実行時間 -
コード長 521 bytes
コンパイル時間 4,310 ms
コンパイル使用メモリ 155,148 KB
実行使用メモリ 26,896 KB
最終ジャッジ日時 2023-09-13 07:09:08
合計ジャッジ時間 8,089 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 78 ms
22,804 KB
testcase_01 AC 79 ms
25,044 KB
testcase_02 AC 80 ms
20,784 KB
testcase_03 AC 81 ms
26,896 KB
testcase_04 AC 79 ms
24,872 KB
testcase_05 AC 78 ms
24,960 KB
testcase_06 AC 79 ms
24,904 KB
testcase_07 AC 78 ms
22,816 KB
testcase_08 AC 78 ms
22,812 KB
testcase_09 AC 78 ms
24,864 KB
testcase_10 AC 79 ms
22,912 KB
testcase_11 AC 79 ms
22,876 KB
testcase_12 AC 83 ms
22,840 KB
testcase_13 RE -
testcase_14 AC 79 ms
22,748 KB
testcase_15 AC 81 ms
24,844 KB
testcase_16 AC 79 ms
24,844 KB
testcase_17 AC 79 ms
24,872 KB
testcase_18 AC 80 ms
24,912 KB
testcase_19 AC 78 ms
24,876 KB
testcase_20 AC 79 ms
24,872 KB
testcase_21 AC 80 ms
24,856 KB
testcase_22 AC 79 ms
22,848 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 AC 81 ms
23,000 KB
testcase_26 AC 81 ms
22,852 KB
testcase_27 AC 79 ms
22,844 KB
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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 2 (n - 1)
    let zero        = 0    
    let calStep diff y =
        match diff % y with
        | 0 -> diff / y
        | _ -> diff / y + 1    
    let attackStep = calStep (x - zero)        a
    let healStep   = calStep (minOverFlow - x) b
    min attackStep healStep     

let R () = stdin.ReadLine () |> int

let N = R ()
let X = R ()
let A = R ()
let B = R ()

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