結果
| 問題 |
No.275 中央値を求めよ
|
| コンテスト | |
| ユーザー |
Rin
|
| 提出日時 | 2015-09-04 22:45:54 |
| 言語 | Scheme (Gauche-0.9.15) |
| 結果 |
AC
|
| 実行時間 | 26 ms / 1,000 ms |
| コード長 | 609 bytes |
| コンパイル時間 | 249 ms |
| コンパイル使用メモリ | 5,376 KB |
| 実行使用メモリ | 16,640 KB |
| 最終ジャッジ日時 | 2024-06-24 23:09:58 |
| 合計ジャッジ時間 | 2,255 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
ソースコード
(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))
)
)
)
)
Rin