結果
| 問題 | No.5 数字のブロック |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-03-20 15:14:23 |
| 言語 | Common Lisp (sbcl 2.6.3) |
| 結果 |
AC
|
| 実行時間 | 224 ms / 5,000 ms |
| コード長 | 472 bytes |
| 記録 | |
| コンパイル時間 | 859 ms |
| コンパイル使用メモリ | 27,648 KB |
| 実行使用メモリ | 74,624 KB |
| 最終ジャッジ日時 | 2026-07-07 07:02:33 |
| 合計ジャッジ時間 | 4,936 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 34 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 07 JUL 2026 07:02:27 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.024
ソースコード
(defvar L (read-line))
(setq L (parse-integer L))
(defvar N (read-line))
(setq N (parse-integer N))
(defvar W (read-line))
(setq W (read-from-string (concatenate 'string "(" W ")" ) ) )
(defvar newW)
(setq newW '())
(loop for x in W do
(setq neww (append newW (list x))))
(setq W newW)
(setq W (sort W #'<))
(defvar SUM 0)
(defvar ANS 0)
(defvar x)
(loop for x in W do
(if (> (+ SUM x) L) (return) (progn (incf ANS) (setq SUM (+ SUM x))))
)
(format 't "~d~%" ANS)