結果

問題 No.275 中央値を求めよ
ユーザー RinRin
提出日時 2015-09-04 22:45:54
言語 Scheme
(Gauche-0.9.13)
結果
AC  
実行時間 21 ms / 1,000 ms
コード長 609 bytes
コンパイル時間 371 ms
コンパイル使用メモリ 5,328 KB
実行使用メモリ 13,996 KB
最終ジャッジ日時 2023-09-07 04:35:41
合計ジャッジ時間 2,983 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 18 ms
11,840 KB
testcase_01 AC 19 ms
11,864 KB
testcase_02 AC 19 ms
12,012 KB
testcase_03 AC 18 ms
11,952 KB
testcase_04 AC 18 ms
13,996 KB
testcase_05 AC 18 ms
11,820 KB
testcase_06 AC 19 ms
11,924 KB
testcase_07 AC 19 ms
12,048 KB
testcase_08 AC 19 ms
12,192 KB
testcase_09 AC 18 ms
11,976 KB
testcase_10 AC 18 ms
12,032 KB
testcase_11 AC 19 ms
11,936 KB
testcase_12 AC 18 ms
11,684 KB
testcase_13 AC 18 ms
11,760 KB
testcase_14 AC 18 ms
11,624 KB
testcase_15 AC 21 ms
12,272 KB
testcase_16 AC 20 ms
12,424 KB
testcase_17 AC 20 ms
12,172 KB
testcase_18 AC 19 ms
12,008 KB
testcase_19 AC 19 ms
12,136 KB
testcase_20 AC 20 ms
12,244 KB
testcase_21 AC 19 ms
11,984 KB
testcase_22 AC 20 ms
12,120 KB
testcase_23 AC 20 ms
11,940 KB
testcase_24 AC 19 ms
12,020 KB
testcase_25 AC 21 ms
12,080 KB
testcase_26 AC 20 ms
12,076 KB
testcase_27 AC 20 ms
12,212 KB
testcase_28 AC 18 ms
11,956 KB
testcase_29 AC 20 ms
12,084 KB
testcase_30 AC 18 ms
11,948 KB
testcase_31 AC 20 ms
12,228 KB
testcase_32 AC 19 ms
11,892 KB
testcase_33 AC 20 ms
12,116 KB
testcase_34 AC 18 ms
11,824 KB
testcase_35 AC 21 ms
12,220 KB
testcase_36 AC 19 ms
12,072 KB
testcase_37 AC 19 ms
11,936 KB
testcase_38 AC 19 ms
12,044 KB
testcase_39 AC 19 ms
12,124 KB
testcase_40 AC 21 ms
12,068 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

(define (System.out.println x)
  (begin
    (display x)
    (newline)
  )
)

(let (
      (N (read))
      (ls '())
     )
  (let loop(
            (foo (read))
           )
    (if (eof-object? foo)
        (begin (set! ls (sort ls <))
               (if (= (modulo N 2) 0)
                   (System.out.println (exact->inexact (/ (+ (list-ref ls (- (/ N 2) 1)) (list-ref ls (/ N 2))) 2)))
                   (System.out.println (exact->inexact (list-ref ls (- (ceiling (/ N 2)) 1))))
                )
        )
        (begin
          (set! ls (cons foo ls))
          (loop (read))
        )
    )
  )
)
0