Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat May  2 00:21:08 2020

@author: Kanaru Sato
"""

N = int(input())
h = list(map(int, input().split()))
memo = [-1]*N
memo[0] = 0
memo[1] = abs(h[1]-h[0])

#topdown
def cost(n):
    if n <= 1 or memo[n] >= 0:
        return memo[n]
    else:
        memo[n] = min(cost(n-2)+abs(h[n]-h[n-2]),cost(n-1)+abs(h[n]-h[n-1]))
        return memo[n]

print(cost(N-1))

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat May  2 00:21:08 2020

@author: Kanaru Sato
"""
import sys
sys.setrecursionlimit(10 ** 6)

N = int(input())
h = list(map(int, input().split()))
memo = [-1]*N
memo[0] = 0
memo[1] = abs(h[1]-h[0])

#topdown
def cost(n):
    if n <= 1 or memo[n] >= 0:
        return memo[n]
    else:
        memo[n] = min(cost(n-2)+abs(h[n]-h[n-2]),cost(n-1)+abs(h[n]-h[n-1]))
        return memo[n]

print(cost(N-1))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat May  2 00:21:08 2020

@author: Kanaru Sato
"""

N = int(input())
h = list(map(int, input().split()))
memo = [0]*N

#topdown
def cost(n):
    if n == 0:
        return 0
    elif n == 1:
        return abs(h[1]-h[0])
    elif memo[n]:
        return memo[n]
    else:
        memo[n] = min(cost(n-2)+abs(h[n]-h[n-2]),cost(n-1)+abs(h[n]-h[n-1]))
        return memo[n]

print(cost(N-1))

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat May  2 00:21:08 2020

@author: Kanaru Sato
"""
import sys
sys.setrecursionlimit(10 ** 6)

N = int(input())
h = list(map(int, input().split()))
memo = [-1]*N
memo[0] = 0
memo[1] = abs(h[1]-h[0])

#topdown
def cost(n):
    if n <= 1 or memo[n] >= 0:
        return memo[n]
    else:
        memo[n] = min(cost(n-2)+abs(h[n]-h[n-2]),cost(n-1)+abs(h[n]-h[n-1]))
        return memo[n]

print(cost(N-1))

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat May  2 00:21:08 2020

@author: Kanaru Sato
"""

n = int(input())
h = list(map(int, input().split()))
memo = [0]*n

#topdown
def cost(n):
    if n == 0:
        return 0
    elif n == 1:
        return abs(h[1]-h[0])
    elif memo[n]:
        return memo[n]
    else:
        memo[n] = min(cost(n-2)+abs(h[n]-h[n-2]),cost(n-1)+abs(h[n]-h[n-1]))
        return memo[n]

print(cost(n-1))

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat May  2 00:21:08 2020

@author: Kanaru Sato
"""
import sys
sys.setrecursionlimit(10 ** 6)

N = int(input())
h = list(map(int, input().split()))
memo = [-1]*N
memo[0] = 0
memo[1] = abs(h[1]-h[0])

#topdown
def cost(n):
    if n <= 1 or memo[n] >= 0:
        return memo[n]
    else:
        memo[n] = min(cost(n-2)+abs(h[n]-h[n-2]),cost(n-1)+abs(h[n]-h[n-1]))
        return memo[n]

print(cost(N-1))
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-
"""
Created on Sat May  2 19:11:18 2020

@author: Kanaru Sato
"""

n,k = list(map(int, input().split()))
h = list(map(int, input().split()))
dp = [float("inf")]*n

for i in range(n):
    if i == 0:
        dp[i] = 0
    elif i == 1:
        dp[i] = abs(h[1]-h[0])
    else:
        for j in range(1,min(i+1,k+1)):
            dp[i] = min(dp[i],dp[i-j]+abs(h[i]-h[i-j]))

print(dp[n-1])

Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat May  2 19:11:18 2020

