結果

問題 No.419 直角三角形
ユーザー kuuso1kuuso1
提出日時 2016-09-09 22:31:52
言語 F#
(F# 4.0)
結果
AC  
実行時間 96 ms / 1,000 ms
コード長 390 bytes
コンパイル時間 4,520 ms
コンパイル使用メモリ 173,124 KB
実行使用メモリ 27,168 KB
最終ジャッジ日時 2023-08-10 08:46:49
合計ジャッジ時間 7,240 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
27,052 KB
testcase_01 AC 93 ms
27,112 KB
testcase_02 AC 92 ms
25,092 KB
testcase_03 AC 88 ms
24,972 KB
testcase_04 AC 95 ms
25,048 KB
testcase_05 AC 93 ms
25,096 KB
testcase_06 AC 94 ms
25,080 KB
testcase_07 AC 93 ms
25,232 KB
testcase_08 AC 91 ms
25,112 KB
testcase_09 AC 92 ms
27,016 KB
testcase_10 AC 94 ms
25,136 KB
testcase_11 AC 94 ms
25,156 KB
testcase_12 AC 94 ms
25,192 KB
testcase_13 AC 93 ms
27,104 KB
testcase_14 AC 96 ms
27,168 KB
testcase_15 AC 96 ms
27,132 KB
testcase_16 AC 92 ms
25,164 KB
testcase_17 AC 95 ms
25,088 KB
testcase_18 AC 93 ms
25,120 KB
testcase_19 AC 93 ms
24,976 KB
testcase_20 AC 93 ms
22,948 KB
testcase_21 AC 92 ms
27,104 KB
testcase_22 AC 96 ms
27,024 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

/home/judge/data/code/Main.fs(8,13): warning FS0025: Incomplete pattern matches on this expression. For example, the value '[|_; _; _|]' may indicate a case not covered by the pattern(s).

ソースコード

diff #

open System

let ri () = stdin.ReadLine() |> int
let ria () = stdin.ReadLine().Split() |> Array.map int

type Sol() =
    member this.Solve() = 
        let [|a;b|] = stdin.ReadLine().Split() |> Array.map double |> Array.sort
        let x = b*b - a*a |> sqrt 
        let z = a*a + b*b |> sqrt
        (if a = b then z else x ) |> printfn "%f"
        
let mySol = new Sol()
mySol.Solve()
0