Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import collections
from functools import reduce

def main():
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10

    # 1文字のみを読み込み
    # s = input().rstrip()
    
    # スペース区切りで標準入力を配列として読み込み
    # s = input().rstrip().split(' ')

    # 1文字ずつ標準入力を文字列として読み込み
    # s = list(input().rstrip())
    
    # 位置文字ずつ標準入力を数値配列として読み込み
    # X = [int(_) for _ in input().split()]
    X = [int(_) for _ in input().split()]
    ans = [0 for _ in range(100)]
    for x in X:
        ans[x] = ans[x] + 1
    print(max(ans))
    # c = collections.Counter(X)
    # print(c.most_common()[0][1])
        
   
if __name__ == '__main__':
    main()


Fixed submission:
import collections
from functools import reduce

def main():
    # 初期値用:十分大きい数(100億)
    # 1e10

    # 初期値用:十分小さい数(-100億)
    # -1e10

    # 1文字のみを読み込み
    # s = input().rstrip()
    
    # スペース区切りで標準入力を配列として読み込み
    # s = input().rstrip().split(' ')

    # 1文字ずつ標準入力を文字列として読み込み
    # s = list(input().rstrip())
    
    # 位置文字ずつ標準入力を数値配列として読み込み
    # X = [int(_) for _ in input().split()]
    X = [int(_) for _ in input().split()]
    if X[0] == X[1] and X[0] == X[2] and X[1] == X[2]:
        ans = 1
    elif X[0] == X[1] or X[0] == X[2] or X[1] == X[2]:
        ans = 2
    else:
        ans = 3
    print(ans)


    # c = collections.Counter(X)
    # print(c.most_common()[0][1])
        
   
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
st, sx, sy = list(map(int, input().split()))

is_reach = True

for i in range(0, n):
    gt, gx, gy = list(map(int, input().split()))
    t = gt - sy
    dist = abs(gx - sx) + abs(gy - sy)

    if not(t >= dist and (t - dist) % 2 == 0):
        is_reach = False
        break


if is_reach:
    print("Yes")
else:
    print("No")


Fixed submission:
n = int(input())
st, sx, sy = 0, 0, 0

is_reach = True

for i in range(0, n):
    gt, gx, gy = list(map(int, input().split()))
    t = gt - sy
    dist = abs(gx - sx) + abs(gy - sy)

    if not(t >= dist and (t - dist) % 2 == 0):
        is_reach = False
        break


if is_reach:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))
print(((H-h) * (W-w))

Fixed submission:
H, W = list(map(int, input().split()))
h, w = list(map(int, input().split()))
print((H-h) * (W-w))
Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))
cons = (10**9+7)
if N == M:
    s = 1
    for i in range(2, N+1):
        s *= i
    print((s**2*2)%cons)

elif abs(N-M) == 1:
    N = min(N, M)
    s = 1
    for i in range(2, N+1):
        s *= i
    print((s*(s*(N+1))%cons))
else:
    print(0)


Fixed submission:
import math

N, M = list(map(int, input().split()))
cons = (10**9+7)
if N == M:
    s = math.factorial(N)
    print((s**2*2)%cons)

elif abs(N-M) == 1:
    N = min(N, M)
    s = math.factorial(N)
    print((s*(s*(N+1))%cons))
else:
    print(0)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))
cons = (10**9+7)
if N == M:
    s = 1
    for i in range(2, N+1):
        s *= i%cons
    print((s**2*2)%cons)

