結果

問題 No.275 中央値を求めよ
ユーザー Michae'GonMichae'Gon
提出日時 2017-02-28 18:07:29
言語 F#
(F# 4.0)
結果
AC  
実行時間 84 ms / 1,000 ms
コード長 278 bytes
コンパイル時間 3,779 ms
コンパイル使用メモリ 162,148 KB
実行使用メモリ 26,564 KB
最終ジャッジ日時 2023-09-07 05:56:55
合計ジャッジ時間 7,998 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
24,280 KB
testcase_01 AC 74 ms
24,244 KB
testcase_02 AC 75 ms
24,388 KB
testcase_03 AC 74 ms
26,276 KB
testcase_04 AC 73 ms
26,268 KB
testcase_05 AC 74 ms
24,268 KB
testcase_06 AC 75 ms
26,440 KB
testcase_07 AC 82 ms
24,488 KB
testcase_08 AC 81 ms
24,452 KB
testcase_09 AC 81 ms
24,452 KB
testcase_10 AC 80 ms
26,516 KB
testcase_11 AC 68 ms
24,240 KB
testcase_12 AC 71 ms
24,400 KB
testcase_13 AC 72 ms
22,376 KB
testcase_14 AC 70 ms
20,244 KB
testcase_15 AC 83 ms
26,552 KB
testcase_16 AC 82 ms
22,608 KB
testcase_17 AC 84 ms
24,656 KB
testcase_18 AC 82 ms
26,564 KB
testcase_19 AC 82 ms
24,524 KB
testcase_20 AC 81 ms
24,408 KB
testcase_21 AC 82 ms
24,452 KB
testcase_22 AC 82 ms
22,508 KB
testcase_23 AC 82 ms
24,572 KB
testcase_24 AC 81 ms
24,452 KB
testcase_25 AC 83 ms
24,576 KB
testcase_26 AC 83 ms
24,520 KB
testcase_27 AC 82 ms
24,588 KB
testcase_28 AC 75 ms
24,324 KB
testcase_29 AC 82 ms
24,556 KB
testcase_30 AC 74 ms
24,280 KB
testcase_31 AC 82 ms
24,604 KB
testcase_32 AC 81 ms
24,460 KB
testcase_33 AC 83 ms
24,588 KB
testcase_34 AC 75 ms
26,396 KB
testcase_35 AC 84 ms
24,604 KB
testcase_36 AC 82 ms
24,428 KB
testcase_37 AC 80 ms
26,480 KB
testcase_38 AC 83 ms
24,608 KB
testcase_39 AC 83 ms
24,568 KB
testcase_40 AC 82 ms
24,424 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) F# Compiler version 11.0.0.0 for F# 5.0
Copyright (c) Microsoft Corporation. All Rights Reserved.

ソースコード

diff #

module Main
open System

let n = Console.ReadLine() |> int
let xs = Console.ReadLine().Split(' ')
        |> Array.map float
        |> Array.sort

Console.WriteLine(
    if n % 2 = 0 then
        let i =  n / 2
        (xs.[i] + xs.[i - 1]) / 2.0
    else
        xs.[n / 2]
)
0