結果
| 問題 | No.725 木は明らかに森である |
| コンテスト | |
| ユーザー |
Common Lisp
|
| 提出日時 | 2024-10-18 17:54:11 |
| 言語 | Common Lisp (sbcl 2.6.9) |
| 結果 |
AC
不安定
|
| 実行時間 | 8 ms / 2,000 ms |
| + 826µs | |
| コード長 | 624 bytes |
| 記録 | |
| コンパイル時間 | 17 ms |
| コンパイル使用メモリ | 31,484 KB |
| 実行使用メモリ | 24,064 KB |
| 最終ジャッジ日時 | 2026-11-21 05:30:16 |
| 合計ジャッジ時間 | 1,578 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 21 NOV 2026 05:30:14 AM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.004
ソースコード
(defun replace-treeone-with-forest (s pre-str post-str)
(let* ((search-str pre-str)
(replace-str post-str)
(search-len (length search-str))
(result "")
(start 0)
(pos (search search-str s :start2 start)))
(loop while pos
do (setq result (concatenate 'string result (subseq s start pos) replace-str))
(setq start (+ pos search-len))
(setq pos (search search-str s :start2 start)))
(concatenate 'string result (subseq s start))))
(defun main ()
(princ (replace-treeone-with-forest (read-line) "treeone" "forest"))
(terpri))
(main)
Common Lisp