elif abs(N-M) == 1:
    N = max(N, M)
    s = 1
    for i in range(2, N+1):
        s *= i%cons
    print((s*(s//N)%cons))
else:
    print(0)


Fixed submission:
import math

N, M = list(map(int, input().split()))
cons = (10**9+7)
if N == M:
    s = math.factorial(N)
    print((s**2*2)%cons)

elif abs(N-M) == 1:
    N = min(N, M)
    s = math.factorial(N)
    print((s*(s*(N+1))%cons))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import numpy as np

S = np.array(list(map(int, list(input()))))
q, r = len(S) // 2, len(S) % 2
a1 = np.array([1, 0] * q + [1] * r)  # 1010...01 (偶数長なら 1010...10)
a2 = np.array([0, 1] * q + [0] * r)  # 1010...01 (偶数長なら 1010...10)

print(min(sum(abs(a1 - S)), sum(abs(a2 - S))))

Fixed submission:
S = list(input())

dist1 = 0  # 1010...01 との編集距離
dist2 = 0  # 0101...10 との編集距離
for i, s in enumerate(S):
    if i % 2 == 1:
        if s == '1':
            dist2 += 1
        else:
            dist1 += 1
    if i % 2 == 0:
        if s == '1':
            dist1 += 1
        else:
            dist2 += 1

print(min(dist1, dist2))
Buggy python submission (verdict: Runtime Error):
from itertools import product

X, Y, Z, K = list(map(int, input().split()))
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

AB = [a + b for a, b in product(A, B)]
AB.sort(reverse=True)

ABC = [ab + c for ab, c in product(AB[:K], C)]
ABC.sort(reverse=True)

for abc in ABC[:K]:
    print(abc)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

antenna = [a, b, c, d, e]
is_ok = True
for i in range(len(antenna)):
    for j in range(i+1, len(antenna)):
        if antenna[j] - antenna[i] > k:
            is_ok = False

if is_ok:
    print('Yay!')
else:
    print(':(')
Buggy python submission (verdict: Runtime Error):
N = int(input())
nums = [int(input()) for i in range(N)]

print(max(nums) - min(nums))

Fixed submission:
N = int(input())
nums = list(map(int, input().split()))

print(max(nums)-min(nums))
Buggy python submission (verdict: Runtime Error):
S = input()

S[3] = 8
print(S)

Fixed submission:
S = input()

print(S.replace('2017', '2018'))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = []
for _ in [0]*N:
    a.append(int(input()))

def solve(i, n):
    if n == 2:
        print(i)
    elif i == N:
        print(-1)
    else:
        return solve(i+1, a[n-1])

solve(0, 1)

Fixed submission:
import sys
sys.setrecursionlimit(1000000)
N = int(input())
a = [0]*(N+1)
for i in range(1, N+1):
    a[i] = int(input())

def solve(i, n):
    if n == 2:
        print(i)
    elif i == N:
        print(-1)
    else:
        return solve(i+1, a[n])

solve(0, 1)
Buggy python submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
D = int(input())

train = min(A, B)
bus = min(C, D)
print(train + bus)

Fixed submission:
S = input()
print(700 + S.count('o') * 100)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
for i in range(N):
    cost = 0
    pos = 0
    for j in range(N):
        if(i == j):
            continue
        cost += abs(A[j] - pos)
        pos = A[j]
    cost += abs(pos)
    print(cost)

Fixed submission:
N = int(input())
A = [0]
B = list(map(int, input().split()))
for i in range(len(B)):
    A.append(B[i])
A.append(0)
S = []
cost = 0
pos = 0
for i in range(1, N + 1):
    cost += abs(A[i] - pos)
    pos = A[i]
    S.append(cost)
S.append(cost + abs(pos))

for i in range(N):
    print(S[-1] + abs(A[i] - A[i + 2]) - (abs(A[i] - A[i + 1]) + abs(A[i + 1] - A[i + 2])))
Buggy python submission (verdict: Runtime Error):
N = input()
ans = "No"
for i in range(15):
    N = N-7
    print(N)
    if N <= 0:
        if N%3 == 0:
            ans="Yes"
        break
print(ans)

Fixed submission:
N = int(input())
ans = "No"
if N%4==0:
    ans = "Yes"
for i in range(15) :
    N = N - 7
    if N < 0:
        break
    if N%4==0:
        ans = "Yes"
print(ans)
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split())
s = X + Y/2
print(s)



Fixed submission:
x,y = map(int,input().split())

s = x + y//2

print(s)
Buggy python submission (verdict: Runtime Error):
n = int(input())
values = [ int(x) for x in range(n) ]
cost = [ int(x) for x in range(n) ]
profit_list = [ value[i] - cost[i] for i in range(n) if value[i] > cost[i] ]
print(sum(profit_list))


Fixed submission:
n = int(input())
values = [ int(x) for x in input().split() ]
cost = [ int(x) for x in input().split() ]
profit_list = [ values[i] - cost[i] for i in range(n) if values[i] > cost[i] ]
print(sum(profit_list))
Buggy python submission (verdict: Time Limit Exceeded):
n, nQueries = map(int,input().split())
inString = input()
queries = [ [int(x)-1 for x in input().split()] for i in range(nQueries)]

for (i,j) in queries:
    count = 0
    while(i < j):
        if(inString[i] == "A" and inString[i+1] == "C"):
            i+=2
            count+=1
        else:
            i+=1
        
    print(count)
            


Fixed submission:
n, nQueries = map(int,input().split())
inString = input()
queries = [ [int(x)-1 for x in input().split()] for i in range(nQueries)]
occurance_list = [0]*n
idx = 0
while(idx < n):
    if(idx<n-1 and inString[idx] == "A" and inString[idx+1] == "C"):
        occurance_list[idx] = occurance_list[idx-1]
        occurance_list[idx+1] += occurance_list[idx-1] + 1
        idx += 2
    else:
        occurance_list[idx] = occurance_list[idx-1]
        idx+=1



for (i,j) in queries:
    print(occurance_list[j] - occurance_list[i])
Buggy python submission (verdict: Runtime Error):
N,M,C = map(int,input().split())
B = [int(x) for x in input().split()]

count = 0
for i in range(N):
  temp = [int(x) for x in input().split()]
  total = [B[i]*temp[i] for i in range(M)]
  if(total > 0 ):
    count+=1
  
  


Fixed submission:
N,M,C = map(int,input().split())
B = [int(x) for x in input().split()]
 
count = 0
for i in range(N):
  temp = [int(x) for x in input().split()]
  total = [B[i]*temp[i] for i in range(M)]
  if((sum(total) + C) > 0 ):
    count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0

for i in range(1, N + 1):
    if i % 2 == 1:
        count = 0
        for j in range(1, i + 1, 2):
            if i % j == 0:
                count += 1
        if count == 8:
            ans += 1

print(ans)

Fixed submission:
a, b = map(int, input().split())

print((a-1)*(b-1))
Buggy python submission (verdict: Runtime Error):
R = int(input())

if R<1200:
    print("ABC")
if R<2800 and R>1200:
    print("ARC")
if R>2800:
    print("AGC"

Fixed submission:
R = int(input())

if R<1200:
    print("ABC")
elif R<2800:
    print("ARC")
else :
    print("AGC")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = map(int,input().split(" "))
m = int('-inf')
count = 0
for i in range(N-2,-1,-1):
  m = max(m,A[i+1])
  if A[i]>=m: count += 1
print(count)

Fixed submission:
N = int(input())
A = list(map(int,input().split(" ")))
m = float('-inf')
count = 1
for i in range(1,N):
    m = max(m,A[i-1])
    if A[i]>=m: count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
V_array = [int(input()) for _ in range(N)]
ans = [max(0, V_i - int(input())) for V_i in V_array]

Fixed submission:
N = int(input())
V_array = [int(V_i_str) for V_i_str in input().split()]
C_array = [int(C_i_str) for C_i_str in input().split()]
ans = sum([max(0, V_array[i] - C_array[i]) for i in range(N)])
print(ans)
Buggy python submission (verdict: Runtime Error):
T, X = list(map(int, input().split())
print(T / X)

Fixed submission:
T, X = list(map(int, input().split()))
print(T / X)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, C = [int(s) for s in input().split()]

poisonous = False
eaten_cookies = 0

while True:
  if not poisonous and C > 0:
    eaten_cookies += 1
    C -= 1
    poisonous = True
  elif poisonous and A > 0:
    A -= 1
    poisonous = False
  elif B > 0:
    eaten_cookies += 1
    B -= 1
    poisonous = False
  else:
    break

print(eaten_cookies)

Fixed submission:
A, B, C = [int(s) for s in input().split()]
print(min([C, A + B + 1]) + B)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))

cities = {}
prefs = []

for i in range(1, M + 1):
  p, y = list(map(int, input().split()))
  
  pref = {"city": p, "year": y}
  prefs.append(pref)

  if p not in cities:
    cities[p] = [pref]
  else:
    city = cities[p]
    for idx_city, pref_in_city in enumerate(city):
      if y < pref_in_city['year']:
        city.insert(idx_city, pref)
        break
      elif idx_city == len(city) - 1:
        city.append(pref)
        break

[print("%s%s" % (
  str(int(pref['city'])).zfill(6), 
  str(cities[pref['city']].index(pref) + 1).zfill(6))) for pref in prefs]


Fixed submission:
N, M = list(map(int, input().split()))

cities = {}
prefs = []

for i in range(1, M + 1):
  p, y = list(map(int, input().split()))
  
  pref = {"city": p, "year": y}
  prefs.append(pref)

  if p not in cities:
    cities[p] = [pref]
  else:
    cities[p].append(pref)

for city in cities.values():
  city.sort(key=lambda p: p['year'])
  for idx, pref in enumerate(city):
    pref['pref_id'] = str(idx + 1).zfill(6)

[print("%s%s" % (
  str(int(pref['city'])).zfill(6), 
  pref['pref_id'])) for pref in prefs]
Buggy python submission (verdict: Time Limit Exceeded):
wb = input()
li = [i for i in wb]
j = [i for i in range(len(li))]
count = 0
while 'BW' in wb:
    for i in j:
        #print('i:',i)
        if i != j[-1]:
            if li[i] == 'B' and li[i+1] == 'W':
                #print('i:',li[i],'i+1:',li[i+1])
                li[i] = 'W'
                li[i+1] = 'B'
                count +=1
                wb = ''.join(li)
                #print('wb:',wb)
#print('li:',li)
print(count)

Fixed submission:
wb = input()
li = [i for i in wb]
b = 0
count = 0
for i in li:
    if i =='B':
        b+=1
    else:
        count += b
print(count)
Buggy python submission (verdict: Runtime Error):
import sys
def solve(a,b,lst_ab):
    li = [abs(b-(a-(i*0.006))) for i in lst_ab]
    n = li[0]
    for s in li:
        if n > s:
            n = s
    answer = li.index(n)+1 
    return print(answer)

def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    line2 = sys.stdin.readline().rstrip()
    list1 = line2.split(" ")
    line3 = sys.stdin.readline().rstrip()
    list2 = line3.split(" ")
    return int(list1[0]),int(list1[1]),list2
 
def main():
    t,a,h = readQuestion()
    answer = solve(t,a,h)
    print(answer)
    
if __name__ == '__main__':
    main()

Fixed submission:
import sys

def solve(N, T, A, ls_H):
    li = [abs(A-(T-(i*0.006))) for i in ls_H]
    n = li[0]
    for s in li:
        if n > s:
            n = s
    answer = li.index(n)+1 
    return answer

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    N = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    T = int(ws[0])
    A = int(ws[1])
    ws = sys.stdin.readline().strip().split()
    ls_H = list(map(int, ws))
    return (N, T, A, ls_H)

def main():
    print(solve(*readQuestion()))

main()
Buggy python submission (verdict: Runtime Error):
import sys

def solve(n, lst_a):
    a=1
    b=1    
    for i in as1:
        if a <i:
            a=i
        elif b>i:
            b=i
    return a-b

def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    n = int(line1)
    line2 = sys.stdin.readline().rstrip()
    lst_a = [int(s) for s in line2.split(' ')]
    return (n, lst_a)

def main():
    n, lst_ab = readQuestion()
    answer = solve(n, lst_ab)
    print(answer)
    
if __name__ == '__main__':
    main()

Fixed submission:
import sys

def solve(n, lst_a):
    a=lst_a[0]
    b=lst_a[0]
    [0]
    for i in lst_a:
        if a <i:
            a=i
        elif b>i:
            b=i
    return a-b

def readQuestion():
    line1 = sys.stdin.readline().rstrip()
    n = int(line1)
    line2 = sys.stdin.readline().rstrip()
    lst_a = [int(s) for s in line2.split(' ')]
    return (n, lst_a)

def main():
    n, lst_ab = readQuestion()
    answer = solve(n, lst_ab)
    print(answer)
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys

def solve(n, k, as):
        return n/(k-1)

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_n, str_k] = line.split(' ')
    line = sys.stdin.readline().rstrip()
    as = line.split(' ')
    return (int(str_n), int(str_k), [int(a) for a in as])

def main():
    n, k, as = readQuestion()
    answer = solve(n, k, as)
    print(answer)
    
if __name__ == '__main__':
    main()

Fixed submission:
import sys

def solve(n, k, as1):
    if (n-1)%(k-1)==0:
        return (n-1)//(k-1)
    else:
        return (n-1)//(k-1)+1

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_n, str_k] = line.split(' ')
    line = sys.stdin.readline().rstrip()
    as1 = line.split(' ')
    return (int(str_n), int(str_k), [int(a) for a in as1])

