結果
| 問題 | 
                            No.236 鴛鴦茶
                             | 
                    
| コンテスト | |
| ユーザー | 
                             tak
                         | 
                    
| 提出日時 | 2018-04-13 17:55:54 | 
| 言語 | F#  (F# 4.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 350 ms / 2,000 ms | 
| コード長 | 496 bytes | 
| コンパイル時間 | 12,627 ms | 
| コンパイル使用メモリ | 185,672 KB | 
| 実行使用メモリ | 35,264 KB | 
| 最終ジャッジ日時 | 2024-06-28 13:16:12 | 
| 合計ジャッジ時間 | 18,528 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 23 | 
コンパイルメッセージ
復元対象のプロジェクトを決定しています... /home/judge/data/code/main.fsproj を復元しました (280 ms)。 MSBuild のバージョン 17.9.6+a4ecab324 (.NET) main -> /home/judge/data/code/bin/Release/net8.0/main.dll main -> /home/judge/data/code/bin/Release/net8.0/publish/
ソースコード
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"
            
            
            
        
            
tak