Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
def main():
    #入力
    N, A, B, C, D = (int(_) for _ in input().split())
    S = input()

    sa, sb = S[A:C+1], S[B:D+1]
    can1 = can2 = True
    for i in range(len(sa)):
        if sa[i] == '#' and sa[i+1] == '#': can1 = False
    for i in range(len(sb)):
        if sb[i] == '#' and sb[i+1] == '#': can2 = False
    can = can1 and can2

    if can and D < C:
        sc = S[B-1:D]
        can3 = False
        for i in range(len(sc)-2):
            if S[i] == '.' and S[i+1] == '.' and S[i+2] == '.': can3 = True
        can = can and can3

    print('Yes' if can else 'No')
    return

if __name__ == '__main__':
    main()


Fixed submission:
def main():
    #入力
    N, A, B, C, D = (int(_) for _ in input().split())
    A, B, C, D = A-1, B-1, C-1, D-1
    S = input()

    sa, sb = S[A:C+1], S[B:D+1]
    can1 = can2 = True
    for i in range(len(sa)-1):
        if sa[i] == '#' and sa[i+1] == '#': can1 = False
    for i in range(len(sb)-1):
        if sb[i] == '#' and sb[i+1] == '#': can2 = False
    can = can1 and can2

    if can and D < C:
        sc = S[B-1:D+2]
        can3 = False
        for i in range(len(sc)-2):
            if sc[i] == '.' and sc[i+1] == '.' and sc[i+2] == '.': can3 = True
        can = can and can3

    print('Yes' if can else 'No')
    return

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n, k = [int(x) for x in input().split()]
s = input()
print(s[:k-1]+s[k].lower()+s[k+1:])

Fixed submission:
n, k = [int(x) for x in input().split()]
s = input()
print(s[:k-1]+s[k-1].lower()+s[k:])
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
class edge:
    def __init__(self, to, cost):
        self.to, self.cost = to, cost

def main():
    N = int(input())
    g = defaultdict(list)
    for _ in range(N-1):
        u, v, w = (int(_) for _ in input().split())
        g[u].append(edge(v, w))
        g[v].append(edge(u, w))

    color = [0] * (N+1)

    def dfs(ver):
        for e in g[ver]:
            if color[e.to] == 0 and e.cost%2 == 0:
                color[e.to] = color[ver]
                dfs(e.to)
            elif color[e.to] == 0 and e.cost%2 == 1:
                color[e.to] = (-1) * color[ver]
                dfs(e.to)
    color[1] = 1
    dfs(1)
    for i in range(1, N+1):
        if color[i] == -1: color[i] = 0
    print(*color[1:], sep='\n')
    return

if __name__ == '__main__':
    main()


Fixed submission:
from collections import defaultdict
import sys
sys.setrecursionlimit(1000000)

class edge:
    def __init__(self, to, cost):
        self.to, self.cost = to, cost

def main():
    N = int(input())
    g = defaultdict(list)
    for i in range(N-1):
        u, v, w = (int(_) for _ in input().split())
        g[u].append(edge(v, w))
        g[v].append(edge(u, w))

    color = [0] * (N+1)

    def dfs(ver):
        for e in g[ver]:
            if color[e.to] == 0 and e.cost%2 == 0:
                color[e.to] = color[ver]
                dfs(e.to)
            elif color[e.to] == 0 and e.cost%2 == 1:
                color[e.to] = (-1) * color[ver]
                dfs(e.to)
    color[1] = 1
    dfs(1)
    for i in range(1, N+1):
        if color[i] == -1: color[i] = 0
    print(*color[1:], sep='\n')
    return

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
H, W = [int(x) for x in input().split()]
masu = [input() for i in range(H)]
move = [[0, 1], [0, -1], [1, 0], [-1, 0]]
d = [[-1] * W for i in range(H)]

def bfs():
    q = deque()
    for x in range(H):
        for y in range(W):
            if masu[x][y] == '#':
                q.append([x, y])
                d[x][y] = 0
    while q:
        x, y = q.popleft()
        for v in move:
            nx = x + v[0]
            ny = y + v[1]
            if 0 <= nx < H and 0 <= ny < W and d[nx][ny] == -1:
                q.append([nx, ny])
                d[nx][ny] = d[x][y] + 1
    ans = -1
    for x in range(H):
        for y in range(W):
            ans = max(ans, d[x][y])
    return ans

