Result

AC

Duration

710ms

Code [DL]

give s p=substr(s,"T")while 1 give s see copy(" ",p-1)?1 q=substr(s,"K")if q see copy(" ",q-1)see copy("1",p-q)?1 exit ok end

stdin

                                 T                
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
                                                  
K                                                 

stdout

                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
                                 1
1111111111111111111111111111111111

stderr

strace