結果

問題 No.143 豆
ユーザー まんしmaNNshi
提出日時 2025-03-20 23:30:16
言語 Common Lisp
(sbcl 2.5.0)
結果
WA  
実行時間 -
コード長 533 bytes
コンパイル時間 1,618 ms
コンパイル使用メモリ 30,696 KB
実行使用メモリ 27,668 KB
最終ジャッジ日時 2025-03-20 23:30:18
合計ジャッジ時間 2,314 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 1
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 20 MAR 2025 11:30:15 PM):

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

ソースコード

diff #

(defvar K)
(defvar N)
(defvar F)
(defvar A)
(defvar temp)
(setq temp (read-line))
(setq temp (concatenate 'string "(" temp ")" ))
(setq temp (read-from-string temp))
(setq K (nth 0 temp))
(setq N (nth 1 temp))
(setq F (nth 2 temp))

(setq temp (read-line))
(setq temp (concatenate 'string "(" temp ")" ))
(setq temp (read-from-string temp))
(setq A temp)

(defvar sum)
(setq sum 0)
(loop for x in A do (setq sum (+ sum x)))
;(format 't "<~d ~d ~d ~%>" K N F)
(if (< sum (* K N)) (format 't "~d~%" (- (* K N) sum)) (format 't "-1~%"))
0