Result

AC

Duration

3114ms

Code [DL]

defmodule M do
def f(x)do
""<>c=IO.read(1)
IO.write(if x<1,do: "@",else: c)
f(case c do
"T"->1
"K"->x-50
_->rem(x+1,51)end)end
end
M.f(1)

stdin

                                          T       
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                   K                              

stdout

                                          T       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                                          @       
                   K@@@@@@@@@@@@@@@@@@@@@@@       

stderr

** (MatchError) no match of right hand side value: :eof
    /volume/CODE:3: M.f/1
    (elixir) lib/code.ex:767: Code.require_file/2

strace