結果

問題 No.236 鴛鴦茶
ユーザー taktak
提出日時 2018-04-13 17:55:54
言語 F#
(F# 4.0)
結果
AC  
実行時間 93 ms / 2,000 ms
コード長 496 bytes
コンパイル時間 5,463 ms
コンパイル使用メモリ 161,760 KB
実行使用メモリ 26,996 KB
最終ジャッジ日時 2023-09-10 22:16:11
合計ジャッジ時間 7,064 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
26,680 KB
testcase_01 AC 90 ms
26,840 KB
testcase_02 AC 90 ms
24,876 KB
testcase_03 AC 89 ms
24,688 KB
testcase_04 AC 89 ms
26,980 KB
testcase_05 AC 89 ms
24,920 KB
testcase_06 AC 89 ms
24,956 KB
testcase_07 AC 90 ms
26,996 KB
testcase_08 AC 90 ms
24,860 KB
testcase_09 AC 93 ms
26,820 KB
testcase_10 AC 89 ms
24,692 KB
testcase_11 AC 88 ms
22,584 KB
testcase_12 AC 89 ms
24,800 KB
testcase_13 AC 89 ms
26,848 KB
testcase_14 AC 88 ms
22,648 KB
testcase_15 AC 89 ms
24,688 KB
testcase_16 AC 89 ms
26,736 KB
testcase_17 AC 89 ms
26,764 KB
testcase_18 AC 89 ms
24,948 KB
testcase_19 AC 89 ms
24,720 KB
testcase_20 AC 90 ms
24,748 KB
testcase_21 AC 90 ms
26,708 KB
testcase_22 AC 89 ms
24,800 KB
testcase_23 AC 91 ms
24,776 KB
testcase_24 AC 89 ms
24,936 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

let A,B,X,Y = let t = stdin.ReadLine().Split()
                      |> Array.map(float)
              t.[0],t.[1],t.[2],t.[3]

let ajustA = 
    let t = B/A
    if X*t <= Y then Some(X*(1.0+t))
    else             None

let ajustB =
    let t = A/B
    if Y*t <= X then Some(Y*(1.0+t))
    else             None                        

match ajustA,ajustB with
| Some(a),Some(b) -> max a b 
| Some(a),None    -> a 
| None   ,Some(b) -> b 
| None   ,None    -> failwith "error"
|> printfn "%f"
0