結果

問題 No.275 中央値を求めよ
ユーザー Yuzu MashiroYuzu Mashiro
提出日時 2021-04-03 16:49:45
言語 Scheme
(Gauche-0.9.14)
結果
AC  
実行時間 26 ms / 1,000 ms
コード長 348 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 5,300 KB
実行使用メモリ 13,092 KB
最終ジャッジ日時 2023-08-26 08:14:16
合計ジャッジ時間 4,254 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
12,832 KB
testcase_01 AC 25 ms
12,872 KB
testcase_02 AC 24 ms
12,828 KB
testcase_03 AC 24 ms
12,860 KB
testcase_04 AC 24 ms
12,628 KB
testcase_05 AC 25 ms
12,808 KB
testcase_06 AC 25 ms
12,856 KB
testcase_07 AC 25 ms
12,964 KB
testcase_08 AC 25 ms
12,664 KB
testcase_09 AC 24 ms
12,688 KB
testcase_10 AC 25 ms
12,880 KB
testcase_11 AC 24 ms
12,616 KB
testcase_12 AC 24 ms
12,704 KB
testcase_13 AC 25 ms
12,864 KB
testcase_14 AC 25 ms
12,724 KB
testcase_15 AC 26 ms
13,080 KB
testcase_16 AC 25 ms
12,936 KB
testcase_17 AC 26 ms
13,092 KB
testcase_18 AC 25 ms
12,936 KB
testcase_19 AC 26 ms
12,776 KB
testcase_20 AC 24 ms
13,056 KB
testcase_21 AC 25 ms
12,940 KB
testcase_22 AC 25 ms
13,004 KB
testcase_23 AC 24 ms
12,908 KB
testcase_24 AC 25 ms
12,672 KB
testcase_25 AC 26 ms
12,852 KB
testcase_26 AC 26 ms
13,032 KB
testcase_27 AC 25 ms
12,796 KB
testcase_28 AC 25 ms
12,716 KB
testcase_29 AC 25 ms
12,888 KB
testcase_30 AC 25 ms
12,932 KB
testcase_31 AC 26 ms
12,816 KB
testcase_32 AC 25 ms
12,880 KB
testcase_33 AC 26 ms
12,912 KB
testcase_34 AC 25 ms
12,636 KB
testcase_35 AC 26 ms
13,012 KB
testcase_36 AC 26 ms
12,804 KB
testcase_37 AC 25 ms
12,892 KB
testcase_38 AC 26 ms
12,712 KB
testcase_39 AC 25 ms
12,708 KB
testcase_40 AC 26 ms
12,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define n (string->number (read-line)))
(define as (sort (map string->number (string-split (read-line) " "))))

(print (cond ((zero? (mod n 2))
              (let* ((ptr (/ n 2))
                     (a (ref as (- ptr 1)))
                     (b (ref as ptr)))
               (/ (+ a b) 2)))
             (else (ref as (- (ceiling (/ n 2)) 1)))))
0