def main():
    n, k, as1 = readQuestion()
    answer = solve(n, k, as1)
    print(answer)
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys

def solve(a, b):
    if a == 0 or a==1 or a==2:
        if b==100:
            answer=100**a*b+(1**a)
        else:
            answer=100**a*b
    return answer

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)

if __name__ == '__main__':
    main()

Fixed submission:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a, b):
    if a>8 or b>8:
        answer=':('
    else:
        answer='Yay!'
    return answer

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()

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

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a, b):
    if 1<a and a<9:
        if 1<b and b<9:
            answer='yay!'
        else:
            answer=':('
    return answer

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()

Fixed submission:
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a, b):
    if a>8 or b>8:
        answer=':('
    else:
        answer='Yay!'
    return answer

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys

# 関数 solve は，もちろん，問題に応じて書き換える
def solve(a, b):
    if a==0:
        answer = atr(range(b))
    else:
        answer = (100*a*b)
    return answer

# ここから下は，入力・出力形式が同じであれば，変えなくて良い．
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)
    
if __name__ == '__main__':
    main()

Fixed submission:
import sys

def solve(a, b):
    if a == 0 or a==1 or a==2:
        if b==100:
            answer=100**a*b+(100**a)
        else:
            answer=100**a*b
    return answer

def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b] = line.split(' ')
    return (int(str_a), int(str_b))

