結果

問題 No.388 階段 (1)
ユーザー eldericaelderica
提出日時 2023-11-10 23:22:03
言語 Common Lisp
(sbcl 2.3.8)
結果
WA  
実行時間 -
コード長 1,185 bytes
コンパイル時間 286 ms
コンパイル使用メモリ 37,416 KB
実行使用メモリ 29,344 KB
最終ジャッジ日時 2023-11-10 23:22:05
合計ジャッジ時間 1,141 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 10 ms
29,344 KB
testcase_02 AC 9 ms
29,344 KB
testcase_03 AC 9 ms
29,344 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 9 ms
29,344 KB
testcase_08 AC 10 ms
29,344 KB
testcase_09 AC 9 ms
29,344 KB
testcase_10 WA -
testcase_11 AC 10 ms
29,344 KB
testcase_12 AC 10 ms
29,344 KB
testcase_13 AC 9 ms
29,344 KB
testcase_14 AC 10 ms
29,344 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 10 NOV 2023 02:22:03 PM):

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

ソースコード

diff #

(defun split-string (string &key max (separator '(#\Space #\Tab)))
  "Split STRING into a list of components separated by
any of the characters in the sequence SEPARATOR.
If MAX is specified, then no more than max(1,MAX) components will be returned,
starting the separation from the end, e.g. when called with arguments
 \"a.b.c.d.e\" :max 3 :separator \".\" it will return (\"a.b.c\" \"d\" \"e\")."
  (block ()
    (let ((list nil) (words 0) (end (length string)))
      (when (zerop end) (return nil))
        (flet ((separatorp (char) (find char separator))
               (done () (return (cons (subseq string 0 end) list))))
          (loop
            :for start = (if (and max (>= words (1- max)))
                             (done)
                             (position-if #'separatorp string :end end :from-end t))
            :do (when (null start) (done))
                (push (subseq string (1+ start) end) list)
                (incf words)
                (setf end start))))))


(defun read-numbers ()
  (apply #'values
	 (mapcar #'parse-integer
		 (split-string (read-line)))))

(multiple-value-bind
      (s f) (read-numbers)
  (format t "~a~%" (ceiling (/ s f))))
0