Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
#D
import math

a, b = map(int, input().split())

kouyaku = math.gcd(a, b)
#ruto = round(math.sqrt(kouyaku))
ans = 1

if kouyaku%2 == 0:
    ans +=1

pn=[2];A=kouyaku
for L in range(3,A):
    chk=True
    for L2 in pn:
        if L%L2 == 0:chk=False
    if chk==True:
        pn.append(L)
        if kouyaku%L == 0:
            ans += 1

print(ans)

Fixed submission:
#D
import fractions

a, b = map(int, input().split())

kouyaku = fractions.gcd(a, b)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
import collections
c = collections.Counter(prime_factorize(kouyaku))
d =list(c.values())
print(len(d) +1)

Buggy python submission (verdict: Runtime Error):
#D
import math

a, b = map(int, input().split())

kouyaku = math.gcd(a, b)
#ruto = round(math.sqrt(kouyaku))
ans = 1

pn=[2];A=kouyaku
for L in range(3,A):
    chk=True
    for L2 in pn:
        if L%L2 == 0:chk=False
    if chk==True:pn.append(L)

for i in pn:
    if kouyaku % i == 0:
        ans += 1
print(ans)

Fixed submission:
#D
import fractions

a, b = map(int, input().split())

kouyaku = fractions.gcd(a, b)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
import collections
c = collections.Counter(prime_factorize(kouyaku))
d =list(c.values())
print(len(d) +1)

Buggy python submission (verdict: Runtime Error):
#D
import math

a, b = map(int, input().split())

kouyaku = math.gcd(a, b)
#ruto = round(math.sqrt(kouyaku))
ans = 1

pn=[2];A=kouyaku
for L in range(3,A):
    chk=True
    for L2 in pn:
        if L%L2 == 0:chk=False
    if chk==True:pn.append(L)

for i in pn:
    if kouyaku % i == 0:
        ans += 1
print(ans)

Fixed submission:
#D
import fractions

a, b = map(int, input().split())

kouyaku = fractions.gcd(a, b)

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
import collections
c = collections.Counter(prime_factorize(kouyaku))
d =list(c.values())
print(len(d) +1)
Buggy python submission (verdict: Time Limit Exceeded):
#C

n, k, q = map(int, input().split())
a=[]
for i in range(q):
    ak = int(input())
    a.append(ak)
#print(a)

seikai = []
for j in range(n):
    #プレイヤーjの正解数を調べる
    ss = a.count(j+1)
    ten = k - q + ss
#    print(ss)
    if ten > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
#C

n, k, q = map(int, input().split())
seikai=[0]*n
#seikai[i]はプレーヤーi+1の正解数
#print(seikai)
for i in range(q):
    ak = int(input())
    seikai[ak-1] += 1
#print(a)
#print(seikai)
for j in range(n):
    if seikai[j] > q-k:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
#B - Frog 2
#TLE
#

n,k=map(int,input().split())
h = list(map(int,input().split()))
#h[i]は足場[i+1]の高さ

dp = [0]*n

#dp[n-1]まで埋めれば良い

for i in range(1,n):
    c_min=float("inf")
    c_kh=float("inf")
    for j in range(1,k+1):
        #足場i+1までにたどり着くためのコストを考える
        #i~i-k（c[i-1]~c[i-k-1]）の足場からの飛び移り方を考える
        if i-j >= 0:
            c_kh = dp[i-j]+abs(h[i]-h[i-j])
            if c_kh < c_min:
                c_min = c_kh
        dp[i] = c_min
print(dp[n-1])

Fixed submission:
#B - Frog 2
#TLE
#

n,k=map(int,input().split())
h = list(map(int,input().split()))
#h[i]は足場[i+1]の高さ

dp = [0]*n

#dp[n-1]まで埋めれば良い

for i in range(1,n):
    c_min=float("inf")
    c_kh=float("inf")
    for j in range(1,k+1):
        #足場i+1までにたどり着くためのコストを考える
        #i~i-k（c[i-1]~c[i-k-1]）の足場からの飛び移り方を考える
        if i-j >= 0:
            c_kh = dp[i-j]+abs(h[i]-h[i-j])
            if c_kh < c_min:
                c_min = c_kh
        dp[i] = c_min
