結果

問題 No.275 中央値を求めよ
ユーザー 34056915823405691582
提出日時 2017-01-18 22:13:01
言語 Haskell
(9.6.2)
結果
AC  
実行時間 13 ms / 1,000 ms
コード長 301 bytes
コンパイル時間 2,923 ms
コンパイル使用メモリ 159,768 KB
実行使用メモリ 11,880 KB
最終ジャッジ日時 2023-09-07 05:47:26
合計ジャッジ時間 4,346 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
7,516 KB
testcase_01 AC 3 ms
7,548 KB
testcase_02 AC 4 ms
8,688 KB
testcase_03 AC 3 ms
7,492 KB
testcase_04 AC 3 ms
7,556 KB
testcase_05 AC 3 ms
7,612 KB
testcase_06 AC 4 ms
8,276 KB
testcase_07 AC 12 ms
11,604 KB
testcase_08 AC 5 ms
9,144 KB
testcase_09 AC 5 ms
9,564 KB
testcase_10 AC 5 ms
9,592 KB
testcase_11 AC 2 ms
7,380 KB
testcase_12 AC 2 ms
7,332 KB
testcase_13 AC 3 ms
7,388 KB
testcase_14 AC 3 ms
7,360 KB
testcase_15 AC 12 ms
11,860 KB
testcase_16 AC 12 ms
11,760 KB
testcase_17 AC 12 ms
11,728 KB
testcase_18 AC 7 ms
11,588 KB
testcase_19 AC 12 ms
11,696 KB
testcase_20 AC 12 ms
11,712 KB
testcase_21 AC 8 ms
11,680 KB
testcase_22 AC 12 ms
11,852 KB
testcase_23 AC 12 ms
11,620 KB
testcase_24 AC 5 ms
10,444 KB
testcase_25 AC 13 ms
11,824 KB
testcase_26 AC 12 ms
11,668 KB
testcase_27 AC 13 ms
11,756 KB
testcase_28 AC 4 ms
8,412 KB
testcase_29 AC 7 ms
11,788 KB
testcase_30 AC 3 ms
8,352 KB
testcase_31 AC 12 ms
11,868 KB
testcase_32 AC 5 ms
9,360 KB
testcase_33 AC 12 ms
11,880 KB
testcase_34 AC 3 ms
8,404 KB
testcase_35 AC 12 ms
11,604 KB
testcase_36 AC 7 ms
11,688 KB
testcase_37 AC 5 ms
9,440 KB
testcase_38 AC 5 ms
10,244 KB
testcase_39 AC 6 ms
11,116 KB
testcase_40 AC 13 ms
11,740 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Loaded package environment from /home/judge/.ghc/x86_64-linux-9.6.1/environments/default
[1 of 2] Compiling Main             ( Main.hs, Main.o )
[2 of 2] Linking a.out

ソースコード

diff #

import Data.List (sort)
import Data.Functor ((<$>))

median [x] = x
median [x,y] = (x+y)/2.0
median xs = median $ droplast $ tail xs where
  droplast [x] = []
  droplast (x:xs') = x:droplast xs'

main = do
  getLine
  show . median . map fromIntegral . sort . map read . words <$> getLine >>= putStrLn
0