print(bfs())


Fixed submission:
from collections import deque
H, W = [int(x) for x in input().split()]
masu = [input() for i in range(H)]
move = [[0, 1], [0, -1], [1, 0], [-1, 0]]
d = [[-1] * W for i in range(H)]

def bfs():
    q = deque()
    for x in range(H):
        for y in range(W):
            if masu[x][y] == '#':
                q.append([x, y])
                d[x][y] = 0
    while q:
        x, y = q.popleft()
        for v in move:
            nx = x + v[0]
            ny = y + v[1]
            if 0 <= nx < H and 0 <= ny < W and d[nx][ny] == -1:
                q.append([nx, ny])
                d[nx][ny] = d[x][y] + 1
    ans = -1
    for x in range(H):
        for y in range(W):
            ans = max(ans, d[x][y])
    return ans

print(bfs())

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
H, W = [int(x) for x in input().split()]
masu = [input() for i in range(H)]
move = [[0, 1], [0, -1], [1, 0], [-1, 0]]
d = [[-1] * W for i in range(H)]

def bfs():
    q = deque()
    for x in range(H):
        for y in range(W):
            if masu[x][y] == '#':
                q.append([x, y])
                d[x][y] = 0
    while q:
        x, y = q.popleft()
        for v in move:
            nx = x + v[0]
            ny = y + v[1]
            if 0 <= nx < H and 0 <= ny < W and masu[nx][ny] == '.' and d[nx][ny] == -1:
                q.append([nx, ny])
                d[nx][ny] = d[x][y] + 1
    max = -1
    for x in range(H):
        for y in range(W):
            if d[x][y] > max:
                max = d[x][y]
    return max

print(bfs())


Fixed submission:
from collections import deque
H, W = [int(x) for x in input().split()]
masu = [input() for i in range(H)]
move = [[0, 1], [0, -1], [1, 0], [-1, 0]]
d = [[-1] * W for i in range(H)]

def bfs():
    q = deque()
    for x in range(H):
        for y in range(W):
            if masu[x][y] == '#':
                q.append([x, y])
                d[x][y] = 0
    while q:
        x, y = q.popleft()
        for v in move:
            nx = x + v[0]
            ny = y + v[1]
            if 0 <= nx < H and 0 <= ny < W and d[nx][ny] == -1:
                q.append([nx, ny])
                d[nx][ny] = d[x][y] + 1
    ans = -1
    for x in range(H):
        for y in range(W):
            ans = max(ans, d[x][y])
    return ans

print(bfs())
Buggy python submission (verdict: Runtime Error):
l = [int(input()) for _ in range(5)]
m = 100
ind = 100
res = 0
for i in range(5):
    if l[i]%10 == 0:
        continue
    if l[i]%10 < m:
        m = l[i]%10
        ind = i