print(dp[n-1])

Buggy python submission (verdict: Time Limit Exceeded):
#B - Frog 2
#
#

n,k=map(int,input().split())
h = list(map(int,input().split()))
#h[i]は足場[i+1]の高さ

dp = [0]*n

#dp[n-1]まで埋めれば良い

for i in range(n):
    ck=[]
    for j in range(1,k+1):
        #足場i+1までにたどり着くためのコストを考える
        #i~i-k（c[i-1]~c[i-k-1]）の足場からの飛び移り方を考える
        if i-j >= 0:
            ck.append(dp[i-j]+abs(h[i]-h[i-j]))
    if len(ck) ==0:
        dp[i] = 0
    else:
        dp[i] = min(ck)
print(dp[n-1])

Fixed submission:
#B - Frog 2
#TLE
#

n,k=map(int,input().split())
h = list(map(int,input().split()))
#h[i]は足場[i+1]の高さ

dp = [0]*n

#dp[n-1]まで埋めれば良い

for i in range(1,n):
    c_min=float("inf")
    c_kh=float("inf")
    for j in range(1,k+1):
        #足場i+1までにたどり着くためのコストを考える
        #i~i-k（c[i-1]~c[i-k-1]）の足場からの飛び移り方を考える
        if i-j >= 0:
            c_kh = dp[i-j]+abs(h[i]-h[i-j])
            if c_kh < c_min:
                c_min = c_kh
        dp[i] = c_min
print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
#ABC 098 C Attention

n = int(input())
s = input()
cnt = 0
cnt_list = []

for i in range(n):
    for j in range(i):
        if s[j] == "W":
            cnt += 1
    for k in range(i+1,n):
        if s[k] == "E":
            cnt +=1
    cnt_list.append(cnt)
    cnt = 0
print(min(cnt_list))

Fixed submission:
#ABC 098 C Attention

#いちいち全部数え直さない方がいい説
n = int(input())
s = input()
cnt = 0
cnt_list = []

for i in range(1,n):
    if s[i] == "E":
        cnt += 1
cnt_list.append(cnt)
for j in range(1,n):
    if s[j-1] == "W":
        cnt += 1
    if s[j] == "E":
        cnt -= 1
    cnt_list.append(cnt)

print(min(cnt_list))
Buggy python submission (verdict: Runtime Error):
    S = input()
    ans = 0
    if S[0] == "1":
        ans += 1
    if S[1] == "1":
        ans += 1
    if S[2] == "1":
        ans += 1
    print(ans)

Fixed submission:
def resolve():
    S = input()
    ans = 0
    if S[0] == "1":
        ans += 1
    if S[1] == "1":
        ans += 1
    if S[2] == "1":
        ans += 1
    print(ans)
resolve()

Buggy python submission (verdict: Runtime Error):
    S = input()
    ans = 0
    if S[0] == "1":
        ans += 1
    if S[1] == "1":
        ans += 1
    if S[2] == "1":
        ans += 1
    print(ans)

Fixed submission:
def resolve():
    S = input()
    ans = 0
    if S[0] == "1":
        ans += 1
    if S[1] == "1":
        ans += 1
    if S[2] == "1":
        ans += 1
    print(ans)
resolve()
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k, q = map(int, input().split())
point = np.array([k for _ in range(n)])


def judge(point):
    ans = []
    if k > q:
        return(['Yes' for _ in range(n)])
    for _ in range(q):
        a = int(input())
        point -= 1
        point[a-1] += 1
    for i in range(n):
        if point[i] > 0:
            ans.append('Yes')
        else:
            ans.append('No')
    return(ans)
            

ans = judge(point)
print(*ans)

Fixed submission:
n, k, q = map(int, input().split())
def judge():
    val = {}
    for _ in range(q):
        a = int(input())
        val[a-1] = val.get(a-1,0) + 1
    #print(val)
    for i in range(n):
        if val.get(i,k-q) + (k - q) > 0:
            print('Yes')
        else:
            print('No')
