結果
| 問題 | No.275 中央値を求めよ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-06-09 02:15:32 |
| 言語 | Common Lisp (sbcl 2.6.3) |
| 結果 |
AC
|
| 実行時間 | 7 ms / 1,000 ms |
| コード長 | 411 bytes |
| 記録 | |
| コンパイル時間 | 1,345 ms |
| コンパイル使用メモリ | 30,592 KB |
| 実行使用メモリ | 22,784 KB |
| 最終ジャッジ日時 | 2026-06-09 02:15:35 |
| 合計ジャッジ時間 | 3,081 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 09 JUN 2026 02:15:32 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.043
ソースコード
(defparameter *N* (read))
(defparameter *A* (make-array *N* :initial-element 0))
(defun median (a)
(let ((L (length a)))
(if (zerop(mod L 2))
(/ (+ (aref a (/ L 2)) (aref a (1- (/ L 2)))) 2)
(aref a (/ (1- L) 2)))))
(defun read-seqence (a n) (dotimes (i n) (setf (aref a i) (read))))
(defun main () (read-seqence *A* *N*) (sort *A* #'<) (format t "~A~%" (float (median *A*))))
(main)