結果
| 問題 |
No.143 豆
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-20 23:30:57 |
| 言語 | Common Lisp (sbcl 2.5.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 534 bytes |
| コンパイル時間 | 1,512 ms |
| コンパイル使用メモリ | 28,796 KB |
| 実行使用メモリ | 30,104 KB |
| 最終ジャッジ日時 | 2025-03-20 23:31:00 |
| 合計ジャッジ時間 | 1,457 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 17 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 20 MAR 2025 11:30:57 PM): ; file: /home/judge/data/code/Main.lisp ; in: IF (=< SUM (* K N)) ; (=< SUM (* K N)) ; ; caught STYLE-WARNING: ; undefined function: COMMON-LISP-USER::=< ; ; compilation unit finished ; Undefined function: ; =< ; caught 1 STYLE-WARNING condition ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.043
ソースコード
(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~%"))