for i in range(5):
    if i == ind:
        continue
    else:
        res += -(-l[i]//10)*10
res += l[ind]
print(res)


Fixed submission:
l = [int(input()) for _ in range(5)]
m = 100
ind = 100
res = 0
for i in range(5):
    if l[i]%10 == 0:
        continue
    if l[i]%10 < m:
        m = l[i]%10
        ind = i
for i in range(5):
    if i == ind:
        continue
    else:
        res += -(-l[i]//10)*10
if ind < 5:
    res += l[ind]
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
N, Q = [int(x) for x in input().split()]
S = input()
res = []
for i in range(Q):
    l, r = [int(x) for x in input().split()]
    res.append(S[l-1:r].count('AC'))
for r in res:
    print(r)


Fixed submission:
N, Q = [int(x) for x in input().split()]
S = input()
R = [0]
res = 0
ans = []
for i in range(N - 1):
    if S[i:i+2] == 'AC':
        res += 1
    R.append(res)
for i in range(Q):
    l, r = [int(x) for x in input().split()]
    ans.append(R[r-1] - R[l-1])
for r in ans:
    print(r)
Buggy python submission (verdict: Time Limit Exceeded):
N, W = (int(x) for x in input().split())
A = [[int(x) for x in input().split()] for i in range(N)]
dp = [[0] * (W + 1) for i in range(N + 1)]
for i in range(N):
  w, v = A[i]
  for j in range(W+1):
    dp[i+1][j] = max(dp[i+1][j], dp[i][j])
    if j >= w:
      dp[i+1][j] = max(dp[i+1][j], dp[i][j - w] + v) 
print(dp[N][W])

Fixed submission:
N, W = (int(x) for x in input().split())
A = [[int(x) for x in input().split()] for i in range(N)]
dp = [[0] * (W + 1) for i in range(N + 1)]
for i in range(N):
  w, v = A[i]
  for j in range(W+1):
    dp[i+1][j] = max(dp[i+1][j], dp[i][j])
    if j >= w:
      dp[i+1][j] = max(dp[i+1][j], dp[i][j - w] + v) 
print(dp[N][W])
Buggy python submission (verdict: Runtime Error):
N, x = [int(z) for z in input().split()]
children = [int(z) for z in input().split()]

children.sort()
sum = 0

for i in children:
    sum += i

if sum < x:
    print(N - 1)
elif sum == x:
    print(N)
else:
    for i in children:
        if x - i < 0:
            break
        else:
            x -= i
            cnt += 1
    print(cnt)


Fixed submission:
N, x = [int(z) for z in input().split()]
children = [int(z) for z in input().split()]

children.sort()
sum = 0

for i in children:
    sum += i

if sum < x:
    print(N - 1)
elif sum == x:
    print(N)
else:
    cnt = 0
    for i in children:
        if x - i < 0:
            break
        else:
            x -= i
            cnt += 1
    print(cnt)

Buggy python submission (verdict: Runtime Error):
N, x = [int(z) for z in input().split()]
children = [int(z) for z in input().split()]

children.sort()
sum = 0

for i in children:
    sum += i

if sum < x:
    print(N - 1)
elif sum == x:
    print(N)
else:
    for i in children:
        if x - i < 0:
            break
        else:
            x -= i
            cnt += 1
print(cnt)


Fixed submission:
N, x = [int(z) for z in input().split()]
children = [int(z) for z in input().split()]

children.sort()
sum = 0

for i in children:
    sum += i

if sum < x:
    print(N - 1)
elif sum == x:
    print(N)
else:
    cnt = 0
    for i in children:
        if x - i < 0:
            break
        else:
            x -= i
            cnt += 1
    print(cnt)
Buggy python submission (verdict: Runtime Error):
K = int(input())
print( K//2 * (N - K//2))

Fixed submission:
K = int(input())
print( K//2 * (K - K//2))
Buggy python submission (verdict: Time Limit Exceeded):
N, M = [int(x) for x in input().split()]
lst = [[int(x) for x in reversed(input().split())] for i in range(M)]
lst.sort()
bridge = [True] * N

def connected(a, b):
    for i in range(a, b):
        if bridge[i] == False:
            return False
    return True

def solve():
    res = 0
    for l in lst:
        a, b = l
        if connected(b, a):
            bridge[a - 1] = False
            res += 1
    return res

if __name__ == '__main__':
    print(solve())


Fixed submission:
bridge = set()
def connected(a, b):
    for i in bridge:
        if a <= i and i < b:
            return False
    return True
def solve():
    N, M = [int(x) for x in input().split()]
    lst = [[int(x) for x in reversed(input().split())] for i in range(M)]
    lst.sort()
    res = 0
    for l in lst:
        a, b = l
        if connected(b, a):
            bridge.add(a - 1)
    return len(bridge)

if __name__ == '__main__':
    print(solve())

Buggy python submission (verdict: Time Limit Exceeded):
N, M = [int(x) for x in input().split()]
lst = [[int(x) for x in reversed(input().split())] for i in range(M)]
lst.sort()
bridge = [True] * N

def connected(a, b):
    for i in range(a, b):
        if bridge[i] == False:
            return False
    return True

def solve():
    res = 0
    for l in lst:
        a, b = reversed(l)
        if connected(a, b):
            bridge[b - 1] = False
            res += 1
    return res

if __name__ == '__main__':
    print(solve())


Fixed submission:
bridge = set()
def connected(a, b):
    for i in bridge:
        if a <= i and i < b:
            return False
    return True
def solve():
    N, M = [int(x) for x in input().split()]
    lst = [[int(x) for x in reversed(input().split())] for i in range(M)]
    lst.sort()
    res = 0
    for l in lst:
        a, b = l
        if connected(b, a):
            bridge.add(a - 1)
    return len(bridge)

if __name__ == '__main__':
    print(solve())
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input
res = -1
for i in range(N):
  res = max(len(set(S[:i]) & set(S[i:])), res)
print(res)
  

Fixed submission:
N = int(input())
S = input()
res = -1
for i in range(N):
  res = max(len(set(S[:i]) & set(S[i:])), res)
print(res)
Buggy python submission (verdict: Runtime Error):
a, b, k = [int(x) for x in input().split()]
lst = list(range(a, b + 1))
res = []
res.extend(lst[:k])
res.extend(lst[-k:])
res = sorted(set(res))
for i in res:
    print(i)


Fixed submission:
a, b, k = [int(x) for x in input().split()]
r = range(a, b + 1)
for i in sorted(set(r[:k]) | set(r[-k:])):
    print(i)

Buggy python submission (verdict: Runtime Error):
a, b, k = [int(x) for x in input().split()]
lst = list(range(a, b + 1))
res = []
res.extend(lst[:k])
res.extend(lst[-k:])
res = sorted(set(res))
print(*res, sep='\n')


Fixed submission:
a, b, k = [int(x) for x in input().split()]
r = range(a, b + 1)
for i in sorted(set(r[:k]) | set(r[-k:])):
    print(i)

Buggy python submission (verdict: Runtime Error):
a, b, k = [int(x) for x in input().split()]
lst = list(range(a, b + 1))
res = []
res.extend(lst[:k])
res.extend(lst[-k:])
res = sorted(list(set(res)))
print(*res, sep='\n')


Fixed submission:
a, b, k = [int(x) for x in input().split()]
r = range(a, b + 1)
for i in sorted(set(r[:k]) | set(r[-k:])):
    print(i)
Buggy python submission (verdict: Runtime Error):
def solve():
    N = int(input())
    R = [[int(x) for x in input().split()] for i in range(N)]
    B = [[int(x) for x in input().split()] for i in range(N)]
    B.sort()
    selected = set()
    for b in B:
        r_lst = []
        for i in range(len(R)):
            r = R[i]
            if r[0] < b[0] and r[1] < b[1]:
                r_lst.append(i)
        if len(r_lst) == 0:
            continue
        rym = -1
        rym_i = -1
        for i in len(r_lst):
            if rym < r_lst[i][1]:
                rym = r_lst[i][1]
                rym_i = i
        selected.add(i)
    return len(selected)
if __name__ == '__main__':
    print(solve())


Fixed submission:
def solve():
    N = int(input())
    R = [[int(x) for x in input().split()] for i in range(N)]
    B = [[int(x) for x in input().split()] for i in range(N)]
    B.sort()
    selected = set()
    for b in B:
        r_lst = []
        for i in range(len(R)):
            if i in selected: continue
            r = R[i]
            if r[0] < b[0] and r[1] < b[1]:
                r_lst.append(i)
        if len(r_lst) == 0:
            continue
        rym = -1
        rym_i = -1
        for i in r_lst:
            if rym < R[i][1]:
                rym = R[i][1]
                rym_i = i
        selected.add(rym_i)
    return len(selected)
if __name__ == '__main__':
    print(solve())
Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
if (a[0]*a[1])%2 == 0:
	print('Even')
else
	print('Odd')

Fixed submission:
a = list(map(int, input().split()))
b = a[0]*a[1]
if b%2 == 0:
    print('Even')
else:
    print('Odd')
Buggy python submission (verdict: Runtime Error):
str = input()
str[3] = '8'
print(str)

Fixed submission:
str = input()
print(str.replace('7', '8', 1))
Buggy python submission (verdict: Runtime Error):
a, b = [int(x) for x in input().split()]
num = '0123456789'
S = input()
flg = True
for i in len(S):
  if i == a:
    if not S[i] == '-':
      flg = False
  else:
    if not S[i] in num:
      flg = False
print('Yes' if flg else 'No')


Fixed submission:
a, b = [int(x) for x in input().split()]
num = '0123456789'
S = input()
flg = True
for i in range(len(S)):
  if i == a:
    if not S[i] == '-':
      flg = False
  else:
    if not S[i] in num:
      flg = False
print('Yes' if flg else 'No')

Buggy python submission (verdict: Runtime Error):
a, b = [int(x) for x in input().split()]
num = '0123456789'
S = input()
flg = True
for i in len(S):
  if i == A:
    if not S[i] == '-':
      flg = False
  else:
    if not S[i] in num:
      flg = False
print('Yes' if flg else 'No')

Fixed submission:
a, b = [int(x) for x in input().split()]
num = '0123456789'
S = input()
flg = True
for i in range(len(S)):
  if i == a:
    if not S[i] == '-':
      flg = False
  else:
    if not S[i] in num:
      flg = False
print('Yes' if flg else 'No')
Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
sum = a[0] + a[1]
if sum%2 == 0:
  return sum/2
else:
  return (sum + 1)/2

Fixed submission:
a = list(map(int, input().split()))
sum = a[0] + a[1]
if sum%2 == 0:
  print(int(sum/2))
else:
  print(int((sum + 1)/2))
Buggy python submission (verdict: Runtime Error):
def qsort(array):
	if len(array) < 2:
        return array
    else:
        pivot = array[0]
        less = [i for i in array[1:] if i <= pivot]
        greater = [i for i in array[1:] if i > pivot]
        return qsort(less) + [pivot] + qsort(greater)
      
si = input()
ti = input()

s_sort = qsort(si)
t_sort = qsort(ti)

s = ''
t = ''

for i in s_sort:
    s += i
for i in t_sort[::-1]:
	t += i
if s < t:
	print('Yes')
else:
  	print('No')


Fixed submission:
def qsort(array):
    if len(array) < 2:
        return array
    else:
        pivot = array[0]
        less = [i for i in array[1:] if i <= pivot]
        greater = [i for i in array[1:] if i > pivot]
        return qsort(less) + [pivot] + qsort(greater)

si = input()
ti = input()

s_sort = qsort(si)
t_sort = qsort(ti)

s = ''
t = ''

for i in s_sort:
    s += i
for i in t_sort[::-1]:
    t += i
if s < t:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict

def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N, M = ZZ()
    edge = [ZZ() for _ in range(M)]
    E = defaultdict(list)
    for a, b in edge:
        E[a].append(b)
        E[b].append(a)

    color = [0] * (N+1)

    def is_bi(v, c):
        color[v] = c
        for to in E[v]:
            if color[to] == c: return False
            if color[to] == 0 and not is_bi(to, -c): return False
        return True

    if is_bi(1, 1):
        x = color.count(1)
        output = x * (N - x) - M
    else: output = N * (N - 1) // 2 - M
    print(output)

    return

if __name__ == '__main__':
    main()


Fixed submission:
from collections import defaultdict
import sys
sys.setrecursionlimit(1000000)

def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N, M = ZZ()
    edge = [ZZ() for _ in range(M)]
    E = defaultdict(list)
    for a, b in edge:
        E[a].append(b)
        E[b].append(a)

    color = [0] * (N+1)

    def is_bi(v, c):
        color[v] = c
        for to in E[v]:
            if color[to] == c: return False
            if color[to] == 0 and not is_bi(to, -c): return False
        return True

    if is_bi(1, 1):
        x = color.count(1)
        output = x * (N - x) - M
    else: output = N * (N - 1) // 2 - M
    print(output)

    return

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
A, B, C, D, E, F = [int(x) for x in input().split()]
a_water = 0
a_sugar = 0
a_conc = 0
max_conc = 100 * E / (100 + E)
for i in range(F//(100*A) + 1):
    for j in range(F//(100*B) + 1):
        water = i * 100 * A + j * 100 * B
        ms = E * water
        for k in range(ms//C + 1):
            for l in range(ms//D + 1):
                sugar = k * C + l * D
                conc = 100 * sugar / (water + sugar) if water + sugar > 0 else 0
                if water + sugar <= F and conc <= max_conc and a_conc < conc:
                    a_water = water
                    a_sugar = sugar
                    a_conc = conc
                else:
                    pass
print(a_water + a_sugar, a_sugar)


Fixed submission:
N = int(input())
A = int(input())
print(N*N - A)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
a_lst = [int(x) for x in input().split()]

max_a = -1
max_cnt = -1

for a in a_lst:
    if max_a < a:
        max_a = a
for x in range(max_a + 1):
    cnt = 0
    for a in a_lst:
        if x - 1 <= a and a <= x + 1:
            cnt += 1
    if max_cnt < cnt:
        max_cnt = cnt
print(max_cnt)


Fixed submission:
N = int(input())
a_lst = [int(x) for x in input().split()]

dict = {}

for a in a_lst:
    if not a - 1 in dict.keys():
        dict[a - 1] = 1
    else:
        dict[a - 1] += 1
    if not a in dict.keys():
        dict[a] = 1
    else:
        dict[a] += 1
    if not a + 1 in dict.keys():
        dict[a + 1] = 1
    else:
        dict[a + 1] += 1
val_lst = list(dict.values())
val_lst.sort(reverse=True)
print(val_lst[0])
Buggy python submission (verdict: Runtime Error):
a = sorted([int(x) for x in input().split()])
print(sum[:2])

Fixed submission:
a = sorted([int(x) for x in input().split()])
print(sum(a[:2]))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
sys.setrecursionlimit(10 ** 8)
INF = 10 ** 15

class edge:
    def __init__(self, fr, to, cost):
        self.fr, self.to, self.cost = fr, to, cost

def input(): return sys.stdin.readline().strip()
def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N, M = ZZ()
    es = []
    for _ in range(M):
        a, b, c = ZZ()
        a -= 1
        b -= 1
        es.append(edge(a, b, -c))

    #負の閉路検出
    d = [0] * N
    for i in range(N):
        for e in es:
            if d[e.to] > d[e.fr] + e.cost:
                d[e.to] = d[e.fr] + e.cost
                if e.to == N-1 and i == N-1:
                    print('inf')
                    return
    #ベルマンフォードする
    d = [INF] * N
    d[0] = 0
    while True:
        update = False
        for e in es:
            if d[e.fr] != INF and d[e.to] > d[e.fr] + e.cost:
                d[e.to] = d[e.fr] + e.cost
                update = True
        if not update: break
    print(-d[N-1])

    return

if __name__ == '__main__':
    main()


Fixed submission:
import sys
sys.setrecursionlimit(10 ** 8)
INF = 10 ** 15

class edge:
    def __init__(self, fr, to, cost):
        self.fr, self.to, self.cost = fr, to, cost

def input(): return sys.stdin.readline().strip()
def Z(): return int(input())
def ZZ(): return [int(_) for _ in input().split()]

def main():
    N, M = ZZ()
    es = []
    for _ in range(M):
        a, b, c = ZZ()
        a -= 1
        b -= 1
        es.append(edge(a, b, -c))

    #負の閉路検出
    d = [0] * N
    for i in range(N):
        for e in es:
            if d[e.to] > d[e.fr] + e.cost:
                d[e.to] = d[e.fr] + e.cost
                if e.to == N-1 and i == N-1:
                    print('inf')
                    return
    #ベルマンフォードする
    d = [INF] * N
    d[0] = 0
    for _ in range(N-1):
        update = False
        for e in es:
            if d[e.fr] != INF and d[e.to] > d[e.fr] + e.cost:
                d[e.to] = d[e.fr] + e.cost
                update = True
        if not update: break
    print(-d[N-1])

    return

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
a, b, c = [int(_) for _ in input().split()]
if a + c = 2 * b:
  print('YES')
else:
  print('NO')

Fixed submission:
a, b, c = [int(_) for _ in input().split()]
if a + c == 2 * b:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
a, b = [for x in input().split()]
print('H' if a == b else 'D')


Fixed submission:
a, b = input().split()
print('H' if a == b else 'D')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
res = 0
x = 0
for i in range(N):
  if S[i] == 'I':
    x += 1
  else:
    x -= 1
  res = max(res, x)
return res

Fixed submission:
N = int(input())
S = input()
res = 0
x = 0
for i in range(N):
  if S[i] == 'I':
    x += 1
  else:
    x -= 1
  res = max(res, x)
print(res)