結果

問題 No.725 木は明らかに森である
ユーザー _Clay_____Clay____
提出日時 2018-09-12 21:19:49
言語 Scheme
(Gauche-0.9.14)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 659 bytes
コンパイル時間 71 ms
コンパイル使用メモリ 5,212 KB
実行使用メモリ 13,832 KB
最終ジャッジ日時 2023-09-10 04:22:59
合計ジャッジ時間 1,496 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

(letrec* ((*tree* '(#\t #\r #\e #\e #\o #\n #\e))
          (*forest* '(#\f #\o #\r #\e #\s #\t))
          (rep (lambda (t r)
                (let ((c (read-char)))
                 (cond
                    ((eof-object? c) r)
                    ((char=? c (car t)) (if (length=? t 1)
                                          (append *forest* (rep *tree* '()))
                                          (rep (cdr t) (append r (list c)))))
                    ((char=? c (car *tree*)) (append r (rep (cdr *tree*) (list c))))
                    (else (append r (list c) (rep *tree* '()))))))))
 (begin
   (for-each display (rep *tree* '()))
   (newline)))
0