結果
問題 | No.275 中央値を求めよ |
ユーザー |
|
提出日時 | 2020-07-04 22:25:10 |
言語 | OCaml (5.2.1) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 294 bytes |
コンパイル時間 | 413 ms |
コンパイル使用メモリ | 21,576 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-09 01:47:21 |
合計ジャッジ時間 | 1,926 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 38 |
ソースコード
let () =Scanf.scanf "%d\n" @@ fun n ->let arr = Array.init n @@ fun _ -> Scanf.scanf "%f " @@ fun f -> f inlet () = Array.fast_sort compare arr inlet len = Array.length arr inPrintf.printf "%.1f\n"(if len mod 2 = 0 then (arr.(len/2-1) +. arr.(len/2)) /. 2. else arr.(len/2))