結果

問題 No.275 中央値を求めよ
ユーザー まんしmaNNshi
提出日時 2025-03-21 19:15:16
言語 Common Lisp
(sbcl 2.5.0)
結果
AC  
実行時間 11 ms / 1,000 ms
コード長 303 bytes
コンパイル時間 321 ms
コンパイル使用メモリ 33,504 KB
実行使用メモリ 25,896 KB
最終ジャッジ日時 2025-03-21 19:15:20
合計ジャッジ時間 2,546 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 21 MAR 2025 07:15:16 PM):

; wrote /home/judge/data/code/Main.fasl
; compilation finished in 0:00:00.025

ソースコード

diff #

(defvar N)
(defvar A)
(setq N (read-line))
(setq A (read-line))
(setq A (read-from-string (concatenate 'string "(" A ")")))
(setq A (sort A #'<))
(defvar L)
(setq L (length A))

(if (oddp L) (format 't "~d~%" (nth (/ (- L 1) 2) A))
  (format 't "~f~%" (/ (+ (nth (- (/ L 2) 1) A) (nth (/ L 2) A ) ) 2)))
0