if k > q:
    print(*['Yes' for _ in range(n)])
else:
    ans = judge()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k, q = map(int, input().split())
point = np.array([k for _ in range(n)])


def judge(point):
    ans = []
    for _ in range(q):
        a = int(input())
        point -= 1
        point[a-1] += 1
    if k > q:
        return(['Yes' for _ in range(n)])
    for i in range(n):
        if point[i] > 0:
            ans.append('Yes')
        else:
            ans.append('No')
    return(ans)
            

ans = judge(point)
print(*ans)

Fixed submission:
n, k, q = map(int, input().split())
def judge():
    val = {}
    for _ in range(q):
        a = int(input())
        val[a-1] = val.get(a-1,0) + 1
    #print(val)
    for i in range(n):
        if val.get(i,k-q) + (k - q) > 0:
            print('Yes')
        else:
            print('No')
if k > q:
    print(*['Yes' for _ in range(n)])
else:
    ans = judge()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k, q = map(int, input().split())
point = np.array([k for _ in range(n)])
for _ in range(q):
    a = int(input())
    point -= 1
    point[a-1] += 1
for i in range(n):
    if point[i] > 0:
        print('Yes')
    else:
        print('No')

Fixed submission:
n, k, q = map(int, input().split())
def judge():
    val = {}
    for _ in range(q):
        a = int(input())
        val[a-1] = val.get(a-1,0) + 1
    #print(val)
    for i in range(n):
        if val.get(i,k-q) + (k - q) > 0:
            print('Yes')
        else:
            print('No')
if k > q:
    print(*['Yes' for _ in range(n)])
else:
    ans = judge()
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
s = input()
#s.append('e')
prev = 'e'
flag = 0

count = 0
        
for i in range(n):
    #print(flag)
    if i == n - 1:
        if flag == 1:
            count += 1
    if s[i] == 'L':
        if prev == 'R':
            if k == 0:
                ;
            elif flag == 0:
                flag = 1
            else:
                count += 2
                k -= 1
                flag = 0
        elif prev == 'L':
            count += 1
    else:
        if prev == 'L':
            if k == 0:
                ;
            elif flag == 0:
                flag = 1
            else:
                count += 2
                k -= 1
                flag = 0
        elif prev == 'R':
            count += 1
    prev = s[i]
    
print(count)

Fixed submission:
n, k = map(int, input().split())
s = input()
prev = 'e'
flag = 0

count = 0
        
for i in range(n):
    if s[i] == 'L':
        if prev == 'R':
            if k == 0:
                pass
            elif flag == 0:
                flag = 1
            else:
                count += 2
                k -= 1
                flag = 0
        elif prev == 'L':
            count += 1
    else:
        if prev == 'L':
            if k == 0:
                pass
            elif flag == 0:
                flag = 1
            else:
                count += 2
                k -= 1
                flag = 0
        elif prev == 'R':
            count += 1
    if i == n - 1:
        if flag == 1:
            count += 1
    prev = s[i]
    
print(count)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n, k = map(int, input().split())
a = list(map(int, input().split()))
x, y = 0, 0
for i in range(n):
    for j in range(n):
        if a[i] > a[j]:
            x += 1
        if (i < j) and (a[i] > a[j]):
            y += 1
