結果

問題 No.609 Noelちゃんと星々
ユーザー ducktailducktail
提出日時 2017-12-18 23:11:15
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 225 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 5,296 KB
実行使用メモリ 21,352 KB
最終ジャッジ日時 2023-08-22 06:07:06
合計ジャッジ時間 5,042 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
18,840 KB
testcase_01 AC 74 ms
15,528 KB
testcase_02 AC 55 ms
15,364 KB
testcase_03 AC 71 ms
15,704 KB
testcase_04 AC 48 ms
14,044 KB
testcase_05 AC 159 ms
21,172 KB
testcase_06 AC 133 ms
19,472 KB
testcase_07 AC 85 ms
16,716 KB
testcase_08 AC 36 ms
14,096 KB
testcase_09 AC 65 ms
15,888 KB
testcase_10 AC 107 ms
18,132 KB
testcase_11 AC 102 ms
18,060 KB
testcase_12 AC 122 ms
18,460 KB
testcase_13 AC 39 ms
14,172 KB
testcase_14 AC 24 ms
12,996 KB
testcase_15 AC 134 ms
20,784 KB
testcase_16 AC 162 ms
21,160 KB
testcase_17 AC 125 ms
19,000 KB
testcase_18 AC 53 ms
15,288 KB
testcase_19 AC 131 ms
20,764 KB
testcase_20 AC 164 ms
21,152 KB
testcase_21 AC 167 ms
21,352 KB
testcase_22 AC 165 ms
21,196 KB
testcase_23 AC 165 ms
21,192 KB
testcase_24 AC 165 ms
21,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(use srfi-1)

(define (main args)
  (let* ([n (read)]
         [ls (sort (list-tabulate n (lambda (_) (read))))]
         [v (list-ref ls (quotient n 2))])
    (print
     (apply + (map (lambda (x) (abs (- x v))) ls))))
  0)
0