Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):

#################################
#配列を二つに分ける
#引数
# values: 配列
# a,b   : 配列の格納先
#戻り値
# なし
#################################
def separate(values,a,b):
    for v in values:
        a.append(v)
        a,b = b,a


##############################
#登場回数の多い数と登場回数を返す
#引数
# values: ソートされた配列
#戻り値
# 辞書型配列
##############################
def getCount(values):
    currentNum=0
    currentCount=0
    ret={'First' :{'Num':[],'Cnt':0},
         'Second':{'Num':[],'Cnt':0}}
    for v in values:
        if v==currentNum:
            currentCount+=1
        else:
            #別の数字が表れた場合
            if ret['First']['Cnt'] < currentCount:
                #最大値より大きい場合、それが新たな最大値になる
                ret['Second']=ret['First'].copy()
                ret['First']={'Num':[currentNum],'Cnt':currentCount}
            elif ret['First']['Cnt'] == currentCount:
                #最大値タイ
                ret['First']['Num'].append(currentNum)
            elif ret['Second']['Cnt'] < currentCount:
                #2番目より大きい場合、それが新たな2番目になる。
                ret['Second']={'Num':[currentNum],'Cnt':currentCount}
            elif ret['Second']['Cnt'] == currentCount:
                #2位タイ
                ret['Second']['Num'].append(currentNum)

            currentNum=v
            currentCount=1

    #配列の最後まで来た場合
    if ret['First']['Cnt'] < currentCount:
        ret['Second']=ret['First'].copy()
        ret['First']={'Num':[currentNum],'Cnt':currentCount}
    elif ret['First']['Cnt'] == currentCount:
        ret['First']['Num'].append(currentNum)
    elif ret['Second']['Cnt'] < currentCount:
        ret['Second']={'Num':[currentNum],'Cnt':currentCount}
    elif ret['Second']['Cnt'] == currentCount:
        ret['Second']['Num'].append(currentNum)

    return ret


#############################
# メイン
#############################
n = input()
vars = input ()
a=[]
b=[]
varArray=vars.split(" ")
separate(varArray,a,b)
a.sort()
b.sort()
a_result=getCount(a)
b_result=getCount(b)
if (len(a_result['First']['Num'])>1 or
    len(b_result['First']['Num'])>1):
    #最頻値が複数ある場合は素直に計算可
    xa=len(a)-a_result['First']['Cnt']
    xb=len(b)-b_result['First']['Cnt']
    x=xa+xb
else:
    #abどちらも最頻値が1種類の場合
    if a_result['First']['Num'][0]!=b_result['First']['Num'][0]:
        #abの最頻値が異なる場合は素直に計算可
        xa=len(a)-a_result['First']['Cnt']
        xb=len(b)-b_result['First']['Cnt']
        x=xa+xb
    else:
        #abの最頻値が同じ値の場合、どちらかは2番目の値を採用する必要あり
        xaa=len(a)-a_result['First']['Cnt']
        xab=len(b)-b_result['Second']['Cnt']
        xa=xaa+xab
        xba=len(a)-a_result['Second']['Cnt']
        xbb=len(b)-b_result['First']['Cnt']
        xb=xba+xbb
        x=xa if xa<xb else xb

print(x)


Fixed submission:
n=int(input())
d=1
for i in range(3):
    x=n//d%10
    if x==1:
        n+=8*d
    elif x==9:
        n-=8*d
    d*=10

print(n)
Buggy python submission (verdict: Runtime Error):
def main():
    A, B, X = list(map(int, input().split()))
    if A >= X or B >= X:
        N = 0
    elif X > 1e9 and afford(A, B, 1e9, X):
        N = int(1e9)
    else:
        limmin = 0
        limmax = 10 ** 9 + 1
        while limmax - limmin > 1:
            m = (limmax + limmin) // 2
            if afford(A, B, m, X):
                limmin = m
            else:
                limmax = m
        N = limmin
    print(N)


