Result

AC

Duration

2888ms

Code [DL]

(setq b nil)
(setq e 1)

(loop
  (setq c (read-char))
  (when (char= c #\T) (setq e 0))
  (setq b (or (char= c #\K) (and b (> e 0))))
  (princ (if (or (= e 0) b) #\a c))
  (setq e (mod (+ e 1) 51))
)

stdin

                               T                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
        K                                         

stdout

                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
                               a                  
        aaaaaaaaaaaaaaaaaaaaaaaa                  

stderr

; in: SETQ B
;     (SETQ B NIL)
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::B
; 
; compilation unit finished
;   Undefined variable:
;     B
;   caught 1 WARNING condition
; in: SETQ E
;     (SETQ E 1)
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::E
; 
; compilation unit finished
;   Undefined variable:
;     E
;   caught 1 WARNING condition
; in: LOOP (SETQ C (READ-CHAR))
;     (SETQ B (OR (CHAR= C #\K) (AND B (> E 0))))
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::B

;     (SETQ C (READ-CHAR))
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::C

;     (SETQ E 0)
; 
; caught WARNING:
;   undefined variable: COMMON-LISP-USER::E
; 
; compilation unit finished
;   Undefined variables:
;     B C E
;   caught 3 WARNING conditions
Unhandled END-OF-FILE in thread #<SB-THREAD:THREAD "main thread" RUNNING
                                   {10005205B3}>:
  end of file on #<SB-SYS:FD-STREAM for "standard input" {1004BC8B03}>

Backtrace for: #<SB-THREAD:THREAD "main thread" RUNNING {10005205B3}>
0: (SB-DEBUG::DEBUGGER-DISABLED-HOOK #<END-OF-FILE {1002D84BB3}> #<unused argument> :QUIT T)
1: (SB-DEBUG::RUN-HOOK *INVOKE-DEBUGGER-HOOK* #<END-OF-FILE {1002D84BB3}>)
2: (INVOKE-DEBUGGER #<END-OF-FILE {1002D84BB3}>)
3: (ERROR END-OF-FILE :STREAM #<SB-SYS:FD-STREAM for "standard input" {1004BC8B03}>)
4: (SB-IMPL::INPUT-CHAR/ASCII #<SB-SYS:FD-STREAM for "standard input" {1004BC8B03}> T NIL)
5: ((LAMBDA (&REST REST) :IN SB-IMPL::GET-EXTERNAL-FORMAT) #<SB-SYS:FD-STREAM for "standard input" {1004BC8B03}> T NIL)
6: (READ-CHAR #<SB-SYS:FD-STREAM for "standard input" {1004BC8B03}> T NIL #<unused argument>)
7: (READ-CHAR #<SYNONYM-STREAM :SYMBOL SB-SYS:*STDIN* {100001E0D3}> T NIL #<unused argument>)
8: ((LAMBDA NIL :IN "/volume/CODE"))
9: (SB-INT:SIMPLE-EVAL-IN-LEXENV (LOOP (SETQ C (READ-CHAR)) (WHEN (CHAR= C #\T) (SETQ E 0)) (SETQ B (OR (CHAR= C #\K) (AND B (> E 0)))) (PRINC (IF (OR (= E 0) B) #\a C)) (SETQ E (MOD (+ E 1) 51))) #<NULL-LEXENV>)
10: (EVAL-TLF (LOOP (SETQ C (READ-CHAR)) (WHEN (CHAR= C #\T) (SETQ E 0)) (SETQ B (OR (CHAR= C #\K) (AND B (> E 0)))) (PRINC (IF (OR (= E 0) B) #\a C)) (SETQ E (MOD (+ E 1) 51))) NIL NIL)
11: ((LABELS SB-FASL::EVAL-FORM :IN SB-INT:LOAD-AS-SOURCE) (LOOP (SETQ C (READ-CHAR)) (WHEN (CHAR= C #\T) (SETQ E 0)) (SETQ B (OR (CHAR= C #\K) (AND B (> E 0)))) (PRINC (IF (OR (= E 0) B) #\a C)) (SETQ E (MOD (+ E 1) 51))) NIL)
12: (SB-INT:LOAD-AS-SOURCE #<CONCATENATED-STREAM :STREAMS (#<SB-SYS:FD-STREAM for "file /volume/CODE" {1002C37D53}> #<SB-IMPL::STRING-INPUT-STREAM {1002C39B03}>) {1002C3A943}> :VERBOSE NIL :PRINT NIL :CONTEXT "loading")
13: ((FLET SB-FASL::THUNK :IN LOAD))
14: (SB-FASL::CALL-WITH-LOAD-BINDINGS #<CLOSURE (FLET SB-FASL::THUNK :IN LOAD) {7F50A7A974FB}> #<CONCATENATED-STREAM :STREAMS (#<SB-SYS:FD-STREAM for "file /volume/CODE" {1002C37D53}> #<SB-IMPL::STRING-INPUT-STREAM {1002C39B03}>) {1002C3A943}>)
15: ((FLET SB-FASL::LOAD-STREAM :IN LOAD) #<CONCATENATED-STREAM :STREAMS (#<SB-SYS:FD-STREAM for "file /volume/CODE" {1002C37D53}> #<SB-IMPL::STRING-INPUT-STREAM {1002C39B03}>) {1002C3A943}> NIL)
16: (LOAD #<CONCATENATED-STREAM :STREAMS (#<SB-SYS:FD-STREAM for "file /volume/CODE" {1002C37D53}> #<SB-IMPL::STRING-INPUT-STREAM {1002C39B03}>) {1002C3A943}> :VERBOSE NIL :PRINT NIL :IF-DOES-NOT-EXIST T :EXTERNAL-FORMAT :DEFAULT)
17: ((FLET ROSWELL::BODY :IN ROSWELL:SCRIPT) #<SB-SYS:FD-STREAM for "file /volume/CODE" {1002C37D53}>)
18: (ROSWELL:SCRIPT "/volume/CODE")
19: (ROSWELL:RUN ((:EVAL "(ros:quicklisp)") (:SCRIPT "/volume/CODE") (:QUIT NIL)))
20: (SB-INT:SIMPLE-EVAL-IN-LEXENV (ROSWELL:RUN (QUOTE ((:EVAL "(ros:quicklisp)") (:SCRIPT "/volume/CODE") (:QUIT NIL)))) #<NULL-LEXENV>)
21: (EVAL (ROSWELL:RUN (QUOTE ((:EVAL "(ros:quicklisp)") (:SCRIPT "/volume/CODE") (:QUIT NIL)))))
22: (SB-IMPL::PROCESS-EVAL/LOAD-OPTIONS ((:EVAL . "(progn #-ros.init(cl:load \"/usr/local/etc/roswell/init.lisp\"))") (:EVAL . "(ros:run '((:eval\"(ros:quicklisp)\")(:script \"/volume/CODE\")(:quit ())))")))
23: (SB-IMPL::TOPLEVEL-INIT)
24: ((FLET SB-UNIX::BODY :IN SAVE-LISP-AND-DIE))
25: ((FLET "WITHOUT-INTERRUPTS-BODY-7" :IN SAVE-LISP-AND-DIE))
26: ((LABELS SB-IMPL::RESTART-LISP :IN SAVE-LISP-AND-DIE))

unhandled condition in --disable-debugger mode, quitting

strace