結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
24,888 KB
testcase_01 AC 90 ms
24,960 KB
testcase_02 AC 91 ms
27,016 KB
testcase_03 AC 91 ms
25,036 KB
testcase_04 AC 91 ms
24,924 KB
testcase_05 AC 90 ms
27,080 KB
testcase_06 AC 90 ms
24,888 KB
testcase_07 AC 91 ms
25,044 KB
testcase_08 AC 91 ms
25,024 KB
testcase_09 AC 90 ms
25,036 KB
testcase_10 AC 91 ms
24,876 KB
testcase_11 AC 90 ms
25,032 KB
testcase_12 AC 92 ms
24,968 KB
testcase_13 AC 90 ms
22,888 KB
testcase_14 AC 93 ms
25,052 KB
testcase_15 AC 91 ms
25,064 KB
testcase_16 AC 90 ms
25,080 KB
testcase_17 AC 90 ms
24,976 KB
testcase_18 AC 90 ms
24,968 KB
testcase_19 AC 90 ms
22,912 KB
testcase_20 AC 91 ms
25,148 KB
testcase_21 AC 90 ms
24,916 KB
testcase_22 AC 90 ms
26,920 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 k = abs << (-) k
    let dx = diff Px Qx
    let dy = diff Py Qy
    let sum = (+) dx dy
    (/) sum 2.0

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