Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from collections import Counter
from math import factorial
n = int(input())
ct_ls = []
for i in range(n):
    ct_ls.append("".join(sorted(input())))
ct = Counter(ct_ls)
_ct = 0
for n in ct.values():
    if n >= 2:
        _ct += factorial(n) / factorial(2) / factorial(n - 2)
print(int(_ct))

Fixed submission:
from collections import Counter
n = int(input())
ct_ls = []
for i in range(n):
    ct_ls.append("".join(sorted(input())))
ct = Counter(ct_ls)
_ct = 0
for n in ct.values():
    if n >= 2:
        _ct += n * (n - 1) / 2
print(int(_ct))

Buggy python submission (verdict: Time Limit Exceeded):
from itertools import combinations
n = int(input())
ct_ls = []
for i in range(n):
    ct_ls.append(sorted(input()))
cnt = 0
for combi in combinations(ct_ls, 2):
    if combi[0] == combi[1]:
        cnt += 1
print(cnt)

Fixed submission:
from collections import Counter
n = int(input())
ct_ls = []
for i in range(n):
    ct_ls.append("".join(sorted(input())))
ct = Counter(ct_ls)
_ct = 0
for n in ct.values():
    if n >= 2:
        _ct += n * (n - 1) / 2
print(int(_ct))
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
memo_ls = [[0 for j in range(13)] for i in range(len(S) + 1)]
memo_ls[0][0] = 1
for i in range(len(S)):
    for _ in range(10):
        if S[i] != "?" and int(S[i]) != _:
            continue
        for j in range(13):
            memo_ls[i + 1][(j * 10 + _) % 13] += memo_ls[i][j]
    for j in range(13):
        memo_ls[i + 1][j] %= 10**9+7

print(memo_ls[len(S)][5])

Fixed submission:
S = input()
memo_ls = [[0 for j in range(13)] for i in range(len(S) + 1)]
memo_ls[0][0] = 1
for i in range(len(S)):
    for _ in range(10):
        if S[i] != "?" and int(S[i]) != _:
            continue
        for j in range(13):
            memo_ls[i + 1][(j * 10 + _) % 13] += memo_ls[i][j]
    for j in range(13):
        memo_ls[i + 1][j] %= 10**9+7

print(memo_ls[len(S)][5])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_ls = []
for i in range(n):
    a_ls.append(int(input()))
cnt = 0
while len(a_ls) > 0:
    cnt += 1
    L_ls = [a_ls[0]]
    for a in a_ls[1:]:
        if L_ls[-1] < a:
            L_ls.append(a)
    for a in L_ls:
        a_ls.remove(a)
print(cnt)

Fixed submission:
import bisect
n = int(input())
a_ls = []
for i in range(n):
    a_ls.append(-int(input()))
L_ls = [a_ls[0]]
for a in a_ls[1:]:
    if L_ls[-1] <= a:
        L_ls.append(a)
    else:
        L_ls[bisect.bisect_right(L_ls, a)] = a
print(len(L_ls))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n = int(input())
a_ls = []
for i in range(n):
    a_ls.append(int(input()))
cnt = 0
while len(a_ls) > 0:
    cnt += 1
    L_ls = [a_ls[0]]
    for a in a_ls[1:]:
        if L_ls[-1] < a:
            L_ls.append(a)
        else:
            L_ls[bisect.bisect_left(L_ls, a)] = a
    for a in L_ls:
        a_ls.remove(a)
print(cnt)

Fixed submission:
import bisect
n = int(input())
a_ls = []
for i in range(n):
    a_ls.append(-int(input()))
L_ls = [a_ls[0]]
for a in a_ls[1:]:
    if L_ls[-1] <= a:
        L_ls.append(a)
    else:
        L_ls[bisect.bisect_right(L_ls, a)] = a
