Buggy python submission (verdict: Time Limit Exceeded):
def solve():

  S=input()
  N=len(S)
  childs=[1]*N
  result=[0]*N

  for i in range(N):
    if S[i]=="R": 
      j = i
      count = 0
      for j in range(j+1,N):
        count = count + 1
        if S[j] == "L":
          if count & 1 == 0:
            result[j] = result[j] + 1
          else:
            result[j-1] = result[j-1] + 1
          break
    else:
      j = i
      count = 0
      for j in range(j-1,-1,-1):
        count = count + 1
        if S[j] == "R":
          if count & 1 == 0:
            result[j] = result[j] + 1
          else:
            result[j+1] = result[j+1] + 1
          break
  return " ".join(map(str, result))
          
print(solve())

Fixed submission:
s=input()
ans=[0]*len(s)
import itertools
i=0
for key,g in itertools.groupby(s):
  num=len(list(g))
  if key=="R":
    i+=num
    ans[i-1]+=(num//2+(num%2>0))
    ans[i]+=num//2
  elif key=="L":
    ans[i-1]+=num//2
    ans[i]+=(num//2+(num%2>0))
    i+=num
  if i>=len(ans):
    break
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
def solve():

  S=input()
  N=len(S)
  childs=[1]*N
  result=[0]*N

  for i in range(N):
    if S[i]=="R": 
      j = i
      count = 0
      for j in range(j+1,N):
        count = count + 1
        if S[j] == "L":
          if count & 1 == 0:
            result[j] = result[j] + 1
          else:
            result[j-1] = result[j-1] + 1
          break
    else:
      j = i
      count = 0
      for j in range(j-1,-1,-1):
        count = count + 1
        if S[j] == "R":
          if count & 1 == 0:
            result[j] = result[j] + 1
          else:
            result[j+1] = result[j+1] + 1
          break
  return " ".join(map(str, result))
          
print(solve())

Fixed submission:
s=input()
ans=[0]*len(s)
import itertools
i=0
for key,g in itertools.groupby(s):
  num=len(list(g))
  if key=="R":
    i+=num
    ans[i-1]+=(num//2+(num%2>0))
    ans[i]+=num//2
  elif key=="L":
    ans[i-1]+=num//2
    ans[i]+=(num//2+(num%2>0))
    i+=num
  if i>=len(ans):
    break
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
S=input()
N=len(S)
childs=[1]*N
result=[0]*N

for i in range(N):
  if S[i]=="R": 
    j = i
    count = 0
    for j in range(j+1,N):
      count = count + 1
      if S[j] == "L":
        if count & 1 == 0:
          result[j] = result[j] + 1
        else:
          result[j-1] = result[j-1] + 1
        break
  else:
    j = i
    count = 0
    for j in range(j-1,-1,-1):
      count = count + 1
      if S[j] == "R":
        if count & 1 == 0:
          result[j] = result[j] + 1
        else:
          result[j+1] = result[j+1] + 1
        break

print(" ".join(map(str, result)))


Fixed submission:
s=input()
ans=[0]*len(s)
import itertools
i=0
for key,g in itertools.groupby(s):
  num=len(list(g))
  if key=="R":
    i+=num
    ans[i-1]+=(num//2+(num%2>0))
    ans[i]+=num//2
  elif key=="L":
    ans[i-1]+=num//2
    ans[i]+=(num//2+(num%2>0))
    i+=num
  if i>=len(ans):
    break
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
S=input()
N=len(S)
childs=[1]*N
result=[0]*N

for i in range(N):
  if S[i]=="R": 
    j = i
    count = 0
    for j in range(j+1,N):
      count = count + 1
      if S[j] == "L":
        if count & 1 == 0:
          result[j] = result[j] + 1
        else:
          result[j-1] = result[j-1] + 1
        break
  else:
    j = i
    count = 0
    for j in range(j-1,-1,-1):
      count = count + 1
      if S[j] == "R":
        if count & 1 == 0:
          result[j] = result[j] + 1
        else:
          result[j+1] = result[j+1] + 1
        break

result_str = [str(n) for n in result]
print(" ".join(result_str))


Fixed submission:
s=input()
ans=[0]*len(s)
import itertools
i=0
for key,g in itertools.groupby(s):
  num=len(list(g))
  if key=="R":
    i+=num
    ans[i-1]+=(num//2+(num%2>0))
    ans[i]+=num//2
  elif key=="L":
    ans[i-1]+=num//2
    ans[i]+=(num//2+(num%2>0))
    i+=num
  if i>=len(ans):
    break
print(*ans)

Buggy python submission (verdict: Time Limit Exceeded):
S=input()
N=len(S)
childs=[1]*N
result=[0]*N

for i in range(N):
  if S[i]=="R": # その子がRにいる場合。右に探しに行く
    #次に出会うLを探す
    j = i
    count = 0 # 何歩歩いたか
    for j in range(j+1,N): # 右に探す旅
      count = count + 1
      if S[j] == "L":#Lにぶつかった
        #そのときの歩数が偶数なら、j番目に落ち着く
        if count%2 == 0:
          result[j] = result[j] + 1
        #そのときの歩数が奇数ならj-1番目に落ち着く
        else:
          result[j-1] = result[j-1] + 1
        break # 右に探す旅を終える
  else: # その子がLにいる場合。左に探しに行く
    j = i #添え字をjに代入
    count = 0 #何歩歩いたか
    for j in range(j-1,-1,-1):
      count = count + 1
      if S[j] == "R": # Rにぶつかった
        # そのときの歩数が偶数なら、j番目に落ち着く
        if count%2 == 0:
          result[j] = result[j] + 1
        # そのときの歩数が奇数ならj+1番目に落ち着く
        else:
          result[j+1] = result[j+1] + 1
        break # 左に探す旅を終える


result_str = [str(n) for n in result]
print(" ".join(result_str))


Fixed submission:
s=input()
ans=[0]*len(s)
import itertools
i=0
for key,g in itertools.groupby(s):
  num=len(list(g))
  if key=="R":
    i+=num
    ans[i-1]+=(num//2+(num%2>0))
    ans[i]+=num//2
  elif key=="L":
    ans[i-1]+=num//2
    ans[i]+=(num//2+(num%2>0))
    i+=num
  if i>=len(ans):
    break
print(*ans)