結果
| 問題 | No.46 はじめのn歩 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-10 23:15:07 |
| 言語 | Common Lisp (sbcl 2.6.7) |
| 結果 |
RE
不安定
|
| 実行時間 | - |
| コード長 | 1,190 bytes |
| 記録 | |
| コンパイル時間 | 219 ms |
| コンパイル使用メモリ | 28,160 KB |
| 実行使用メモリ | 22,400 KB |
| 最終ジャッジ日時 | 2026-09-04 12:10:49 |
| 合計ジャッジ時間 | 1,371 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 10 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 04 SEP 2026 12:10:47 PM):
;
; caught ERROR:
; READ error during COMPILE-FILE:
;
; Package UIOP does not exist.
;
; Line: 25, Column: 21, File-Position: 1084
;
; Stream: #<SB-INT:FORM-TRACKING-STREAM for "file /home/judge/data/code/Main.lisp" {1200D39433}>
;
; compilation unit aborted
; caught 1 fatal ERROR condition
; caught 1 ERROR condition
; compilation aborted after 0:00:00.208
ソースコード
(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
(uiop:split-string (read-line)))))
(multiple-value-bind
(a b) (read-numbers)
(format t "~a~%" (ceiling (/ b a))))