結果
問題 |
No.21 平均の差
|
ユーザー |
![]() |
提出日時 | 2024-10-06 02:41:07 |
言語 | Common Lisp (sbcl 2.5.0) |
結果 |
AC
|
実行時間 | 9 ms / 5,000 ms |
コード長 | 561 bytes |
コンパイル時間 | 969 ms |
コンパイル使用メモリ | 39,328 KB |
実行使用メモリ | 30,016 KB |
最終ジャッジ日時 | 2024-10-06 02:41:09 |
合計ジャッジ時間 | 909 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 06 OCT 2024 02:41:07 AM): ; file: /home/judge/data/code/Main.lisp ; in: DEFUN MAIN ; (K (READ)) ; ; caught STYLE-WARNING: ; The variable K is defined but never used. ; ; compilation unit finished ; caught 1 STYLE-WARNING condition ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.013
ソースコード
; 最大の平均は最大値1個だけから成るグループ ; 最小の平均は最小値1個だけから成るグループ ; 残りを適当なグループにまとめる ; 入力をソートして最大値から最小値を引く (defun main () (let* ((n (read)) (k (read)) (xs (sort (loop repeat n collect (read)) #'>))) ; first リストの最初の要素にアクセス ; last n リストの最後の n個のコンスにアクセス デフォルトは1個 (progn (princ (- (first xs) (car (last xs)))) (terpri)))) (main)