結果

問題 No.289 数字を全て足そう
コンテスト
ユーザー Takashi_Oda
提出日時 2026-06-08 03:29:50
言語 Common Lisp
(sbcl 2.6.3)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
AC  
実行時間 8 ms / 1,000 ms
コード長 296 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 851 ms
コンパイル使用メモリ 29,312 KB
実行使用メモリ 22,400 KB
最終ジャッジ日時 2026-06-08 03:29:56
合計ジャッジ時間 4,831 ms
ジャッジサーバーID
(参考情報)
judge3_1 / judge1_1
純コード判定待ち
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 08 JUN 2026 03:29:50 AM):

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

ソースコード

diff #
raw source code

(defun solve ()
    (let ((s (read-line)) (i 0) (answer 0))
    (loop while (< i (length s)) do
        (if (digit-char-p (char s i))
            (setf answer (+ answer (- (char-code (char s i)) (char-code #\0)))))
        (incf i))
    answer))

(defun main () (format t "~A~%" (solve)))

(main)
0