def afford(a, b, n, x):
    y = a * n + b * len(str(n))
    return y <= x


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    dow = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
    s = input()
    i = dow.index(s) + 1
    print(i)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    A, B, X = list(map(int, input().split()))
    if A >= X or B >= X:
        N = 0
    else:
        for d in range(len(str(X)), 0, -1):
            if d * B < X:
                break
        if d > 0:
            N = 0
            d = min(X // A, pow(10, d))
            for N in range(d, 0, -1):
                if afford(A, B, N, X):
                    break
            else:
                N = 0
        else:
            N = 0
    print(N if N < 1e9 else int(1e9))


def afford(a, b, n, x):
    c = a * n
    if c >= x:
        return False
    y = c + b * len(str(n))
    return y <= x


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    dow = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
    s = input()
    i = dow.index(s) + 1
    print(i)


if __name__ == "__main__":
    main()

Buggy python submission (verdict: Runtime Error):
def main():
    A, B, X = list(map(int, input().split()))
    if A >= X or B >= X:
        N = 0
    else:
        for d in range(len(str(X)), 0, -1):
            if d * B < X:
                break
        if d > 0:
            d = min(X // A, pow(10, d))
            for N in range(d, 0, -1):
                if afford(A, B, N, X):
                    break
            else:
                N = 0
        else:
            N = 0
    print(N if N < 1e9 else int(1e9))


def afford(a, b, n, x):
    c = a * n
    if c >= x:
        return False
    y = c + b * len(str(n))
    return y <= x


if __name__ == "__main__":
    main()

Fixed submission:
def main():
    dow = ['SAT', 'FRI', 'THU', 'WED', 'TUE', 'MON', 'SUN']
    s = input()
    i = dow.index(s) + 1
    print(i)


if __name__ == "__main__":
    main()
Buggy python submission (verdict: Runtime Error):
n,k =(int(x) for x in input().split())
list = (int(x) for x in input().split())
p = 0
     
for i in range(0, n):
	if list[i] >= k:
		p = p + 1

print(p)

Fixed submission:
n,k =(int(x) for x in input().split())
list = input().split()
p = 0
list = [int(s) for s in list]
     
for i in range(0, n):
    if list[i] >= k:
        p = p + 1

print(p)

Buggy python submission (verdict: Runtime Error):
n,k =(int(x) for x in input().split())
list = (int(x) for x in input().split())
p = 0

for i in range(0, n)
	if list[i] >= k:
    	p = p + 1

print(p)

Fixed submission:
n,k =(int(x) for x in input().split())
list = input().split()
p = 0
list = [int(s) for s in list]
     
for i in range(0, n):
    if list[i] >= k:
        p = p + 1

print(p)
Buggy python submission (verdict: Runtime Error):
n,d = input().split()
n = int(n)
d = int(d)
t = 2d + 1
     
if n % t == 0:
	ans = n/t
else:
	ans = n/t
    ans = ans + 1

print(ans)

Fixed submission:
r = int(input())

ans = r * r * 3

print(ans)

Buggy python submission (verdict: Runtime Error):
r = input()
ans = r * r * 3
print(ans)

Fixed submission:
r = int(input())

ans = r * r * 3

print(ans)
Buggy python submission (verdict: Runtime Error):
n,d = input().split()
n = int(n)
d = int(d)
t = 2d + 1
     
if n % t == 0:
	ans = n/t
else:
	ans = n/t
    ans = ans + 1

print(ans)

Fixed submission:
n,d=(int(x) for x in input().split())
t = 2 * d + 1
     
if n % t == 0:
    ans = n/t
else:
    ans = n/t
    ans = ans + 1

ans = int(ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
n,d = (int(x) for x in input().split())
t = 2d + 1
     
if n % t == 0:
	ans = n/t
else:
	ans = n/t
    ans = ans + 1

print(ans)

Fixed submission:
n,d=(int(x) for x in input().split())
t = 2 * d + 1
     
if n % t == 0:
    ans = n/t
else:
    ans = n/t
    ans = ans + 1

ans = int(ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
n,d = (int(x) for x in input().split())
t = 2d + 1

if n % t == 0:
  ans = n/t
else:
  ans = n/t + 1
  
print(ans)

Fixed submission:
n,d=(int(x) for x in input().split())
t = 2 * d + 1
     
if n % t == 0:
    ans = n/t
else:
    ans = n/t
    ans = ans + 1

ans = int(ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
num=list(map(int,input().split()))
A=num[0]
B=num[1]
S=(A*B)//math.gcd(A,B)
print(S)


Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
def lcm(a,b):
  return a*b//gcd(a,b)

num=list(map(int,input().split()))
A=num[0]
B=num[1]
S=lcm(A,B)
print(S)

Buggy python submission (verdict: Runtime Error):
import math
num=list(map(int,input().split()))
A=num[0]
B=num[1]
print(A*B//math.gcd(A,B))


Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
def lcm(a,b):
  return a*b//gcd(a,b)

num=list(map(int,input().split()))
A=num[0]
B=num[1]
S=lcm(A,B)
print(S)

Buggy python submission (verdict: Runtime Error):
import math
num=list(map(int,input().split()))
A=num[0]
B=num[1]
print(A*B//math.gcd(A,B))

Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
def lcm(a,b):
  return a*b//gcd(a,b)

num=list(map(int,input().split()))
A=num[0]
B=num[1]
S=lcm(A,B)
print(S)

Buggy python submission (verdict: Runtime Error):
import math
num=list(input().split())
A=num[0]
B=num[1]
print(A*B//math.gcd(A,B))

Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
def lcm(a,b):
  return a*b//gcd(a,b)

num=list(map(int,input().split()))
A=num[0]
B=num[1]
S=lcm(A,B)
print(S)

Buggy python submission (verdict: Runtime Error):
import math
num=list(input().split())
A=int(num[0])
B=int(num[1])
print(A*B//math.gcd(A,B))

Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
def lcm(a,b):
  return a*b//gcd(a,b)

num=list(map(int,input().split()))
A=num[0]
B=num[1]
S=lcm(A,B)
print(S)

Buggy python submission (verdict: Runtime Error):
import math
A,B=input().rstrip()
print(A*B//math.gcd(A,B))

Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
def lcm(a,b):
  return a*b//gcd(a,b)

num=list(map(int,input().split()))
A=num[0]
B=num[1]
S=lcm(A,B)
print(S)

Buggy python submission (verdict: Runtime Error):
import math
A,B=map(int,input().split())
print(A*B//math.gcd(A,B))

Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
def lcm(a,b):
  return a*b//gcd(a,b)

num=list(map(int,input().split()))
A=num[0]
B=num[1]
S=lcm(A,B)
print(S)

Buggy python submission (verdict: Runtime Error):
import math
A,B=input().split()
print(A*B//math.gcd(A,B))

Fixed submission:
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
def lcm(a,b):
  return a*b//gcd(a,b)

num=list(map(int,input().split()))
A=num[0]
B=num[1]
S=lcm(A,B)
print(S)
Buggy python submission (verdict: Runtime Error):
N=int(input())
if N%10==1:
  return (N-1)/10
elif N%10==2:
  return (N-2)/10
elif N%10==3:
  return (N-3)/10
elif N%10==4:
  return (N-4)/10
elif N%10==5:
  return ((N-5)/10)+1
elif N%10==6:
  return (N-6)/10
elif N%10==7:
  return ((N-7)/10)+1
elif N%10==8:
  return (N-8)/10
else:
  return (N-9)/10

Fixed submission:
N=int(input())
c=N%10
if c%2==1:
  print("0")
else:
  i=1
  b=0
  while i<=100:
    b+=N//(2*(5**i))
    i+=1
  else:
    print(b)
Buggy python submission (verdict: Runtime Error):
S = input()

Slen = len(S)
center = int(Slen/2)

Answer = 0

a = S[:center]
if center%2 == 0:
  b = S[-1:center-1:-1]
else:
  b = S[-1:center:-1]

for i in range(len(a)):
  if a[i] != b[i]:
    Answer += 1

print(Answer)

Fixed submission:
S = input()

Slen = len(S)
center = int(Slen/2)

Answer = 0

a = S[:center]
b = S[-1:center-1:-1]

for i in range(len(a)):
  if a[i] != b[i]:
    Answer += 1

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

Answer_dict = {}

for i in range(N-2):
  for j in range(i+1,N-1):
    for k in range(j+1,N):
      Answer_dict[S[i]+S[j]+S[k]] = 1

print(len(Answer_dict))

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

Answer_dict = {}
used_i = list()
used_j = [[] for j in range(10)]

for i in range(N-2):
  if S[i] in used_i:
    continue

  for j in range(i+1,N-1):
    if S[j] in used_j[int(S[i])]:
      continue

    for k in range(j+1,N):
      Answer_dict[S[i]+S[j]+S[k]] = 1

    used_j[int(S[i])].append(S[j])
  used_i.append(S[i])

print(len(Answer_dict))
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list()
l = 0

for n in range(0, N):
  p.append(list(map(int, input().split())))

for i in range(0, len(p)):
  for j in range(i+1, len(p)):
    l += math.sqrt((p[i][0] - p[j][0])**2 + (p[i][1] - p[j][1])**2)

n = math.factorial(N)
m = 2 * math.factorial(N-1)
print(l * m / n)

Fixed submission:
import math

N = int(input())
x = [0] * N
y = [0] * N
l = 0

for i in range(N):
  x[i], y[i] = map(int, input().split())

for i in range(N):
  for j in range(i+1, N):
    l += math.sqrt((x[i] - x[j])**2 + (y[i] - y[j])**2)

n = math.factorial(N)
m = 2 * math.factorial(N-1)
print(l * m / n)
Buggy python submission (verdict: Runtime Error):
a,b,x = map(int,input().split())

if(a* 1000000000 + b * len(str(1000000000)) <= x):
    print(1000000000)
    exit()

n = int(x/a)

while(True):

    if(n == 0):
        print(0)
        exit()

    if(a * n + b * len(str(n)) <= x):
        print(n)
        exit()
    else:
     n -= 1

Fixed submission:
day = str(input())

days = ["SAT","FRI","THU","WED","TUE","MON","SUN"]

for d in days:
    if(day == d):
        print(days.index(d) + 1)

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(str(input()))

n_s = ""

for c in s:
    add = n
    c_num = ord(c) - 64
    if(n % 26 == 0):
        n_s += c
    else:
        if(c_num + n > 26):
            add = (c_num + n) % 26
            n_s += chr(add + 64)
        else:
            n_s += chr(c_num + add + 64)

print(n_s)

Fixed submission:
day = str(input())

days = ["SAT","FRI","THU","WED","TUE","MON","SUN"]

for d in days:
    if(day == d):
        print(days.index(d) + 1)
Buggy python submission (verdict: Runtime Error):
a = int(input())
print(a * * 2)

Fixed submission:
a = int(input())
print(a ** 2)
Buggy python submission (verdict: Runtime Error):
a = int(input())
str = list(input())

if a%2 :
	print("No")
	exit()
  
n_str_1 = ""
n_str_2 = ""
  
fot i in range(a/2):
	n_str_1 += str[i]
    n_str_2 += str[i+a/2]

if n_str_1 == n_str_2 :
	print("Yes")
else :
  	print("No")

Fixed submission:
a = int(input())
str = list(input())

if a%2 :
	print("No")
	exit()
  
n_str_1 = ""
n_str_2 = ""
  
for i in range(int(a/2)):
    n_str_1 += str[i]
    n_str_2 += str[i+int(a/2)]

if n_str_1 == n_str_2 :
	print("Yes")
else :
  	print("No")
Buggy python submission (verdict: Runtime Error):
a,b = int(input().split())
c = a-b*2
if c <= 0:
  print(0)
else :
  print(c)

Fixed submission:
a,b = map(int,input().split())
c = a-b*2
if c <= 0:
  print(0)
else :
  print(c)

Buggy python submission (verdict: Runtime Error):
a,b = int(input().split())
c = a-b*2
if c <= 0:
  print(0)
else :
  print c

Fixed submission:
a,b = map(int,input().split())
c = a-b*2
if c <= 0:
  print(0)
else :
  print(c)
Buggy python submission (verdict: Runtime Error):
def aa097():
    a,b,c,d = list(map(int, input().split()))
    if abs(a-c) <= d:
        print('Yes')
        sys.exit()

    if abs(a-b) <= d and abs(b-c) <= d:
        print('Yes')
        sys.exit()

    print('No')

aa097()


Fixed submission:
import sys

def aa097():
    a,b,c,d = list(map(int, input().split()))
    if abs(a-c) <= d:
        print('Yes')
        sys.exit()

    if abs(a-b) <= d and abs(b-c) <= d:
        print('Yes')
        sys.exit()

    print('No')

aa097()
Buggy python submission (verdict: Time Limit Exceeded):
def except_arr(arr, i):
    pre = arr[0:i]
    post = arr[i+1:]
    return pre+post

def cc092():
    n = int(input())
    an = list(map(int, input().split()))

    for i in range(0, n):
        bn = except_arr(an, i)
        bn.extend([0])
        pos = 0
        cost = 0
        for j in bn:
            cost += abs(pos-j)
            pos = j
        print(cost)

cc092()

Fixed submission:
def cc092():
    n = int(input())
    an = [0] + list(map(int, input().split())) + [0]

    c = 0
    p = 0
    for i in an:
        c += abs(p-i)
        p = i

    for i in range(1, n+1):
        cc = abs(an[i-1]-an[i+1]) - (abs(an[i-1]-an[i]) + abs(an[i]-an[i+1]))
        print(c+cc)

cc092()

Buggy python submission (verdict: Time Limit Exceeded):
def except_arr(arr, i):
    pre = arr[0:i]
    post = arr[i+1:]
    return pre+post

def cc092():
    n = int(input())
    an = list(map(int, input().split()))

    for i in range(0, n):
        bn = except_arr(an, i)
        bn.extend([0])
        pos = 0
        cost = 0
        for j in bn:
            cost += abs(pos-j)
            pos = j
        print(cost)

cc092()

Fixed submission:
def cc092():
    n = int(input())
    an = [0] + list(map(int, input().split())) + [0]

    c = 0
    p = 0
    for i in an:
        c += abs(p-i)
        p = i

    for i in range(1, n+1):
        cc = abs(an[i-1]-an[i+1]) - (abs(an[i-1]-an[i]) + abs(an[i]-an[i+1]))
        print(c+cc)

cc092()

Buggy python submission (verdict: Runtime Error):
def cc092():
    n = int(input())
    an = list(map(int, input().split()))

    for i in range(0, n):
        bn = except_arr(an, i)
        bn.extend([0])
        pos = 0
        cost = 0
        for j in bn:
            cost += abs(pos-j)
            pos = j
        print(cost)

cc092()

Fixed submission:
def cc092():
    n = int(input())
    an = [0] + list(map(int, input().split())) + [0]

    c = 0
    p = 0
    for i in an:
        c += abs(p-i)
        p = i

    for i in range(1, n+1):
        cc = abs(an[i-1]-an[i+1]) - (abs(an[i-1]-an[i]) + abs(an[i]-an[i+1]))
        print(c+cc)

cc092()
Buggy python submission (verdict: Runtime Error):
def aa087():
    x = int(input())
    a = int(input())
    b = int(input())

    c = x - a
    d = math.floor(c/b)
    c -= b*d
    print(c)

aa087()

Fixed submission:
import math

def aa087():
    x = int(input())
    a = int(input())
    b = int(input())

    c = x - a
    d = math.floor(c/b)
    c -= b*d
    print(c)

aa087()
Buggy python submission (verdict: Runtime Error):
def bb086():
    a,b = list(input().split())
    c = int(math.sqrt(int(a+b)))
    d = str(c*c)
    print('Yes' if (a+b) == d else 'No')

bb086()

Fixed submission:
import math

def bb086():
    a,b = list(input().split())
    c = int(math.sqrt(int(a+b)))
    d = str(c*c)
    print('Yes' if (a+b) == d else 'No')

bb086()
Buggy python submission (verdict: Runtime Error):
n = int(input())

a = [int(input()) for i in range(n)]

a_max = max(a)
a_max_count = a.count(a_max)

if a_max_count > 1:
  for i in range(n):
    print(a_max)
    
else:
  for i in range(n):
    if a[i] == a_max:
      print(max(max(a[:i]), max(a[i+1:])))
      
    else:
      print(a_max)


Fixed submission:
n = int(input())

a = [int(input()) for i in range(n)]

a_max = max(a)
a_max_count = a.count(a_max)

if a_max_count > 1:
  for i in range(n):
    print(a_max)
    
else:
  print(max(a[1:]))
  
  for i in range(1, n-1):
    if a[i] == a_max:
      print(max(max(a[:i]), max(a[i+1:])))
      
    else:
      print(a_max)

  print(max(a[:-1]))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

a = [int(input()) for i in range(n)]

print(max(a[1:]))

for i in range(1, n-1):

  print(max(max(a[:i]), max(a[i+1:])))

print(max(a[:-1]))
  
  

Fixed submission:
n = int(input())

a = [int(input()) for i in range(n)]

a_max = max(a)
a_max_count = a.count(a_max)

if a_max_count > 1:
  for i in range(n):
    print(a_max)
    
else:
  print(max(a[1:]))
  
  for i in range(1, n-1):
    if a[i] == a_max:
      print(max(max(a[:i]), max(a[i+1:])))
      
    else:
      print(a_max)

  print(max(a[:-1]))
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input())

print(a * b / 2)


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

print(int(a * b / 2))
Buggy python submission (verdict: Time Limit Exceeded):

n, p = map(int, input().split())

result = 1

num2 = int(p ** (1/n)) + 1


for i in range(p):

    compare = num2 ** n

    if p % compare == 0:
        result = num2
        break

    num2 -= 1

print(result)



Fixed submission:
n, p = map(int, input().split())

pp = p
# 2のべき乗チェック
count_2 = 0
while True:
    if pp % 2 == 0:
        pp = pp / 2
        count_2 += 1
    else:
        break


result = 2 ** (count_2 // n)

p = p / (2 ** count_2)

kisu = True if p / 2 != 0 else False

num2 = int(p ** (1/n)) + 1
if kisu:
    num2 = num2 - 1 if num2 % 2 == 0 else num2
else:
    num2 = num2 - 1 if num2 % 2 != 0 else num2


for i in range(num2, 1, -2):
    if p % (i ** n) == 0:
        print(result * i)
        break

else:
    print(result * 1)

Buggy python submission (verdict: Time Limit Exceeded):

n, p = map(int, input().split())

num = 1
result = 1

for i in range(p):

    compare = num ** n

    if compare > p:
        break

    if p % compare == 0:
        result = num

    num += 1

print(result)



Fixed submission:
n, p = map(int, input().split())

pp = p
# 2のべき乗チェック
count_2 = 0
while True:
    if pp % 2 == 0:
        pp = pp / 2
        count_2 += 1
    else:
        break


result = 2 ** (count_2 // n)

p = p / (2 ** count_2)

kisu = True if p / 2 != 0 else False

num2 = int(p ** (1/n)) + 1
if kisu:
    num2 = num2 - 1 if num2 % 2 == 0 else num2
else:
    num2 = num2 - 1 if num2 % 2 != 0 else num2


for i in range(num2, 1, -2):
    if p % (i ** n) == 0:
        print(result * i)
        break

else:
    print(result * 1)
Buggy python submission (verdict: Runtime Error):

inn = str(input())

result = 999

for i in range(len(inn)-2):
  if i == len(inn) - 3:
    num = inn[i:]

  else:
    num = inn[i:i+3]

  sa = abs(753 - innt(num))

  if sa < result:
    result = sa

prinnt(result)


Fixed submission:

inn = str(input())

result = 999

for i in range(len(inn)-2):
  if i == len(inn) - 3:
    num = inn[i:]

  else:
    num = inn[i:i+3]

  sa = abs(753 - int(num))

  if sa < result:
    result = sa

print(result)

Buggy python submission (verdict: Runtime Error):
in = input()

result = 999

for i in range(len(in)-2):
  if i == len(in) - 3:
    num = in[i:]
  else:
    num = in[i:i+3]

  sa = abs(753 - int(num))

  if sa < result:
    result = sa

print(result)


Fixed submission:

inn = str(input())

result = 999

for i in range(len(inn)-2):
  if i == len(inn) - 3:
    num = inn[i:]

  else:
    num = inn[i:i+3]

  sa = abs(753 - int(num))

  if sa < result:
    result = sa

print(result)

Buggy python submission (verdict: Runtime Error):

in = input()

result = 999

for i in range(len(in)-2):
  if i == len(in) - 3:
    num = in[I:]
  else:
    num = in[i:i+3]

  sa = abs(753 - int(num))

  if sa < result:
    result = sa

print(result)


Fixed submission:

inn = str(input())

result = 999

for i in range(len(inn)-2):
  if i == len(inn) - 3:
    num = inn[i:]

  else:
    num = inn[i:i+3]

  sa = abs(753 - int(num))

  if sa < result:
    result = sa

print(result)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8

N = int(input())
S = input().rstrip('#')

lb = 0
rw = S.count('.')
ans = lb + rw

for i in range(N):
  if S[i] == '.':
    rw -= 1
  else:
    lb += 1
  ans = min(ans, rw + lb)

print(ans)

Fixed submission:
# coding: utf-8

N = int(input())
S = input().rstrip('#')

lb = 0
rw = S.count('.')
ans = lb + rw

for i in range(len(S)):
  if S[i] == '.':
    rw -= 1
  else:
    lb += 1
  ans = min(ans, rw + lb)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8

N = int(input())
S = input().strip()

def stone_cnt(idx):
  return S[:idx].count("#") + S[idx:].count(".")

left = 0
right = len(S)

ans = min([stone_cnt(i) for i in range(N+1)])
  

print(ans)

Fixed submission:
# coding: utf-8

N = int(input())
S = input().rstrip('#')

lb = 0
rw = S.count('.')
ans = lb + rw

for i in range(len(S)):
  if S[i] == '.':
    rw -= 1
  else:
    lb += 1
  ans = min(ans, rw + lb)

print(ans)