結果

問題 No.143 豆
コンテスト
ユーザー まんしmaNNshi
提出日時 2025-03-20 23:30:57
言語 Common Lisp
(sbcl 2.6.3)
コンパイル:
sbclc _filename_
実行:
sbcl --script Main.fasl
結果
RE  
実行時間 -
コード長 534 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 393 ms
コンパイル使用メモリ 33,860 KB
実行使用メモリ 32,872 KB
最終ジャッジ日時 2026-07-07 13:40:01
合計ジャッジ時間 1,321 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other RE * 17
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 07 JUL 2026 01:39:59 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.031

ソースコード

diff #
raw source code

(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