def main():
    a, b = readQuestion()
    answer = solve(a, b)
    print(answer)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def solve(a,b,c):
    li = [a,b,c]
    cf = 0
    cs = 0
    for i in li:
        if i == 5:
            cf +=1
        if i==7:
            cs +=1
    if cf == 2 and cs ==1:
        return YES
    else:
        return NO
            
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b, str_c] = line.split(' ')
    return (int(str_a), int(str_b), int(str_c))

def main():
    a, b, c = readQuestion()
    answer = solve(a, b, c)
    print(answer)
    
if __name__ == '__main__':
    main()    

Fixed submission:
import sys

def solve(a,b,c):
    li = [a,b,c]
    cf = 0
    cs = 0
    for i in li:
        if int(i) == 5:
            cf +=1
        if int(i) == 7:
            cs +=1
    if cf == 2 and cs ==1:
        return 'YES'
    else:
        return 'NO'
            
def readQuestion():
    line = sys.stdin.readline().rstrip()
    [str_a, str_b, str_c] = line.split(' ')
    return (int(str_a), int(str_b), int(str_c))

def main():
    a, b, c = readQuestion()
    answer = solve(a, b, c)
    print(answer)
    
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
num = input()
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
ans=0
for i in range(num):
  if value[i] > cost[i]:
    ans = ans + value[i] - cost[i]
 