print(len(L_ls))
Buggy python submission (verdict: Runtime Error):
import sys
from math import gcd
a, b, c, d = [int(i) for i in sys.stdin.readline().split()]
gcd_cd = gcd(c, d)
lcm = c * d // gcd_cd
n_c = b // c - (a - 1) // c
n_d = b // d - (a - 1) // d
n_cd = b // lcm - (a - 1) // lcm
res = (b - a + 1) - n_c - n_d + n_cd
print(res)

Fixed submission:
import sys
def gcd(x, y):
    while True:
        if x > y:
            x %= y
        else:
            y %= x
        if x == 0 or y == 0:
            break
    return max(x, y)

a, b, c, d = [int(i) for i in sys.stdin.readline().split()]
gcd_cd = gcd(c, d)
lcm = c * d // gcd_cd
n_c = b // c - (a - 1) // c
n_d = b // d - (a - 1) // d
n_cd = b // lcm - (a - 1) // lcm
res = (b - a + 1) - n_c - n_d + n_cd
print(res)
Buggy python submission (verdict: Runtime Error):
import sys
from collections import Counter
n = int(input())
ls = []
for i in range(n):
    x, y = [int(i) for i in sys.stdin.readline().split()]
    ls.append((x, y))
res = []
for i in range(n - 1):
    for j in range(i+1, n):
        res.append((ls[j][0] - ls[i][0], ls[j][1] - ls[i][1]))
ct = Counter(res)
print(n - max(ct.values()))

Fixed submission:
import sys
from collections import Counter
n = int(input())
ls = []
if n == 1:
    print(1)
else:
    for i in range(n):
        x, y = [int(i) for i in sys.stdin.readline().split()]
        ls.append((x, y))
    res = []
    for i in range(n - 1):
        for j in range(i+1, n):
            res.append((ls[j][0] - ls[i][0], ls[j][1] - ls[i][1]))
            res.append((- ls[j][0] + ls[i][0], - ls[j][1] + ls[i][1]))
    ct = Counter(res)
    print(n - max(ct.values()))

Buggy python submission (verdict: Runtime Error):
import sys
from collections import Counter
n = int(input())
ls = []
for i in range(n):
    x, y = [int(i) for i in sys.stdin.readline().split()]
    ls.append((x, y))
res = [[0 for i in range(n)] for j in range(n)]
ct = Counter()
for i in range(n - 1):
    for j in range(i+1, n):
        res[i][j] = (ls[j][0] - ls[i][0], ls[j][1] - ls[i][1])
        res[j][i] = (- ls[j][0] + ls[i][0], - ls[j][1] + ls[i][1])
    ct.update(res[i])
ct.pop(0)
print(n - max(ct.values()))

Fixed submission:
import sys
from collections import Counter
n = int(input())
ls = []
if n == 1:
    print(1)
else:
    for i in range(n):
        x, y = [int(i) for i in sys.stdin.readline().split()]
        ls.append((x, y))
    res = []
    for i in range(n - 1):
        for j in range(i+1, n):
            res.append((ls[j][0] - ls[i][0], ls[j][1] - ls[i][1]))
            res.append((- ls[j][0] + ls[i][0], - ls[j][1] + ls[i][1]))
    ct = Counter(res)
    print(n - max(ct.values()))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
res = []
ind = 0
len_s = len(s)
string = ""
while ind < len_s:
    _s = s[ind]
    if _s == "A":
        string += "A"
        ind += 1
    elif _s == "B" and ind + 1 < len_s and s[ind + 1] == "C":
        string += "BC"
        ind += 2
    else:
        if len(string) > 0:
            res.append(string)
            string = ""
        ind += 1
if len(string) > 0:
    res.append(string)


def count(string):
    cnt = 0
    ind = len(string) - 1
    res = 0
    while ind >= 0:
        s = string[ind]
        if s == "C":
            ind -= 2
            cnt += 1
        else:
            ind -= 1
            res += cnt
    return res

ans = 0
for r in res:
    ans += count(r)
print(ans)

