結果

問題 No.275 中央値を求めよ
ユーザー chike_pluschike_plus
提出日時 2019-03-19 13:30:09
言語 F#
(.NET 7)
結果
AC  
実行時間 82 ms / 1,000 ms
コード長 350 bytes
コンパイル時間 3,316 ms
コンパイル使用メモリ 157,288 KB
実行使用メモリ 26,560 KB
最終ジャッジ日時 2023-10-11 21:04:55
合計ジャッジ時間 8,236 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
26,276 KB
testcase_01 AC 70 ms
24,224 KB
testcase_02 AC 72 ms
24,232 KB
testcase_03 AC 70 ms
24,340 KB
testcase_04 AC 70 ms
24,212 KB
testcase_05 AC 70 ms
24,316 KB
testcase_06 AC 70 ms
26,268 KB
testcase_07 AC 78 ms
24,372 KB
testcase_08 AC 77 ms
22,440 KB
testcase_09 AC 77 ms
24,428 KB
testcase_10 AC 77 ms
26,528 KB
testcase_11 AC 65 ms
26,236 KB
testcase_12 AC 68 ms
24,372 KB
testcase_13 AC 67 ms
22,456 KB
testcase_14 AC 68 ms
22,476 KB
testcase_15 AC 79 ms
24,436 KB
testcase_16 AC 79 ms
24,384 KB
testcase_17 AC 78 ms
26,520 KB
testcase_18 AC 79 ms
24,384 KB
testcase_19 AC 79 ms
26,560 KB
testcase_20 AC 79 ms
24,616 KB
testcase_21 AC 80 ms
24,472 KB
testcase_22 AC 80 ms
24,520 KB
testcase_23 AC 80 ms
24,568 KB
testcase_24 AC 82 ms
24,520 KB
testcase_25 AC 80 ms
24,520 KB
testcase_26 AC 79 ms
24,452 KB
testcase_27 AC 79 ms
24,416 KB
testcase_28 AC 71 ms
24,316 KB
testcase_29 AC 79 ms
24,492 KB
testcase_30 AC 71 ms
24,308 KB
testcase_31 AC 81 ms
24,384 KB
testcase_32 AC 79 ms
24,512 KB
testcase_33 AC 80 ms
26,540 KB
testcase_34 AC 70 ms
24,232 KB
testcase_35 AC 79 ms
24,516 KB
testcase_36 AC 79 ms
24,436 KB
testcase_37 AC 77 ms
24,368 KB
testcase_38 AC 78 ms
24,348 KB
testcase_39 AC 79 ms
24,292 KB
testcase_40 AC 78 ms
24,460 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
  |> 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