結果

問題 No.410 出会い
ユーザー LeonardoneLeonardone
提出日時 2016-08-13 05:09:41
言語 F#
(F# 4.0)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 541 bytes
コンパイル時間 5,716 ms
コンパイル使用メモリ 159,300 KB
実行使用メモリ 26,912 KB
最終ジャッジ日時 2023-09-10 19:56:17
合計ジャッジ時間 9,007 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
24,784 KB
testcase_01 AC 92 ms
24,784 KB
testcase_02 AC 94 ms
24,960 KB
testcase_03 AC 93 ms
26,804 KB
testcase_04 AC 94 ms
24,724 KB
testcase_05 AC 94 ms
24,764 KB
testcase_06 AC 93 ms
24,668 KB
testcase_07 AC 94 ms
22,804 KB
testcase_08 AC 93 ms
24,764 KB
testcase_09 AC 93 ms
22,672 KB
testcase_10 AC 95 ms
26,912 KB
testcase_11 AC 95 ms
25,040 KB
testcase_12 AC 94 ms
24,852 KB
testcase_13 AC 94 ms
26,812 KB
testcase_14 AC 93 ms
24,728 KB
testcase_15 AC 98 ms
24,652 KB
testcase_16 AC 94 ms
26,896 KB
testcase_17 AC 93 ms
26,696 KB
testcase_18 AC 93 ms
22,612 KB
testcase_19 AC 95 ms
24,856 KB
testcase_20 AC 95 ms
24,752 KB
testcase_21 AC 93 ms
24,748 KB
testcase_22 AC 93 ms
24,768 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

// yukicoder My Practice
// author: Leonardone @ NEETSDKASU

let get () =
    stdin.ReadLine().Split [|' '|]
    |> Array.map float

let getValues () =
    match get () with
    | [|x; y|] -> (x, y)
    | _ -> failwith "Error"

let getInputs () =
    let (Px, Py) = getValues ()
    let (Qx, Qy) = getValues ()
    (Px, Py, Qx, Qy)

let solve (Px, Py, Qx, Qy) =
    let diffX = abs <| Px - Qx
    let diffY = abs <| Py - Qy
    (diffX + diffY) / 2.0

[<EntryPoint>]
let main _ =
    getInputs ()
    |> solve
    |> printfn "%.1f"
    0
    
0