Fixed submission:
s = input()
ind = 0
len_s = len(s)
string = ""
cnt = 0
ans = 0
while ind < len_s:
    _s = s[ind]
    if _s == "A":
        cnt += 1
        ind += 1
    elif _s == "B" and ind + 1 < len_s and s[ind + 1] == "C":
        ind += 2
        ans += cnt
    else:
        cnt = 0
        ind += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import re
s = input()
res = re.finditer(r"(A*(BC)+)+", s)

def count(string):
    cnt = 0
    ind = len(string) - 1
    res = 0
    while ind >= 0:
        s = string[ind]
        if s == "C":
            ind -= 2
            cnt += 1
        else:
            ind -= 1
            res += cnt
    return res

ans = 0
for r in res:
    ans += count(r.group())
print(ans)


Fixed submission:
s = input()
ind = 0
len_s = len(s)
string = ""
cnt = 0
ans = 0
while ind < len_s:
    _s = s[ind]
    if _s == "A":
        cnt += 1
        ind += 1
    elif _s == "B" and ind + 1 < len_s and s[ind + 1] == "C":
        ind += 2
        ans += cnt
    else:
        cnt = 0
        ind += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
n, k = [int(i) for i in sys.stdin.readline().split()]
v_ls = [int(i) for i in sys.stdin.readline().split()]
inv_v_ls = v_ls[::-1]
sum_a_b = min(n, k) + 1
INF = 1e10
best = -INF
for a in range(sum_a_b):
    for b in range(sum_a_b - a):
        ls = v_ls[:a] + inv_v_ls[:b]
        ls.sort()
        for c in range(sum_a_b - a - b):
            score = sum(ls[c:])
            if score > best:
                best = score
            if v_ls[c] > 0:
                break
print(best)

Fixed submission:
import sys
n, k = [int(i) for i in sys.stdin.readline().split()]
v_ls = [int(i) for i in sys.stdin.readline().split()]
inv_v_ls = v_ls[::-1]
sum_a_b = min(n, k) + 1
best = 0
for a in range(sum_a_b):
    for b in range(sum_a_b - a):
        ls = v_ls[:a] + inv_v_ls[:b]
        ls.sort()
        for c in range(k + 1 - a - b):
            if c >= len(ls):
                break
            score = sum(ls[c:])
            if score > best:
                best = score
            if ls[c] > 0:
                break
print(best)

Buggy python submission (verdict: Runtime Error):

import sys
n, k = [int(i) for i in sys.stdin.readline().split()]
v_ls = [int(i) for i in sys.stdin.readline().split()]
right_memo_ls = [[0 for i in range(k)]for j in range(k)]
left_memo_ls = [[0 for i in range(k)]for j in range(k)]
right_memo_ls[0][0] = 0
left_memo_ls[0][0] = 0
INF = 1e10
right_cost2val = {i : -INF for i in range(1+k)}
left_cost2val = {i : -INF for i in range(1+k)}
right_cost2val[0] = 0
left_cost2val[0] = 0
for i in range(k):
    for j in range(0, min(k - i, i + 2)):
        if j == 0:
            right_memo_ls[i][j] = right_memo_ls[max(0,i-1)][j] + v_ls[i]
            left_memo_ls[i][j] = left_memo_ls[max(0,i-1)][j] + v_ls[-i - 1]
        elif j == i+1:
            right_memo_ls[i][j] = 0
            left_memo_ls[i][j] = 0
        else:
            right_memo_ls[i][j] = max(right_memo_ls[max(0, i-1)][max(0, j-1)], right_memo_ls[max(0, i-1)][j] + v_ls[i])
            left_memo_ls[i][j] = max(left_memo_ls[max(0, i-1)][max(0, j-1)], left_memo_ls[max(0, i-1)][j] + v_ls[-i-1])
        right_cost2val[i + j + 1] = max(right_cost2val[i + j + 1], right_memo_ls[i][j])
        left_cost2val[i + j + 1] = max(left_cost2val[i + j + 1], left_memo_ls[i][j])


