結果

問題 No.369 足し間違い
コンテスト
ユーザー Common Lisp
提出日時 2024-10-08 20:28:08
言語 Common Lisp
(sbcl 2.6.3)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
AC  
実行時間 9 ms / 2,000 ms
コード長 302 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 76 ms
コンパイル使用メモリ 29,184 KB
実行使用メモリ 22,528 KB
最終ジャッジ日時 2026-04-25 02:28:15
合計ジャッジ時間 1,017 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 5
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 25 APR 2026 02:28:13 AM):

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

ソースコード

diff #
raw source code

; reduce #'+ => sum
; loop repeat n collect (read) => n 個の数を 1 つのリストとして読み込む
(defun main ()
  (let* ((n (read))
         (real-answer (reduce #'+ (loop repeat n collect (read))))
         (yuki-answer (read)))
    (princ (- real-answer yuki-answer))
    (terpri)))
(main)
0