Buggy python submission (verdict: Time Limit Exceeded):
S = input()
boundaries = []
boundaries_RL = []
boundaries_LR = []
children = [0] * len(S)
append = boundaries.append
RL_append = boundaries_RL.append
LR_append = boundaries_LR.append

for i in range(1, len(S)):
    if S[i-1] == 'R' and S[i] == 'L':
        append(i)
        RL_append(i)
    elif S[i-1] == 'L' and S[i] == 'R':
        LR_append(i)
        append(i)

for j in range(len(boundaries)):
    if boundaries[j] in boundaries_LR:
        continue
    else:  # boundaries[j]は、RLとなっているところの、Lのindex
        '''group1: Rより左側のchildren'''
        if j == 0:
            group1 = boundaries[j]
        else:
            group1 = boundaries[j] - boundaries[j-1]
        if group1 % 2 == 0:
            children[boundaries[j]] += group1 // 2
            children[boundaries[j]-1] += group1 // 2
        else:
            children[boundaries[j]-1] += group1 // 2 + 1
            children[boundaries[j]] += group1 // 2
        '''group2: Lより右側のchildren'''
        if j == len(boundaries)-1:
            group2 = len(S) - boundaries[j]
        else:
            group2 = boundaries[j+1] - boundaries[j]
        if group2 % 2 == 0:
            children[boundaries[j]] += group2 // 2
            children[boundaries[j]-1] += group2 // 2
        else:
            children[boundaries[j]] += group2 // 2 + 1
            children[boundaries[j]-1] += group2 // 2

print(*children)


Fixed submission:
S = input()


def solve(s):
    buf = [1] * len(s)

    for i in range(len(buf) - 2):
        if s[i] == "R" and s[i + 1] == "R":
            buf[i+2] += buf[i]
            buf[i] = 0

    for i in range(len(buf) - 1, 1, -1):
        if s[i] == "L" and s[i - 1] == "L":
            buf[i-2] += buf[i]
            buf[i] = 0

    return " ".join(map(str, buf))


print(solve(S))

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
boundaries = []
boundaries_RL = []
boundaries_LR = []
children = [0] * len(S)

for i in range(1, len(S)):
    if S[i-1] == 'R' and S[i] == 'L':
        boundaries.append(i)
        boundaries_RL.append(i)
    elif S[i-1] == 'L' and S[i] == 'R':
        boundaries_LR.append(i)
        boundaries.append(i)

for j in range(len(boundaries)):
    if boundaries[j] in boundaries_LR:
        continue
    else:  # boundaries[j]は、RLとなっているところの、Lのindex
        '''group1: Rより左側のchildren'''
        if j == 0:
            group1 = boundaries[j]
        else:
            group1 = boundaries[j] - boundaries[j-1]
        if group1 % 2 == 0:
            children[boundaries[j]] += group1 // 2
            children[boundaries[j]-1] += group1 // 2
        else:
            children[boundaries[j]-1] += group1 // 2 + 1
            children[boundaries[j]] += group1 // 2
        '''group2: Lより右側のchildren'''
        if j == len(boundaries)-1:
            group2 = len(S) - boundaries[j]
        else:
            group2 = boundaries[j+1] - boundaries[j]
        if group2 % 2 == 0:
            children[boundaries[j]] += group2 // 2
            children[boundaries[j]-1] += group2 // 2
        else:
            children[boundaries[j]] += group2 // 2 + 1
            children[boundaries[j]-1] += group2 // 2

print(*children)


Fixed submission:
S = input()


def solve(s):
    buf = [1] * len(s)

    for i in range(len(buf) - 2):
        if s[i] == "R" and s[i + 1] == "R":
            buf[i+2] += buf[i]
            buf[i] = 0

    for i in range(len(buf) - 1, 1, -1):
        if s[i] == "L" and s[i - 1] == "L":
            buf[i-2] += buf[i]
            buf[i] = 0

    return " ".join(map(str, buf))


print(solve(S))

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
boundaries = []
boundaries_RL = []
boundaries_LR = []
children = [0 for _ in range(len(S))]

for i in range(1, len(S)):
    if S[i-1] == 'R':
        if S[i] == 'L':
            boundaries.append(i)
            boundaries_RL.append(i)
    elif S[i] == 'R':
        boundaries_LR.append(i)
        boundaries.append(i)

for j in range(len(boundaries)):
    if boundaries[j] in boundaries_LR:
        continue
    else:  # boundaries[j]は、RLとなっているところの、Lのindex
        '''group1: Rより左側のchildren'''
        if j == 0:
            group1 = boundaries[j]
        else:
            group1 = boundaries[j] - boundaries[j-1]
        if group1 % 2 == 0:
            children[boundaries[j]] += group1 // 2
            children[boundaries[j]-1] += group1 // 2
        else:
            children[boundaries[j]-1] += group1 // 2 + 1
            children[boundaries[j]] += group1 // 2
        '''group2: Lより右側のchildren'''
        if j == len(boundaries)-1:
            group2 = len(S) - boundaries[j]
        else:
            group2 = boundaries[j+1] - boundaries[j]
        if group2 % 2 == 0:
            children[boundaries[j]] += group2 // 2
            children[boundaries[j]-1] += group2 // 2
        else:
            children[boundaries[j]] += group2 // 2 + 1
            children[boundaries[j]-1] += group2 // 2

