結果

問題 No.609 Noelちゃんと星々
ユーザー pekempeypekempey
提出日時 2017-12-09 03:24:47
言語 Haskell
(9.8.2)
結果
AC  
実行時間 663 ms / 2,000 ms
コード長 198 bytes
コンパイル時間 6,658 ms
コンパイル使用メモリ 157,584 KB
実行使用メモリ 104,592 KB
最終ジャッジ日時 2023-08-20 01:18:55
合計ジャッジ時間 18,882 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 512 ms
94,208 KB
testcase_01 AC 242 ms
52,512 KB
testcase_02 AC 172 ms
43,324 KB
testcase_03 AC 222 ms
49,404 KB
testcase_04 AC 102 ms
30,840 KB
testcase_05 AC 604 ms
100,400 KB
testcase_06 AC 554 ms
95,392 KB
testcase_07 AC 303 ms
57,468 KB
testcase_08 AC 62 ms
19,184 KB
testcase_09 AC 192 ms
45,228 KB
testcase_10 AC 404 ms
85,304 KB
testcase_11 AC 342 ms
61,436 KB
testcase_12 AC 474 ms
92,476 KB
testcase_13 AC 82 ms
26,832 KB
testcase_14 AC 32 ms
16,188 KB
testcase_15 AC 554 ms
96,344 KB
testcase_16 AC 623 ms
103,584 KB
testcase_17 AC 513 ms
95,380 KB
testcase_18 AC 163 ms
41,120 KB
testcase_19 AC 543 ms
95,396 KB
testcase_20 AC 653 ms
104,592 KB
testcase_21 AC 641 ms
104,488 KB
testcase_22 AC 655 ms
104,396 KB
testcase_23 AC 654 ms
104,488 KB
testcase_24 AC 663 ms
104,548 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

main = getLine >> getLine >>= print . solve . map read . words

solve :: [Int] -> Int
solve a = let n = length a; m = (sort a) !! (div n 2) in sum . map abs . map (subtract m) $ a
0