結果
問題 | No.725 木は明らかに森である |
ユーザー |
![]() |
提出日時 | 2024-10-18 17:54:11 |
言語 | Common Lisp (sbcl 2.5.0) |
結果 |
AC
|
実行時間 | 13 ms / 2,000 ms |
コード長 | 624 bytes |
コンパイル時間 | 2,938 ms |
コンパイル使用メモリ | 32,716 KB |
実行使用メモリ | 30,012 KB |
最終ジャッジ日時 | 2024-10-18 17:54:15 |
合計ジャッジ時間 | 1,394 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
コンパイルメッセージ
; compiling file "/home/judge/data/code/Main.lisp" (written 18 OCT 2024 05:54:11 PM): ; wrote /home/judge/data/code/Main.fasl ; compilation finished in 0:00:00.029
ソースコード
(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 posdo (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)