結果

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

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 17 ms
11,412 KB
testcase_01 AC 17 ms
11,704 KB
testcase_02 AC 16 ms
11,696 KB
testcase_03 AC 17 ms
11,680 KB
testcase_04 AC 17 ms
11,644 KB
testcase_05 AC 17 ms
11,584 KB
testcase_06 AC 17 ms
11,452 KB
testcase_07 AC 18 ms
11,944 KB
testcase_08 AC 17 ms
11,744 KB
testcase_09 AC 17 ms
11,760 KB
testcase_10 AC 17 ms
11,740 KB
testcase_11 AC 16 ms
11,500 KB
testcase_12 AC 17 ms
11,172 KB
testcase_13 AC 16 ms
11,444 KB
testcase_14 AC 16 ms
11,276 KB
testcase_15 AC 19 ms
11,956 KB
testcase_16 AC 18 ms
12,000 KB
testcase_17 AC 18 ms
11,724 KB
testcase_18 AC 18 ms
11,800 KB
testcase_19 AC 18 ms
11,624 KB
testcase_20 AC 18 ms
11,968 KB
testcase_21 AC 17 ms
11,568 KB
testcase_22 AC 19 ms
11,880 KB
testcase_23 AC 18 ms
11,668 KB
testcase_24 AC 18 ms
11,512 KB
testcase_25 AC 19 ms
11,980 KB
testcase_26 AC 18 ms
11,800 KB
testcase_27 AC 18 ms
11,772 KB
testcase_28 AC 17 ms
11,820 KB
testcase_29 AC 17 ms
11,780 KB
testcase_30 AC 16 ms
11,460 KB
testcase_31 AC 18 ms
11,976 KB
testcase_32 AC 16 ms
11,472 KB
testcase_33 AC 17 ms
11,712 KB
testcase_34 AC 17 ms
11,448 KB
testcase_35 AC 18 ms
11,920 KB
testcase_36 AC 17 ms
11,716 KB
testcase_37 AC 17 ms
11,628 KB
testcase_38 AC 17 ms
11,656 KB
testcase_39 AC 18 ms
11,624 KB
testcase_40 AC 19 ms
11,812 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