@author: Kanaru Sato
"""

n,k = list(map(int, input().split()))
h = list(map(int, input().split()))
dp = [float("inf")]*n

for i in range(n):
    if i == 0:
        dp[i] = 0
    elif i == 1:
        dp[i] = abs(h[1]-h[0])
    else:
        for j in range(1,min(i+1,k+1)):
            dp[i] = min(dp[i],dp[i-j]+abs(h[i]-h[i-j]))

print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
N, K = list(map(int, input().split()))
arr = list(map(int, input().split()))
mx_sum = 0
idx = 0
for i in range(N):
    if N <= i + K - 1:
        break
    val = sum(arr[i:i+K])
    if mx_sum <= val:
        mx_sum = val
        idx = i

ans = 0
for i in range(idx, idx+K):
    ans += (arr[i] + 1) / 2
print(ans)


Fixed submission:
class NumArray:
    def __init__(self, nums):
        if len(nums)>0:
            self.length = len(nums)
            self.tree = [0 for _ in range(2*self.length)]
            
            # build tree 
            n = self.length
            i = n
            j = 0
            while i<2*n:
                self.tree[i] = nums[j]
                i += 1
                j += 1
            for i in range(n-1, 0, -1):
                self.tree[i] = self.tree[i*2] + self.tree[i*2 + 1]

    def update(self, pos, val):
        # 0 <= pos < n
        n = self.length
        pos += n
        self.tree[pos] = val
        while (pos > 0):
            left = pos
            right = pos
            if pos%2==0:
                right = pos + 1
            else:
                left = pos - 1
            self.tree[pos//2] = self.tree[left] + self.tree[right]
            pos //= 2
        
    def sumRange(self, l, r):
        if l > r:
            l, r = r, l
        # 0 <= l,r < n
        n = self.length
        l += n
        r += n
        res = 0
        while l<=r:
            # check l is right child
            if l%2==1:
                res += self.tree[l]
                l += 1
            # check r is left child
            if r%2==0:
                res += self.tree[r]
                r -= 1
            l //= 2
            r //= 2
        return res
       


N, K = list(map(int, input().split()))
arr = list(map(int, input().split()))
seg_sum_tree = NumArray(arr)

mx_sum = 0
idx = 0
for i in range(N):
    if N <= i + K - 1:
        break
    val = seg_sum_tree.sumRange(i, i+K-1)
    if mx_sum <= val:
        mx_sum = val
        idx = i

ans = 0
for i in range(idx, idx+K):
    ans += (arr[i] + 1) / 2
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

N, M = map(int, input().split())
graph = [set() for _ in range(N+1)]
for i in range(M):
    a, b = map(int, input().split())
    graph[a].add(b)
    graph[b].add(a)

def bfs(graph):
    visited = set()
    queue = deque()
    queue.append(1)
    ans = [0] * (N+1)
    while queue:
        cur = queue.popleft()
        visited.add(cur)
        for n in graph[cur]:
            if n not in visited and n not in queue:
                ans[n] = cur
                queue.append(n)
    return ans

ans = bfs(graph)
print("Yes")
for i in range(2, len(ans)):
    print(ans[i])

Fixed submission:
import sys
from collections import deque
 
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
 
N, M = lr()
graph = [[] for _ in range(N+1)]
for _ in range(M):
    a, b = lr()
    graph[a].append(b)
    graph[b].append(a)
 
def bfs():
    que = deque([1])
    dir = [None] * (N+1)    
    while que:
        cur = que.popleft()
        for n in graph[cur]:
            if dir[n] != None:
                continue
            dir[n] = str(cur)
            que.append(n)
    return dir
 
dir = bfs()
print('Yes')
print('\n'.join(dir[2:]))
Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())
N = len(S)
count = 0
for i in range(N - 3):
    for j in range(i + 3, N):
        if int("".join(S[i : j+1])) % 2019 == 0:
            count += 1
print(count)

Fixed submission:
from collections import Counter
s = input()

n = len(s)
dp = [0] * (n + 1)

for i in range(n - 1, -1, -1):
    dp[i] = (dp[i + 1] + pow(10, (n - i - 1), 2019) * int(s[i])) % 2019

c = Counter(dp)

ans = 0
for i in c.values():
    ans += i * (i - 1) // 2

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
S = list(input())
N = len(S)
count = 0
for i in range(N):
    for j in range(i + 3, N):
        if int("".join(S[i : j+1])) % 2019 == 0:
            count += 1

print(count)

Fixed submission:
from collections import Counter
s = input()

n = len(s)
dp = [0] * (n + 1)

for i in range(n - 1, -1, -1):
    dp[i] = (dp[i + 1] + pow(10, (n - i - 1), 2019) * int(s[i])) % 2019

c = Counter(dp)

ans = 0
for i in c.values():
    ans += i * (i - 1) // 2

print(ans)
Buggy python submission (verdict: Runtime Error):
k=int(input())
cand=[[1,2,3,4,5,6,7,8,9]]
for _ in range(9): #上記の操作を9回繰り返せば10^5個以上のルンルン数を列挙できる
  tmp=[]
  for val in cand[-1]:
    if val%10!=0: #末尾が0のときは(末尾-1)を付け加えた数はルンルン数にならない
      tmp.append(val*10+(val%10-1))
    tmp.append(val*10+(val%10))
    if val%10!=9: #末尾が9のときは(末尾+1)を付け加えた数はルンルン数にならない
      tmp.append(val*10+(val%10+1))
cand.append(tmp)
ans=[]
for i in range(len(cand)):
  for val in cand[i]:
    ans.append(val)

print(ans[k-1])


Fixed submission:
from collections import deque

k = int(input())
q = deque(range(1,10))
for i in range(k):
    x = q.popleft()
    if x % 10 != 0:
        q.append(10 * x + (x % 10 - 1))
    q.append(10 * x + (x % 10))
    if x % 10 != 9:
        q.append(10 * x + (x % 10 + 1))
print(x)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a = [int(i) for i in input().split()]

d = {}

for i in range(N):
    if a[i] not in d:
        d[a[i]] = 1
    else:
        d[a[i]] += 1

for i in range(N):
    d[a[i]] -= 1

    su = 0
    for j in d.values():
      su += int(j * (j - 1) / 2)
    print(su)

    d[a[i]] += 1

Fixed submission:
from collections import defaultdict

N = int(input())
A = [int(i) for i in input().split()]

d = defaultdict(int)
for i in range(N):
    d[A[i]] += 1

total = 0
for v in d.values():
    if v != 1 and v != 0:
        total += int(v * (v - 1) / 2)

for i in range(N):
    tmp = d[A[i]] - 1
    print(total - tmp)
Buggy python submission (verdict: Runtime Error):
S = input()
Q = int(input())
re = False
front = []
back = []

for i in range(Q):
    t = input()
    
    if len(t) == 1:
        re = not re
        
    else:
        q, f, c = t.split()
        if (re == True and int(f) == 2) or (re == False and int(f) == 1):
            front.append(c)
        elif (re == True and int(f) == 1) or (re == False and int(f) == 2):
            back.append(c)

if re == False:
    front.reverse()
    F = "".join(front)
    B = "".join(back)
    print(F + S + B)
else:
    back.reverse()
    S.reverse()
    F = "".join(front)
    B = "".join(back)
    print(B + S + F)

Fixed submission:
S = input()
Q = int(input())
re = False
front = []
back = []

for i in range(Q):
    t = input()
    
    if len(t) == 1:
        re = not re
        
    else:
        q, f, c = t.split()
        if (re == True and int(f) == 2) or (re == False and int(f) == 1):
            front.append(c)
        elif (re == True and int(f) == 1) or (re == False and int(f) == 2):
            back.append(c)

if re == False:
    front.reverse()
    F = "".join(front)
    B = "".join(back)
    print(F + S + B)
else:
    back.reverse()
    S = S[::-1]
    F = "".join(front)
    B = "".join(back)
    print(B + S + F)
Buggy python submission (verdict: Runtime Error):
import statistics

N = int(input())
X = [int(i) for i in input().split()]
X.sort()
mid = statistics.mean(X)
ans = 0
ans1 = 0
ans2 = 0
print(mid)
for i in range(N):
    ans1 += (X[i] - int(mid)) ** 2
    ans2 += (X[i] - int(mid) - 1) ** 2
ans = min(ans1, ans2)

print(ans)

Fixed submission:
import statistics

N = int(input())
X = [int(i) for i in input().split()]
X.sort()
mid = statistics.mean(X)
ans = 0
ans1 = 0
ans2 = 0

for i in range(N):
    ans1 += (X[i] - int(mid)) ** 2
    ans2 += (X[i] - int(mid) - 1) ** 2
ans = min(ans1, ans2)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()
s = set()

for i in range(N - 2):
    for j in range(i + 1, N - 1):
        for k in range(j + 1, N):
            s.add(S[i] + S[j] + S[k])

print(len(s))

Fixed submission:
N = int(input())
S = input()
count = 0

# s = set()
# for i in range(N - 2):
#     for j in range(i + 1, N - 1):
#         for k in range(j + 1, N):
#             s.add(S[i] + S[j] + S[k])

# print(len(s))

def get_idx(array, val, tmp):
    for i in range(tmp + 1, len(array)):
        if val == array[i]:
            return i
    return -1

V = []
for i in range(1000):
    if i < 10: V.append("00" + str(i))
    elif i < 100: V.append("0" + str(i))
    else: V.append(str(i))

for v in V:
    tmp = -1
    flag = True
    for i in range(3):
        if v[i] in S:
            idx = get_idx(S, v[i], tmp)
            if idx != -1:
                tmp = idx
            else:
                flag = False
                break
        else:
            flag = False
            break
    if flag:
        count += 1

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

i = 2
while True:
    if i % N == 0:
        print(i)
        break
    i += 2

Fixed submission:
N = int(input())
if N % 2 != 0:
    print(2 * N)
else:
    print(N)
Buggy python submission (verdict: Runtime Error):
import statistics

N = int(input())
A = [int(i) for i in input().split()]
B = [(A[i] - (i+1)) for i in range(N)]
b = statistics.median(B)
sum = 0
for i in range(N):
    sum += abs(B[i] - b)
print(int(sum))

Fixed submission:
import statistics

N = int(input())
A = [int(i) for i in input().split()]
B = [(A[i] - (i+1)) for i in range(N)]
b = statistics.median(B)
sum = 0
for i in range(N):
    sum += abs(B[i] - b)
print(int(sum))

Buggy python submission (verdict: Runtime Error):
import statistics

N = int(input())
A = [int(i) for i in input().split()]
B = [A[i] - (i+1) for i in range(N)]
b = statistics.median(B)
sum = 0
for i in range(N):
    sum += abs(B[i] - b)
print(int(sum))

Fixed submission:
import statistics

N = int(input())
A = [int(i) for i in input().split()]
B = [(A[i] - (i+1)) for i in range(N)]
b = statistics.median(B)
sum = 0
for i in range(N):
    sum += abs(B[i] - b)
print(int(sum))

Buggy python submission (verdict: Runtime Error):
import statistics

N = int(input())
A = [int(i) for i in input().split()]
B = [A[i] - (i+1) for i in range(N)]
B.sort()
b = statistics.median(B)
sum = 0
for i in range(N):
    sum += B[i] - b
print(sum)

Fixed submission:
import statistics

N = int(input())
A = [int(i) for i in input().split()]
B = [(A[i] - (i+1)) for i in range(N)]
b = statistics.median(B)
sum = 0
for i in range(N):
    sum += abs(B[i] - b)
print(int(sum))
Buggy python submission (verdict: Runtime Error):
s1, s2, s3 = input().split()
print(f"A{s2[0]}C")

Fixed submission:
s1, s2, s3 = input().split()
print("{0}{1}{2}".format(s1[0], s2[0], s3[0]))

Buggy python submission (verdict: Runtime Error):
s1, s2, s3 = input().split()

print(f"{s1[0]}{s2[0]}{s3[0]}")

Fixed submission:
s1, s2, s3 = input().split()
print("{0}{1}{2}".format(s1[0], s2[0], s3[0]))

Buggy python submission (verdict: Runtime Error):
s1, s2, s3 = input().split()

print(f"{s1[0]}{s2[0]}{s3[0]}")

Fixed submission:
s1, s2, s3 = input().split()
print("{0}{1}{2}".format(s1[0], s2[0], s3[0]))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from collections import Counter

input = sys.stdin.readline
cache = {}


def dfs(n):
    ret = cache.get(n)
    if ret is not None:
        return ret
    ret = 0
    for i in range(1, n + 1):
        ret += (i - 1)
        cache[i] = ret
    return ret


def get_ans(counter):
    ret = 0
    for key, value in counter.items():
        ret += dfs(value)
    return ret


def main():
    _ = int(input())
    nums = list(map(int, input().split()))

    counter = Counter()
    for num in nums:
        counter[num] += 1

    for num in nums:
        counter[num] -= 1
        print(get_ans(counter))
        counter[num] += 1


if __name__ == '__main__':
    main()


Fixed submission:
import sys
from collections import Counter

input = sys.stdin.readline


def main():
    int(input())
    nums = list(map(int, input().split()))

    counter = Counter()
    ret = 0
    for num in nums:
        counter[num] += 1
        ret += (counter[num] - 1)

    for num in nums:
        ret -= (counter[num] - 1)
        print(ret)
        ret += (counter[num] - 1)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys

input = sys.stdin.readline


def main():
    a, b, m = map(int, input().split())
    refrigerators = list(map(int, input().split()))
    microwaves = list(map(int, input().split()))
    tickets = [list(map(int, input().split())) for _ in range(m)]
    tickets_map = {}
    for x, y, c in tickets:
        key = f'{x - 1}:{y - 1}'
        tickets_map[key] = c

    ret = 99999999999999
    for x in range(a):
        for y in range(b):
            key = f'{x}:{y}'
            d = tickets_map.get(key, 0)
            p = refrigerators[x] + microwaves[y] - d
            ret = min(ret, p)
    print(ret)


if __name__ == '__main__':
    main()


Fixed submission:
import sys

input = sys.stdin.readline


def main():
    a, b, m = map(int, input().split())
    refrigerators = list(map(int, input().split()))
    microwaves = list(map(int, input().split()))
    tickets = [list(map(int, input().split())) for _ in range(m)]

    x_ret = min(refrigerators)
    y_ret = min(microwaves)
    ret = x_ret + y_ret
    for x, y, c in tickets:
        p = refrigerators[x - 1] + microwaves[y - 1] - c
        ret = min(ret, p)
    print(ret)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys

input = sys.stdin.readline


def main():
    n, m = map(int, input().split())
    if m == 0:
        print(10 ** (n - 1))
        return

    numbers = [-1 for _ in range(n)]
    ret = ''
    for _ in range(m):
        s, c = map(int, input().split())
        if s == 1 and c == 0:
            ret = -1

        if numbers[s - 1] == -1:
            numbers[s - 1] = c
        elif numbers[s - 1] != c:
            ret = -1

    if ret == -1:
        print(ret)
        return

    for i in range(len(numbers)):
        if numbers[i] == -1:
            if i == 0:
                numbers[i] = 1
            else:
                numbers[i] = 0
        if numbers[i] < 0 or numbers[i] > 9:
            ret = -1
            break
        ret += str(numbers[i])

    print(int(ret))


if __name__ == '__main__':
    main()


Fixed submission:
import math
import sys

input = sys.stdin.readline


def main():
    n = int(input())
    print(math.ceil(n / 2))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
[n, m] = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
st = [{} for _ in range(n)]
for i in range(m):
    [a, b] = [int(i) for i in input().split()]
    st[a-1].add(b-1)
    st[b-1].add(a-1)
cnt = 0
for i, height in enumerate(h):
    line = []
    for huga in st[i]:
        line.append(h[huga])
    if height > max(line):
        cnt += 1
print(cnt)

Fixed submission:
[n, m] = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
st = [set([]) for _ in range(n)]
for i in range(m):
    [a, b] = [int(i) for i in input().split()]
    st[a-1].add(b-1)
    st[b-1].add(a-1)
cnt = 0
for i, height in enumerate(h):
    line = []
    for huga in st[i]:
        line.append(h[huga])
    if len(line) == 0 or height > max(line):
        cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
[n, m] = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
st = [[] for _ in range(n)]
for i in range(m):
    [a, b] = [int(i) for i in input().split()]
    st[a-1].append(b-1)
    st[b-1].append(a-1)
cnt = 0
for i, height in enumerate(h):
    line = []
    hoge = set(st[i])
    for huga in hoge:
        line.append(h[huga])
    if type(huga) is int:
        if height > huga:
            cnt += 1
    elif height > max(huga):
        cnt += 1
print(cnt)

Fixed submission:
[n, m] = [int(i) for i in input().split()]
h = [int(i) for i in input().split()]
st = [set([]) for _ in range(n)]
for i in range(m):
    [a, b] = [int(i) for i in input().split()]
    st[a-1].add(b-1)
    st[b-1].add(a-1)
cnt = 0
for i, height in enumerate(h):
    line = []
    for huga in st[i]:
        line.append(h[huga])
    if len(line) == 0 or height > max(line):
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
hoge = {}
for i in range(100):
    hoge[i] = i**5
for i in range(100):
    hoge[-i] = -i**5
x = int(input())
for i in hoge.items():
    for j in hoge.items():
        if i[1] - j[1] == x:
            print(i[0], j[0])
            return

Fixed submission:
hoge = {}
for i in range(1000):
    hoge[i] = i**5
for i in range(1000):
    hoge[-i] = -i**5
x = int(input())
for i in hoge.items():
    for j in hoge.items():
        if i[1] - j[1] == x:
            print(i[0], j[0])
            break
    else:
        continue
    break
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
kehin = []
for i in range(n):
    s = input()
    if not s in kehin:
        kehin.append(s)
print(len(kehin))

Fixed submission:
n = int(input())
kehin = []
for i in range(n):
    s = input()
    kehin.append(s)
kehin = set(kehin)
print(len(kehin))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
kehin = []
for i in range(n):
    s = input()
    if not s in kehin:
        kehin.append(s)
print(len(kehin))


Fixed submission:
n = int(input())
kehin = []
for i in range(n):
    s = input()
    kehin.append(s)
kehin = set(kehin)
print(len(kehin))
Buggy python submission (verdict: Runtime Error):
import math
[a, b] = [int(i) for i in input().split()]

for i in range(3000):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        print(i)
        return
print(-1)



Fixed submission:
import math
[a, b] = [int(i) for i in input().split()]

for i in range(3000):
    if math.floor(i*0.08)==a and math.floor(i*0.1)==b:
        print(i)
        break
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
def main():
  [n, k] = [int(i) for i in input().split()]
  [r, s, p] = [int(i) for i in input().split()]
  T =  input()
  
  my = T.replace("r", "hoge").replace("s", "r").replace("p", "s").replace("hoge", "p") 
  for i in range(k, n):
    if my[i] == my[i-k]:
      my = my[:i] + "l" + my[i+1:]  
      
  print(my.count("r")* r + my.count("s")*s + my.count("p")* p)
  
if __name__ == "__main__":
  main()

Fixed submission:
def main():
    [s, t] = input().split()
    print(t + s)

if __name__ == "__main__":
	main()
Buggy python submission (verdict: Runtime Error):
def main():
  [a, t, k] = [int(i) for i in input().split()]
  if a + t >= k:
    a = 0
    t = 0
  elif a >= k:
    a = 0
    t = t - (k -a)
  else:
    a = a - k:

if __name__ == "__main__":
  main()
  

Fixed submission:
def main():
  [a, t, k] = [int(i) for i in input().split()]
  if a + t <= k:
    a = 0
    t = 0
  elif a <= k:
    t = t - (k - a)
    a = 0
  else:
    a = a - k
  print(a, t)

if __name__ == "__main__":
  main()
Buggy python submission (verdict: Runtime Error):
def main():
  x = int(input())
  sosu = [2]
  tgt = 2
  is_sosu = True
  while(1):
    for i in sosu:
      if tgt % i = 0:
        flag = False
        break
    if tgt < x:
      sosu.append(tgt)
      tgt += 1
    else:
      print(tgt)
      break

if __name__ == "__main__":
  main()

Fixed submission:
def main():
  x = int(input())
  sosu = []
  tgt = 2
  is_sosu = True
  while(1):
    for i in sosu:
      if tgt % i == 0:
        is_sosu = False
        break
    if is_sosu:
      sosu.append(tgt)
    if tgt >= x and is_sosu:
      print(tgt)
      break
    else:
      tgt += 1
      is_sosu = True

if __name__ == "__main__":
  main()