best = -INF
for i in range(k+1):
    for j in range(k+1-i):
        score = right_cost2val[i] + left_cost2val[j]
        if best < score:
            best = score
print(best)

Fixed submission:
import sys
n, k = [int(i) for i in sys.stdin.readline().split()]
v_ls = [int(i) for i in sys.stdin.readline().split()]
inv_v_ls = v_ls[::-1]
sum_a_b = min(n, k) + 1
best = 0
for a in range(sum_a_b):
    for b in range(sum_a_b - a):
        ls = v_ls[:a] + inv_v_ls[:b]
        ls.sort()
        for c in range(k + 1 - a - b):
            if c >= len(ls):
                break
            score = sum(ls[c:])
            if score > best:
                best = score
            if ls[c] > 0:
                break
print(best)
Buggy python submission (verdict: Runtime Error):
N, K = [int(i) for i in input().split()]
S = input()
S[K-1] = S[K-1].lower()
print(S)

Fixed submission:
N, K = [int(i) for i in input().split()]
S = input()
S = S[:K-1] + S[K-1].lower() + S[K:]
print(S)

Buggy python submission (verdict: Runtime Error):
N, K = [int(i) for i in input().split()]
S = input()
S[K] = S[K].lower()
print(S)

Fixed submission:
N, K = [int(i) for i in input().split()]
S = input()
S = S[:K-1] + S[K-1].lower() + S[K:]
print(S)
Buggy python submission (verdict: Runtime Error):
import sys
r, g, b, n = [int(i) for i in sys.stdin.readline().split()]
memo_ls = [[0 for j in range(n+1)] for i in range(4)]
memo_ls[0][0] = 1
for i, color in enumerate([r, g, b], 1):
    for j in range(n + 1):
        memo_ls[i][j] = memo_ls[i-1][j] + memo_ls[i][j-color]
print(memo_ls[-1][-1])

Fixed submission:
import sys
r, g, b, n = [int(i) for i in sys.stdin.readline().split()]
memo_ls = [[0 for j in range(n+1)] for i in range(4)]
memo_ls[0][0] = 1
for i, color in enumerate(sorted([r, g, b]), 1):
    for j in range(n + 1):
        if j >= color:
            memo_ls[i][j] = memo_ls[i-1][j] + memo_ls[i][j-color]
        else:
            memo_ls[i][j] = memo_ls[i-1][j]
print(memo_ls[-1][-1])
Buggy python submission (verdict: Runtime Error):
data_ls = []
for i in range(5):
  data_ls.append(int(input()))
k = int(input())
sort(data_ls)
if data_ls[-1] - data_ls[0] > k:
  print("Yay!")
else:
  print(":(")

Fixed submission:
data_ls = []
for i in range(5):
  data_ls.append(int(input()))
k = int(input())
data_ls.sort()
if data_ls[-1] - data_ls[0] > k:
  print(":(")
else:
  print("Yay!")
Buggy python submission (verdict: Time Limit Exceeded):
import heapq
import sys
from itertools import product
X, Y, Z, K = [int(i) for i in sys.stdin.readline().split()]
A_ls = [int(i) for i in sys.stdin.readline().split()]
B_ls = [int(i) for i in sys.stdin.readline().split()]
C_ls = [int(i) for i in sys.stdin.readline().split()]
_sum_ls = []
for a, b, c in product(A_ls, B_ls, C_ls):
    _sum_ls.append(- (a + b + c))
heapq.heapify(_sum_ls)
for i in range(K):
    k = heapq.heappop(_sum_ls)
    print(-k)

