結果

問題 No.275 中央値を求めよ
ユーザー chike_pluschike_plus
提出日時 2019-03-19 13:29:20
言語 F#
(F# 4.0)
結果
AC  
実行時間 84 ms / 1,000 ms
コード長 368 bytes
コンパイル時間 3,172 ms
コンパイル使用メモリ 154,864 KB
実行使用メモリ 26,756 KB
最終ジャッジ日時 2023-10-11 21:04:45
合計ジャッジ時間 8,061 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
24,344 KB
testcase_01 AC 71 ms
24,324 KB
testcase_02 AC 72 ms
24,368 KB
testcase_03 AC 72 ms
26,376 KB
testcase_04 AC 72 ms
24,304 KB
testcase_05 AC 72 ms
24,444 KB
testcase_06 AC 74 ms
24,328 KB
testcase_07 AC 84 ms
26,748 KB
testcase_08 AC 79 ms
24,540 KB
testcase_09 AC 80 ms
24,680 KB
testcase_10 AC 79 ms
24,480 KB
testcase_11 AC 69 ms
24,360 KB
testcase_12 AC 69 ms
22,276 KB
testcase_13 AC 68 ms
24,432 KB
testcase_14 AC 68 ms
22,460 KB
testcase_15 AC 80 ms
24,696 KB
testcase_16 AC 80 ms
24,472 KB
testcase_17 AC 80 ms
24,624 KB
testcase_18 AC 79 ms
26,456 KB
testcase_19 AC 80 ms
26,624 KB
testcase_20 AC 79 ms
24,484 KB
testcase_21 AC 79 ms
24,588 KB
testcase_22 AC 80 ms
24,528 KB
testcase_23 AC 81 ms
26,640 KB
testcase_24 AC 80 ms
24,380 KB
testcase_25 AC 81 ms
24,456 KB
testcase_26 AC 80 ms
24,524 KB
testcase_27 AC 80 ms
24,616 KB
testcase_28 AC 73 ms
26,344 KB
testcase_29 AC 82 ms
26,756 KB
testcase_30 AC 73 ms
24,192 KB
testcase_31 AC 79 ms
24,552 KB
testcase_32 AC 79 ms
24,568 KB
testcase_33 AC 80 ms
24,576 KB
testcase_34 AC 72 ms
24,400 KB
testcase_35 AC 79 ms
22,704 KB
testcase_36 AC 79 ms
26,560 KB
testcase_37 AC 79 ms
26,676 KB
testcase_38 AC 79 ms
24,448 KB
testcase_39 AC 80 ms
26,488 KB
testcase_40 AC 82 ms
24,508 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(3,3): warning FS0020: The result of this expression has type 'string' and is implicitly ignored. Consider using 'ignore' to discard this value explicitly, e.g. 'expr |> ignore', or 'let' to bind the result to a name, e.g. 'let result = expr'.

ソースコード

diff #

let ``No.275 中央値を求めよ``() =

  stdin.ReadLine();
  stdin.ReadLine().Split(' ')
  |> Array.map (fun s -> s |> int)
  |> Array.sort
  |> Array.toList
  |> fun l -> 
    match (l.Length % 2) with
    | 0 -> (float(l.[l.Length/2-1] ) + float(l.[l.Length/2])) / 2.
    | _ -> float (l.[ l.Length / 2 ])
  |> stdout.WriteLine

``No.275 中央値を求めよ``()
0