print(*children)


Fixed submission:
S = input()


def solve(s):
    buf = [1] * len(s)

    for i in range(len(buf) - 2):
        if s[i] == "R" and s[i + 1] == "R":
            buf[i+2] += buf[i]
            buf[i] = 0

    for i in range(len(buf) - 1, 1, -1):
        if s[i] == "L" and s[i - 1] == "L":
            buf[i-2] += buf[i]
            buf[i] = 0

    return " ".join(map(str, buf))


print(solve(S))

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
boundaries = []
boundaries_RL = []
boundaries_LR = []
children = [0 for _ in range(len(S))]

for i in range(1, len(S)):
    if S[i-1] == 'R' and S[i] == 'L':
        boundaries.append(i)
        boundaries_RL.append(i)
    elif S[i-1] == 'L' and S[i] == 'R':
        boundaries_LR.append(i)
        boundaries.append(i)

for j in range(len(boundaries)):
    if boundaries[j] in boundaries_LR:
        continue
    else:  # boundaries[j]は、RLとなっているところの、Lのindex
        '''group1: Rより左側のchildren'''
        if j == 0:
            group1 = boundaries[j]
        else:
            group1 = boundaries[j] - boundaries[j-1]
        if group1 % 2 == 0:
            children[boundaries[j]] += group1 // 2
            children[boundaries[j]-1] += group1 // 2
        else:
            children[boundaries[j]-1] += group1 // 2 + 1
            children[boundaries[j]] += group1 // 2
        '''group2: Lより右側のchildren'''
        if j == len(boundaries)-1:
            group2 = len(S) - boundaries[j]
        else:
            group2 = boundaries[j+1] - boundaries[j]
        if group2 % 2 == 0:
            children[boundaries[j]] += group2 // 2
            children[boundaries[j]-1] += group2 // 2
        else:
            children[boundaries[j]] += group2 // 2 + 1
            children[boundaries[j]-1] += group2 // 2

print(*children)


Fixed submission:
S = input()


def solve(s):
    buf = [1] * len(s)

    for i in range(len(buf) - 2):
        if s[i] == "R" and s[i + 1] == "R":
            buf[i+2] += buf[i]
            buf[i] = 0

    for i in range(len(buf) - 1, 1, -1):
        if s[i] == "L" and s[i - 1] == "L":
            buf[i-2] += buf[i]
            buf[i] = 0

    return " ".join(map(str, buf))


print(solve(S))

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
boundaries = []
boundaries_RL = []
boundaries_LR = []
children = [0 for _ in range(len(S))]

for i in range(1, len(S)):
    if S[i-1] == 'R' and S[i] == 'L':
        boundaries.append(i)
        boundaries_RL.append(i)
    elif S[i-1] == 'L' and S[i] == 'R':
        boundaries_LR.append(i)
        boundaries.append(i)

for j in range(len(boundaries)):
    if boundaries[j] in boundaries_LR:
        continue
    else:  # boundaries[j]は、RLとなっているところの、Lのindex
        '''group1: Rより左側のchildren'''
        if j == 0:
            group1 = boundaries[j]
        else:
            group1 = boundaries[j] - boundaries[j-1]
        if group1 % 2 == 0:
            children[boundaries[j]] += group1 // 2
            children[boundaries[j]-1] += group1 // 2
        else:
            children[boundaries[j]-1] += group1 // 2 + 1
            children[boundaries[j]] += group1 // 2
        '''group2: Lより右側のchildren'''
        if j == len(boundaries)-1:
            group2 = len(S) - boundaries[j]
        else:
            group2 = boundaries[j+1] - boundaries[j]
        if group2 % 2 == 0:
            children[boundaries[j]] += group2 // 2
            children[boundaries[j]-1] += group2 // 2
        else:
            children[boundaries[j]] += group2 // 2 + 1
            children[boundaries[j]-1] += group2 // 2

print(*children)


Fixed submission:
S = input()


def solve(s):
    buf = [1] * len(s)

    for i in range(len(buf) - 2):
        if s[i] == "R" and s[i + 1] == "R":
            buf[i+2] += buf[i]
            buf[i] = 0

    for i in range(len(buf) - 1, 1, -1):
        if s[i] == "L" and s[i - 1] == "L":
            buf[i-2] += buf[i]
            buf[i] = 0

    return " ".join(map(str, buf))


print(solve(S))