結果

問題 No.1010 折って重ねて
ユーザー ikdikd
提出日時 2020-05-03 14:54:27
言語 F#
(F# 4.0)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 902 bytes
コンパイル時間 6,689 ms
コンパイル使用メモリ 165,568 KB
実行使用メモリ 25,620 KB
最終ジャッジ日時 2023-09-02 22:01:54
合計ジャッジ時間 12,804 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 87 ms
23,260 KB
testcase_01 AC 86 ms
21,344 KB
testcase_02 AC 87 ms
25,508 KB
testcase_03 AC 87 ms
23,268 KB
testcase_04 AC 88 ms
23,532 KB
testcase_05 AC 89 ms
23,328 KB
testcase_06 AC 88 ms
23,332 KB
testcase_07 AC 87 ms
23,324 KB
testcase_08 AC 89 ms
23,264 KB
testcase_09 AC 87 ms
25,372 KB
testcase_10 AC 87 ms
23,404 KB
testcase_11 AC 88 ms
25,492 KB
testcase_12 AC 88 ms
23,440 KB
testcase_13 AC 91 ms
21,436 KB
testcase_14 AC 88 ms
23,460 KB
testcase_15 AC 86 ms
23,264 KB
testcase_16 AC 87 ms
25,512 KB
testcase_17 AC 87 ms
25,500 KB
testcase_18 AC 88 ms
25,468 KB
testcase_19 AC 87 ms
25,620 KB
testcase_20 AC 87 ms
25,376 KB
testcase_21 AC 86 ms
23,392 KB
testcase_22 AC 87 ms
23,572 KB
testcase_23 AC 87 ms
23,528 KB
testcase_24 AC 89 ms
25,500 KB
testcase_25 AC 88 ms
25,508 KB
testcase_26 AC 88 ms
23,416 KB
testcase_27 AC 88 ms
23,460 KB
testcase_28 AC 88 ms
25,516 KB
testcase_29 AC 87 ms
23,508 KB
testcase_30 AC 89 ms
25,444 KB
testcase_31 AC 88 ms
23,520 KB
testcase_32 AC 88 ms
25,356 KB
testcase_33 AC 89 ms
23,460 KB
testcase_34 AC 87 ms
23,504 KB
testcase_35 AC 89 ms
23,456 KB
testcase_36 AC 89 ms
25,508 KB
testcase_37 AC 88 ms
23,396 KB
testcase_38 AC 88 ms
25,428 KB
testcase_39 AC 88 ms
25,508 KB
testcase_40 AC 89 ms
23,516 KB
testcase_41 AC 89 ms
23,476 KB
testcase_42 AC 90 ms
23,508 KB
testcase_43 AC 89 ms
25,508 KB
testcase_44 AC 88 ms
23,380 KB
testcase_45 AC 89 ms
23,316 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

/home/judge/data/code/Main.fs(7,9): warning FS0025: Incomplete pattern matches on this expression. For example, the value '[|_; _; _; _|]' may indicate a case not covered by the pattern(s).

ソースコード

diff #

// Learn more about F# at http://fsharp.org

open System

[<EntryPoint>]
let main argv =
    let [| xx; yy; h |] = stdin.ReadLine().Split() |> Array.map float
    let x, y = Math.Min(xx, yy), Math.Max(xx, yy)

    let ans =
        seq {
            for a in 0 .. 20 do
                // x を a 回折れるか
                // x / 2^(a - 1) > h * 2^(a - 1)
                let p2 = Math.Pow(2.0, float (a) - 1.0)
                if a = 0 || x * 1000.0 / p2 > h * p2 then
                    for b in 0 .. 20 do
                        let q2 = Math.Pow(2.0, float (b) - 1.0)
                        if b = 0
                           || y * 1000.0 / q2 > h * Math.Pow(2.0, float (a))
                                                * q2 then yield (a, b)
        }
        |> Seq.map (fun tup -> (fst tup) + (snd tup))
        |> Seq.max
    printfn "%d" ans
    0 // return an integer exit code
0