Fixed submission:
import heapq
import sys
from itertools import product
X, Y, Z, K = [int(i) for i in sys.stdin.readline().split()]
A_ls = [int(i) for i in sys.stdin.readline().split()]
B_ls = [int(i) for i in sys.stdin.readline().split()]
C_ls = [int(i) for i in sys.stdin.readline().split()]
A_ls.sort(reverse=True)
B_ls.sort(reverse=True)
C_ls.sort(reverse=True)
_sum_ls = [(-(A_ls[0] + B_ls[0] + C_ls[0]), 0, 0, 0)]
heapq.heapify(_sum_ls)
for i in range(K):
    score, a, b, c = heapq.heappop(_sum_ls)
    print(- score)
    if len(A_ls) > a+1:
        cand = (- (A_ls[a+1] + B_ls[b] + C_ls[c]), a+1, b, c)
        if not cand in _sum_ls:
            heapq.heappush(_sum_ls, cand)
    if len(B_ls) > b+1:
        cand = (- (A_ls[a] + B_ls[b+ 1] + C_ls[c]), a, b+1, c)
        if not cand in _sum_ls:
            heapq.heappush(_sum_ls, cand)
    if len(C_ls) > c+1:
        cand = (- (A_ls[a] + B_ls[b] + C_ls[c+1]), a, b, c+1)
        if not cand in _sum_ls:
            heapq.heappush(_sum_ls, cand)
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = [int(i) for i in input().split()]
S = input()
ind_ls = list()
for i in range(len(S) - 1):
    if S[i:i+2] == "AC":
       ind_ls.append(i)
for i in range(Q):
    l, r = [int(i) for i in input().split()]
    l -= 1
    r -= 1
    print(len([i for i in ind_ls if l <= i < r]))

Fixed submission:
import bisect
import sys
N, Q = [int(i) for i in input().split()]
S = input()
ind_ls = list()
for i in range(len(S) - 1):
    if S[i:i+2] == "AC":
        ind_ls.append(i)
        i += 1
        continue
    if S[i+1] != "A":
        i += 1
for i in range(Q):
    l, r = [int(i) for i in sys.stdin.readline().split()]
    l -= 1
    r -= 1
    print(bisect.bisect_left(ind_ls, r) - bisect.bisect_left(ind_ls, l))
