結果

問題 No.410 出会い
ユーザー LeonardoneLeonardone
提出日時 2016-08-13 05:38:12
言語 F#
(F# 4.0)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 547 bytes
コンパイル時間 3,591 ms
コンパイル使用メモリ 155,700 KB
実行使用メモリ 27,180 KB
最終ジャッジ日時 2023-09-10 19:56:39
合計ジャッジ時間 6,972 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
24,808 KB
testcase_01 AC 95 ms
25,076 KB
testcase_02 AC 94 ms
24,864 KB
testcase_03 AC 95 ms
23,000 KB
testcase_04 AC 93 ms
24,872 KB
testcase_05 AC 96 ms
26,980 KB
testcase_06 AC 95 ms
24,796 KB
testcase_07 AC 96 ms
25,088 KB
testcase_08 AC 96 ms
22,972 KB
testcase_09 AC 95 ms
24,984 KB
testcase_10 AC 95 ms
24,804 KB
testcase_11 AC 93 ms
25,020 KB
testcase_12 AC 95 ms
26,848 KB
testcase_13 AC 95 ms
26,848 KB
testcase_14 AC 94 ms
25,028 KB
testcase_15 AC 94 ms
25,060 KB
testcase_16 AC 94 ms
25,036 KB
testcase_17 AC 95 ms
24,796 KB
testcase_18 AC 94 ms
24,864 KB
testcase_19 AC 100 ms
27,180 KB
testcase_20 AC 94 ms
25,072 KB
testcase_21 AC 95 ms
26,888 KB
testcase_22 AC 95 ms
24,824 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 diff a b = b - a |> abs
    let diffX = diff Px Qx
    let diffY = diff Py Qy
    (/) (diffX + diffY) 2.0

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