num_np = np.array(num)
sum_left = sum(num_np[:,0])
sum_right = sum(num_np[:,1])
output = (x * k) % 1000000007 + (y * k * (k - 1) // 2) % 1000000007
print(output % 1000000007)

Fixed submission:
import numpy as np
n, k = map(int, input().split())
a = list(map(int, input().split()))
x, y = 0, 0
for i in range(n):
    for j in range(n):
        if a[i] > a[j]:
            x += 1
        if (i < j) and (a[i] > a[j]):
            y += 1

output = ((x * k * (k - 1) // 2) + (y * k)) % 1000000007
print(output)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline
n, q = map(int, input().split())
to = [[] for i in range(n)]
ans = [0 for i in range(n)]
def dfs(v, p = -1):
    for u in to[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v)
for i in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)
for i in range(q):
    p, x = map(int, input().split())
    p -= 1
    ans[p] += x
dfs(0)
print(" ".join(map(str, ans)))

Fixed submission:
import sys
sys.setrecursionlimit(200005) 
input = sys.stdin.readline
n, q = map(int, input().split())
to = [[] for i in range(n)]
ans = [0 for i in range(n)]
def dfs(v, p = -1):
    for u in to[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v)
for i in range(n - 1):
    a, b = map(int, input().split())
    to[a - 1].append(b - 1)
    to[b - 1].append(a - 1)
for i in range(q):
    p, x = map(int, input().split())
    ans[p - 1] += x
dfs(0)
print(*ans)

Buggy python submission (verdict: Runtime Error):
n, q = map(int, input().split())
to = [[] for i in range(n)]
ans = [0 for i in range(n)]
def dfs(v, p = -1):
    for u in to[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v)
for i in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    #to[b].append(a)
for i in range(q):
    p, x = map(int, input().split())
    p -= 1
    ans[p] += x
dfs(0)
print(" ".join(map(str, ans)))

Fixed submission:
import sys
sys.setrecursionlimit(200005) 
input = sys.stdin.readline
n, q = map(int, input().split())
to = [[] for i in range(n)]
ans = [0 for i in range(n)]
def dfs(v, p = -1):
    for u in to[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v)
for i in range(n - 1):
    a, b = map(int, input().split())
    to[a - 1].append(b - 1)
    to[b - 1].append(a - 1)
for i in range(q):
    p, x = map(int, input().split())
    ans[p - 1] += x
dfs(0)
print(*ans)

Buggy python submission (verdict: Runtime Error):
n, q = map(int, input().split())
to = [[] for i in range(n)]
ans = [0 for i in range(n)]
def dfs(v, p = -1):
    for u in to[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v)
for i in range(n - 1):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    to[a].append(b)
    to[b].append(a)
for i in range(q):
    p, x = map(int, input().split())
    p -= 1
    ans[p] += x
dfs(0)
print(" ".join(map(str, ans)))

Fixed submission:
import sys
sys.setrecursionlimit(200005) 
input = sys.stdin.readline
n, q = map(int, input().split())
to = [[] for i in range(n)]
ans = [0 for i in range(n)]
def dfs(v, p = -1):
    for u in to[v]:
        if u == p:
            continue
        ans[u] += ans[v]
        dfs(u, v)
for i in range(n - 1):
    a, b = map(int, input().split())
    to[a - 1].append(b - 1)
    to[b - 1].append(a - 1)
for i in range(q):
    p, x = map(int, input().split())
    ans[p - 1] += x
dfs(0)
print(*ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = {}
ans = 0
for i in s:
    count[i] = count.get(i, 0) + 1
for key, value in count.items():
    ans += value * (value - 1) // 2
print(ans)

Fixed submission:
a, b = map(int,input().split())
print(max([a+b,a-b,a*b]))

Buggy python submission (verdict: Runtime Error):
from functools import reduce
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = {}
ans = 0
for i in s:
    count[i] = count.get(i, 0) + 1
for key, value in count.items():
    ans += value * (value - 1) // 2
print(ans)

Fixed submission:
a, b = map(int,input().split())
print(max([a+b,a-b,a*b]))
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = 0
set_s = list(set(s))
for i in range(len(set_s)):
    s_count = s.count(set_s[i])
    count += s_count * (s_count - 1) // 2
print(count)

Fixed submission:
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = {}
ans = 0
for i in s:
    count[i] = count.get(i, 0) + 1
for key, value in count.items():
    ans += value * (value - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
n = int(input())
s = []
count = 0
for _ in range(n):
    s.append(sorted(input()))
    s[_] = ''.join(s[_])
set_s = list(set(s))
for i in range(len(set_s)):
    s_count = s.count(set_s[i])
    count += s_count * (s_count - 1) // 2
print(count)

Fixed submission:
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = {}
ans = 0
for i in s:
    count[i] = count.get(i, 0) + 1
for key, value in count.items():
    ans += value * (value - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
n = int(input())
s = []
count = 0
for _ in range(n):
    s.append(sorted(input()))
    s[_] = ''.join(s[_]).rstrip('\n')
set_s = set(s)
for i in range(len(set_s)):
    s_count = s.count(list(set_s)[i])
    count += s_count * (s_count - 1) // 2
print(count)

Fixed submission:
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = {}
ans = 0
for i in s:
    count[i] = count.get(i, 0) + 1
for key, value in count.items():
    ans += value * (value - 1) // 2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
count = 0
for _ in range(n):
    s.append(sorted(input()))
for i in range(n-1):
    for j in range(i+1,n):
        if  s[i] == s[j] :
            count += 1
print(count)

Fixed submission:
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = {}
ans = 0
for i in s:
    count[i] = count.get(i, 0) + 1
for key, value in count.items():
    ans += value * (value - 1) // 2
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, len(a)):
    ans = math.gcd(ans, a[i])
    
print(ans)

Fixed submission:
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

n = int(input())
a = list(map(int, input().split()))
ans = a[0]
for i in range(1, len(a)):
    ans = gcd(ans, a[i])
    
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
K = int(input())
n1 = list(s)
n2 = [s[i:i+2] for i in range(len(s)-1)]
n3 = [s[i:i+3] for i in range(len(s)-2)]
cat = list(set(n1 + n2 + n3))
cat.sort()
#print(cat)
print(cat[K-1])

Fixed submission:
s = input()
K = int(input())
n1 = list(s)
n2 = [s[i:i+2] for i in range(len(s)-1)]
n3 = [s[i:i+3] for i in range(len(s)-2)]
n4 = [s[i:i+4] for i in range(len(s)-3)]
n5 = [s[i:i+5] for i in range(len(s)-4)]
cat = list(set(n1 + n2 + n3 + n4 + n5))
cat.sort()
#print(cat)
print(cat[K-1])
Buggy python submission (verdict: Runtime Error):
A, B, C=map(int, input().split())
ANS=C-(A-B)
if ANS>=0:
  print(C-(A-B))
else:
  prtin(0)

Fixed submission:
A, B, C=map(int, input().split())
ANS=C-(A-B)
if ANS>=0:
  print(C-(A-B))
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
N=int(input())
if(100<N<=111):
  ptit(111)
elif(111<N<=222):
  print(222)
elif(222<N<=333):
  print(333)
elif(333<N<=444):
  print(444)
elif(444<N<=555):
  print(555)
elif(555<N<=666):
  print(666)
elif(666<N<=777):
  print(777)
elif(777<N<=888):
  print(888)
elif(888<N<=999):
  print(999)

Fixed submission:
N=int(input())
if(N<=111):
  print(111)
elif(111<N<=222):
  print(222)
elif(222<N<=333):
  print(333)
elif(333<N<=444):
  print(444)
elif(444<N<=555):
  print(555)
elif(555<N<=666):
  print(666)
elif(666<N<=777):
  print(777)
elif(777<N<=888):
  print(888)
elif(888<N<=999):
  print(999)
Buggy python submission (verdict: Runtime Error):
N=int(input())
if(N<105):
  print(0)
elif(105<=N<135):
  print("1")
elif(135<=N<165):
  print("2")
elif(165<=N<189):
  print("3")
elif(189<=N<195):
  print("4")
else:
  print("5")

Fixed submission:
A,B=map(int,input().split())
print((A-1)*(B-1))

Buggy python submission (verdict: Runtime Error):
N=int(input())
if(N<105):
  print(0)
elif(105<=N<135):
  print(1)
elif(135<=N<165):
  print(2)
elif(165<=N<189):
  print(3)
elif(189<=N<195):
  print(4)
else:
  print(5)

Fixed submission:
A,B=map(int,input().split())
print((A-1)*(B-1))

Buggy python submission (verdict: Runtime Error):
N=int(input())
if(N<105):
  print(0)
elif(105<=N<165):
  print(1)
elif(165<=N<195):
  print(2)
else:
  print(3)

Fixed submission:
A,B=map(int,input().split())
print((A-1)*(B-1))
Buggy python submission (verdict: Runtime Error):
A,B,C,D=map(int,input().split())
if(A+B>C+D):
  print("Left")
elif(A+B==C+D):
  print("Balanced")
else:
  ptint("Right")

Fixed submission:
A,B,C,D=map(int,input().split())
if(A+B>C+D):
  print("Left")
elif(A+B==C+D):
  print("Balanced")
else:
  print("Right")

Buggy python submission (verdict: Runtime Error):
A,B,C,D=map(int,input().split())
if(A+B>C+D):
  print("Left")
elif(A+B==C+D):
  print("Balanced")
else:
  ptinr("Right")

Fixed submission:
A,B,C,D=map(int,input().split())
if(A+B>C+D):
  print("Left")
elif(A+B==C+D):
  print("Balanced")
else:
  print("Right")
Buggy python submission (verdict: Runtime Error):
X,t=map(int,input().split())
print(X-t if X-t>0 else 0)

Fixed submission:
x,a,b=map(int,input().split())
if(abs(x-a)>abs(x-b)):
  print("B")
else:
  print("A")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [i + 1 for i in range(n)]
p = a[1:] + [a[0]]
print(sum([a[i] % p[i] for i in range(n)]))

Fixed submission:
n = int(input())
print(n * (n - 1) // 2)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
lst =[]
start = 0
for i in range(len(s) - 1):
	if s[i] == 'L' and s[i + 1] == 'R':
		lst.append(s[start:i + 1])
		start = i + 1
lst.append(s[start:])

def gather_points(rl_string):
	boundary = 0
	ln = len(rl_string)
	for i, s in enumerate(rl_string):
		if s == 'L':
			boundary = i
			break
	evens = (ln + 1) // 2
	odds =  ln // 2
	lst = [0 for _ in range(ln)]
	lst[i - 1] = evens if i % 2 else odds
	lst[i] = odds if i % 2 else evens
	return lst
	
gp = sum([gather_points(l) for l in lst], [])
print(' '.join([str(i) for i in gp]))


		
		


Fixed submission:
s = input()
gp = []
boundary = [0]
ln = len(s)
for i in range(ln - 1):
	ss = s[i:i + 2]
	if ss == 'RL':
		gp.append(i + 1)
	if ss == 'LR':
		boundary.append(i + 1)
boundary.append(ln)
ans = []
group = 0
for i in range(ln):
	if i != gp[group]:
		ans.append('0')
		if i == boundary[group + 1]:
			group += 1
		continue
	gl = boundary[group + 1] - boundary[group]
	evens = (gl + 1) // 2
	odds =  gl // 2
	ans[i - 1] = str(evens if (i - boundary[group]) % 2 else odds)
	ans.append(str(odds if (i - boundary[group]) % 2 else evens))
print(' '.join(ans))
Buggy python submission (verdict: Time Limit Exceeded):
[n, k, q] = list(map(int, input().split()))
a = []
for i in range(q):
    a.append(list(map(int, input().split()))[0])
    
import numpy as np

player = [k] * n
player = np.array(player)

for _a in a:
    player[_a-1] += 1
    player -= 1
           
for _p in player:
    if _p > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
[n, k, q] = list(map(int, input().split()))
a = []
for i in range(q):
    a.append(list(map(int, input().split()))[0])
    
import numpy as np

player = [k] * n
player = np.array(player)

for _a in a:
    player[_a-1] += 1
    
player -= q
           
for _p in player:
    if _p > 0:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
[n, k, q] = list(map(int, input().split()))
a = []
for i in range(q):
    a.append(list(map(int, input().split()))[0])
    
player = [k] * n
for _a in a:
    for _i in range(n):
        if (_i != (_a-1)):
            player[_i] -= 1
            
for _p in player:
    if _p > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
[n, k, q] = list(map(int, input().split()))
a = []
for i in range(q):
    a.append(list(map(int, input().split()))[0])
    
import numpy as np

player = [k] * n
player = np.array(player)

for _a in a:
    player[_a-1] += 1
    
player -= q
           
for _p in player:
    if _p > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input.strip())
print(n**3)

Fixed submission:
n = int(input().strip())
print(n**3)