Buggy python submission (verdict: Runtime Error):
A, B, C = [int(i) for i in input().split()]
print(min(B // A, C)

Fixed submission:
A, B, C = [int(i) for i in input().split()]
print(min(B // A, C))

Buggy python submission (verdict: Runtime Error):
A, B, C = [int(i) for i in input().split()]
print(max(B // A, C)

Fixed submission:
A, B, C = [int(i) for i in input().split()]
print(min(B // A, C))
Buggy python submission (verdict: Runtime Error):
A, B, K = [int(i) for i in input().split()]
cnt = 1
while True:
    if A % min(A,B) == B % min(A, B) == 0:
        break
    if A > B:
        A %= B
    else:
        B %= A

target = min(A,B)
print(target)
for i in range(2,target):
    if target % i == 0:
        cnt += 1
    if cnt == K:
        break
print(int(target / i))

Fixed submission:
A, B, K = [int(i) for i in input().split()]
cnt = 1
while True:
    if A % min(A,B) == B % min(A, B) == 0:
        break
    if A > B:
        A %= B
    else:
        B %= A

target = min(A,B)
if K == 1:
    print(target)
else:
    for i in range(2,target):
        if target % i == 0:
            cnt += 1
        if cnt == K:
            break
    print(int(target / i))

Buggy python submission (verdict: Runtime Error):
A, B, K = [int(i) for i in input().split()]
cnt = 1
while True:
    if A % min(A,B) == B % min(A, B) == 0:
        break
    if A > B:
        A %= B
    else:
        B %= A

target = min(A,B)
for i in range(target):
    if target % i == 0:
        cnt += 1
    if cnt == K:
        break
print(i)

Fixed submission:
A, B, K = [int(i) for i in input().split()]
cnt = 1
while True:
    if A % min(A,B) == B % min(A, B) == 0:
        break
    if A > B:
        A %= B
    else:
        B %= A

target = min(A,B)
if K == 1:
    print(target)
else:
    for i in range(2,target):
        if target % i == 0:
            cnt += 1
        if cnt == K:
            break
    print(int(target / i))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
S = sys.stdin.readline()
X = S
while True:
    new_S = S.replace("01","").replace("10","")
    if S == new_S:
        break
    S = new_S
print(len(X) - len(S))

Fixed submission:
import sys
from collections import Counter
S = input()
ct = Counter(list(S))
if len(ct.keys()) == 1:
    print(0)
else:
    print(min(ct.values()) * 2)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()
X = S
while True:
    flg = 0
    new_S = S.replace("01","").replace("10","")
    if S == new_S:
        break
    S = new_S
print(len(X) - len(S))

Fixed submission:
import sys
from collections import Counter
S = input()
ct = Counter(list(S))
if len(ct.keys()) == 1:
    print(0)
else:
    print(min(ct.values()) * 2)
Buggy python submission (verdict: Runtime Error):
N, M = [int(i) for i in input().split()]
data_ls = list()
for i in range(M):
    data_ls.append([int(i) -1 for i in input().split()])
A_ls, B_ls = zip(*data_ls)
conv_ls = list()

par = list(range(N))
rank = [1] * N

def find(x):
    if par[x] == x:
        return x
    else:
        return find(par[x])

def unite(x, y):
    x = find(x)
    y = find(y)
    if rank[x] < rank[y]:
        par[x] = y
        rank[y] += rank[x]
        rank[x] = rank[y]
    else:
        par[y] = x
        rank[x] += rank[y]
        rank[y] = rank[x]

def is_same(x, y):
    if find(x) == find(y):
        return True
    else:
        return False

def ranking(x):
    return rank[find(x)]

def main():
    conv_ls.append(0)
    for i, (x,y) in enumerate(data_ls[::-1]):
        N1 = ranking(x)
        N2 = ranking(y)
        if is_same(x, y):
            conv_ls.append(conv_ls[i])
        else:
            conv_ls.append(conv_ls[i] + N1 * N2)
        unite(x,y)
    for conv in conv_ls[::-1][1:]:
        print(int(N * (N - 1) / 2 - conv))

main()

Fixed submission:
N, M = [int(i) for i in input().split()]
data_ls = list()
for i in range(M):
    data_ls.append([int(i) -1 for i in input().split()])
A_ls, B_ls = zip(*data_ls)
conv_ls = list()

par = list(range(N))
rank = [1] * N

def find(x):
    if par[x] == x:
        return x
    else:
        return find(par[x])

def unite(x, y):
    x = find(x)
    y = find(y)
    if rank[x] < rank[y]:
        par[x] = y
        rank[y] += rank[x]
        rank[x] = rank[y]
    else:
        par[y] = x
        rank[x] += rank[y]
        rank[y] = rank[x]

def is_same(x, y):
    if find(x) == find(y):
        return True
    else:
        return False

def ranking(x):
    return rank[find(x)]

def main():
    conv_ls.append(0)
    for i, (x,y) in enumerate(data_ls[::-1]):
        N1 = ranking(x)
        N2 = ranking(y)
        if is_same(x, y):
            conv_ls.append(conv_ls[i])
        else:
            conv_ls.append(conv_ls[i] + N1 * N2)
            unite(x,y)
    for conv in conv_ls[::-1][1:]:
        print(int(N * (N - 1) / 2 - conv))

main()
Buggy python submission (verdict: Runtime Error):
from itertools import combinations
N, A, B, C = [int(i) for i in input().split()]
l_ls = list()
for i in range(N):
    l_ls.append(int(input()))
dis_ls = [(i,[i]) for i in l_ls]
for i in range(2,7):
    dis_ls += [(sum(i),i) for i in combinations(l_ls, i)]
best = 1e9
for hoge in [[A, B, C], [A, C, B],[B, A, C],[B, C, A], [C,B,A],[C,A,B]]:
    _sum = 0
    for target in hoge:
        min = 1e9
        for dis in dis_ls:
            c_sa = abs(dis[0] - target) + 10 * (len(dis[1]) - 1)
            if sa < min:
                min = sa
                min_combi = dis[1]
        _sum += min
        dis_ls = [i for i in dis_ls if len(set(min_combi).intersection(set(i[1]))) == 0]
    if _sum < best:
        best = _sum
print(best)

Fixed submission:
from itertools import product
N, A, B, C = [int(i) for i in input().split()]
l_ls = list()
for i in range(N):
    l_ls.append(int(input()))
best = 1e9
for combi in product(range(4),repeat=N):
    a = [l for l, label in zip(l_ls, combi) if label == 1]
    b = [l for l, label in zip(l_ls, combi) if label == 2]
    c = [l for l, label in zip(l_ls, combi) if label == 3]
    dis = abs(A - sum(a)) + abs(B - sum(b)) + abs(C - sum(c)) \
          + (len(a) + len(b) + len(c) - 3) * 10
    if len(a) * len(b) * len(c) == 0:
        continue
    if best > dis:
        best = dis
print(best)
Buggy python submission (verdict: Runtime Error):
def calc(X,ls):
    _sum = 0
    for i in ls:
        _sum +=  int(bin(X^i), 0)
    return _sum


N, K = map(int, input().split())
A_ls = [int(i) for i in input().split()]
if len(A_ls) == 1:
    print(A_ls[0])
else:
    _max = 0
    for i in range(K):
        result = calc(i, A_ls)
        if _max < result:
            _max = result
    print(_max)

Fixed submission:
T, X = map(int, input().split())
print(T / X)
Buggy python submission (verdict: Runtime Error):
N = int(input())
L_ls = map(int, input().split())
if sum(L_ls) - 2*max(L_ls) > 0:
  print("Yes")
else:
  print("No")

Fixed submission:
N = int(input())
L_ls = [int(i) for i in input().split()]
if sum(L_ls) - 2*max(L_ls) > 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
T = input()
memo_ls = [[] for i in range(len(S)+1)]
res = ""
for i in range(len(T) + 1):
    memo_ls[0].append(0)
path = dict()
for i in range(len(S)):
    memo_ls[i+1].append(0)
    for j in range(len(T)):
        if S[i] == T[j]:
            cost = max(memo_ls[i][j] + 1, memo_ls[i][j+1], memo_ls[i+1][j])
            memo_ls[i+1].append(cost)
        else:
            memo_ls[i+1].append(max(memo_ls[i][j+1], memo_ls[i+1][j]))

x_ind = len(T)
y_ind = len(S)
while x_ind * y_ind > 0:
    if memo_ls[y_ind][x_ind] == memo_ls[y_ind-1][x_ind]:
        y_ind -= 1
    elif memo_ls[y_ind][x_ind] == memo_ls[y_ind][x_ind-1]:
        x_ind -= 1
    else:
        res += T[x_ind-1]
        x_ind -= 1
        y_ind -= 1
print(res[::-1])

Fixed submission:
S = input()
T = input()
memo_ls = [[] for i in range(len(S)+1)]
res = ""
for i in range(len(T) + 1):
    memo_ls[0].append(0)
path = dict()
for i in range(len(S)):
    memo_ls[i+1].append(0)
    for j in range(len(T)):
        if S[i] == T[j]:
            cost = max(memo_ls[i][j] + 1, memo_ls[i][j+1], memo_ls[i+1][j])
            memo_ls[i+1].append(cost)
        else:
            memo_ls[i+1].append(max(memo_ls[i][j+1], memo_ls[i+1][j]))

x_ind = len(T)
y_ind = len(S)
while x_ind * y_ind > 0:
    if memo_ls[y_ind][x_ind] == memo_ls[y_ind-1][x_ind]:
        y_ind -= 1
    elif memo_ls[y_ind][x_ind] == memo_ls[y_ind][x_ind-1]:
        x_ind -= 1
    else:
        res += T[x_ind-1]
        x_ind -= 1
        y_ind -= 1
print(res[::-1])