print(ans)

Fixed submission:
num = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
ans = 0
for i in range(num):
  if value[i] > cost[i]:
    ans = ans + value[i] - cost[i]
 
print(ans)

Buggy python submission (verdict: Runtime Error):
num = input()
value = [int(n) for n in input().split()]
cost = [int(n) for n in input().split()]

ans=0
for i in range(num):
  if value[i] > cost[i]:
    ans = ans + value[i] - cost[i]

print(ans)

Fixed submission:
num = int(input())
value = list(map(int, input().split()))
cost = list(map(int, input().split()))
ans = 0
for i in range(num):
  if value[i] > cost[i]:
    ans = ans + value[i] - cost[i]
 
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s = input()
n=len(s)

post = ''
ans=0
data=[]

left=[]
right=[]

tmp=0
for i in range(n):
    if s[i]=='#':
        tmp+=1
    elif tmp!= 0:
        left.append(tmp)
        tmp=0


tmp=0
for i in range(n):
    if s[n-i-1]=='.':
        tmp+=1
    if n-i-1-1 >=0 and s[n-i-1-1]=="#" and tmp!=0:
        right.append(tmp)
        tmp=0

right.reverse()
# print(s)
# print(left)
# print(right)

for i in range(len(left)):
    if i == len(left)-1:
        ans+=min(left[i],right[i])
        break
    l = left[i]
    r = right[i]
    if l >= r:
        ans+=r
        left[i+1]=l+r+left[i+1]
    else:
        ans+=l


print(ans)

Fixed submission:
a,b,c=list(map(int,input().split()))

if (a<=c and c <= b) or (b<=c and c <= a):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

ans=0
if a > b:
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

if a > b:
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

print(ans)X

Fixed submission:
a, b = map(int, input().split())

ans=0
if a > b:
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

if a > b:
    ans+=a
    a-=1
else:
    ans+=b
    b-=1

print(ans)