Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p03353 (python)

Fixed submission:
s=input()
k=int(input())
a=[s[i:i+j+1] for i in range(len(s)) for j in range(k+1)]
a=set(a)
a=sorted(a)
print(a[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
a=[]
a = [s[i:j] for i in range(0,len(s)) for j in range(1,len(s)+1) if i != j]
a = set(a)
a.remove("")
a=sorted(a)
print(a[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
a=[]
for i in range(0,len(s)):
    for j in range(1,len(s)+1):
        a.append(s[i:j])
num = a.count("")
for i in range(num):
    a.remove("")
a=set(a)
a=sorted(a)

print(a[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
a=[]
a = [s[i:j] for i in range(0,len(s)) for j in range(1,len(s)+1) if i != j]
a=set(a)
a.remove("")
a=sorted(a)
print(a[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
a=[]
for i in range(0,len(s)):
    for j in range(1,len(s)+1):
        if i != j and s[i:j] not in a:
            a.append(s[i:j])
a.remove("")
a=sorted(a)
print(b[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
a=[]
a = [s[i:j] for i in range(0,len(s)) for j in range(1,len(s)+1) if i != j]
a.remove("")
a=sorted(a)
b=[]
for i in a:
    if i not in b:
        b.append(i)
print(b[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
a=[]
a = [s[i:j] for i in range(0,len(s)) for j in range(1,len(s)+1) if i != j]
b=[]
for i in a:
    if i not in b:
        b.append(i)
b.remove("")
b=sorted(b)
print(b[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
a=[]
for i in range(0,len(s)):
    for j in range(1,len(s)+1):
        if i != j:
            if s[i:j] not in a:
                a.append(s[i:j])
a.remove("")
a=sorted(a)
print(a[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
a=[]
for i in range(0,len(s)):
    for j in range(1,len(s)+1):
        if i != j:
            a.append(s[i:j])
a.remove("")
a=sorted(a)
b=[]
for i in a:
    if i not in b:
        b.append(i)
print(b[k-1])

Buggy submission (verdict: Runtime Error):
s=input()
k=int(input())
a=[]
for i in range(0,len(s)):
    for j in range(1,len(s)+1):
        a.append(s[i:j])
a=sorted(a)
b=[]
for i in a:
    if i not in b:
        b.append(i)
b.remove("")
print(b[k-1])
Problem p03433 (python)

Fixed submission:
num=int(input())
a=int(input())

b=num%500
if b>a:
    print("No")
else:
    print("Yes")

Buggy submission (verdict: Runtime Error):
n=int(input())
c=list(map(int, input().split()))
c.sort(reverse=True)
a=0
b=0
for i in range(n):
    if i%2==0:
        a=a+c[i]
    else:
        b=b+c[i]
print(a-b)

Buggy submission (verdict: Runtime Error):
n=int(input())
c=list(map(int, input().split()))
c.sort(reverse=True)
a=0
b=0
for i in range(n):
    if i%2==0:
        a=a+c[i]
    else:
        b=b+c[i]
print(a-b)
Problem p03827 (python)

Fixed submission:
n=int(input())
s=input()
x=ans=0
for i in range(n):
    if s[i]=='I':
        x=x+1
    elif s[i]=='D':
        x=x-1
    ans=max(ans,x)
print(ans)

Buggy submission (verdict: Runtime Error):
  n=int(input())
s=input()
x=ans=0
for i in range(n):
    if s[i]=='I':
        x=x+1
    elif s[i]=='D':
        x=x-1
    ans=max(ans,x)
print(ans)
Problem p03845 (python)

Fixed submission:
n=int(input())
t=list(map(int,input().split()))
m=int(input())
for i in range(m):
    p,x=map(int,input().split())
    print(sum(t)-t[p-1]+x)

Buggy submission (verdict: Runtime Error):
n=int(input())
t=list(map(int,input().split()))
m=int(input())
for i in range(m):
    p,x=map(int,input().split())
    print(sum(t)-t[i]+x)
Problem p04030 (python)

Fixed submission:
a=''
for i in input():
    if i=='B':
        a=a[:-1]
    else:
        a+=i
print(a)

Buggy submission (verdict: Runtime Error):
a=''
for i in input():
    if i=='B':
        a=a[:-1]
    else:
        a+=x
print(a)
Problem p03324 (python)

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

if n == 100:
    print(101 * (100**d))
else:
    print(n * (100**d))

Buggy submission (verdict: Runtime Error):
d, n = map(int, input().split())

ans = []
if d == 0:
    x = 1
    while True:
        if x % 100 != 0 and x % 10000 != 0:
            ans.append(x)
        x += 1
        if len(ans) == n:
            break
elif d == 1:
    x = 100
    while True:
        if x % 10000 != 0:
            ans.append(x)
        x += 100
        if len(ans) == n:
            break
else:
    x = 10000
    while True:
       if x % 100000000 != 0:
       ans.append(x)
        x += 10000
        if len(ans) == n:
            break

print(ans[-1])
Problem p03591 (python)

Fixed submission:
S = input()
if S[:4] == 'YAKI':
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N, M, K = map(int, input().split())

flag = False
for n in range(M + 1):
    for m in range(N + 1):
        if n * N + m * (M - n * 2) == K:
            flag = True

if flag:
    print('Yes')
else:
    print('No')
Problem p03597 (python)

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

print(N * N - A)

Buggy submission (verdict: Runtime Error):
A.py
Problem p03639 (python)

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

count1 = 0
count2 = 0
count4 = 0
for i in range(N):
    value = a[i] % 4
    if value == 0:
        count4 += 1
    elif value == 2:
        count2 += 1
    else:
        count1 += 1

if count1 <= count4 or (count1 - count4 == 1 and count2 == 0):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))

q = []
summation = [p[i] + p[i + 1] for i in range(N - 1)]
for i in range(int(N / 2)):
    if len(p) == 2:
        q = p + q
    else:
        index = summation.index(max(summation))
        q = p[index:index + 2] + q
        p = p[:index] + p[index + 2:]
        if index == 0:
            summation = summation[2:]
        elif index == len(summation):
            summation = summation[:index - 1]
        else:
            summation = summation[:index - 1] + [p[index - 1] + p[index]] + summation[index + 2:]

[print(i, end=' ') for i in q]

Buggy submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))

q = []
summation = [p[i] + p[i + 1] for i in range(N - 1)]
for i in range(int(N / 2)):
    if len(p) == 2:
        q = p + q
    else:
        index = summation.index(max(summation))
        q = p[index:index + 2] + q
        p = p[:index] + p[index + 2:]
        print(index, summation)
        if index == 0:
            summation = summation[2:]
        elif index == len(summation):
            summation = summation[:index - 1]
        else:
            summation = summation[:index - 1] + [p[index - 1] + p[index]] + summation[index + 2:]

[print(i, end=' ') for i in q]
Problem p03698 (python)

Fixed submission:
S = list(map(str, raw_input().split())[0])
S.sort()

flag = True
for i in range(len(S) - 1):
    if S[i] == S[i + 1]:
        flag = False
        break

if flag:
    print("yes")
else:
    print("no")

Buggy submission (verdict: Runtime Error):
 = list(map(str, raw_input().split())[0])
S.sort()

flag = True
for i in range(len(S) - 1):
    if S[i] == S[i + 1]:
        flag = False
        break

if flag:
    print("yes")
else:
    print("no")
Problem p03699 (python)

Fixed submission:
N = int(raw_input())
s = [int(raw_input()) for _ in range(N)]

result = sum(s)
if (result % 10) != 0:
    print(result)
else:
    s.sort()
    for i in range(len(s)):
        if (s[i] % 10) != 0:
            result -= s[i]
            break
    if (result % 10) != 0:
        print(result)
    else:
        print(0)

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
s = [int(raw_input()) for _ in range(N)]

flag = True
for i in range(len(s)):
    if (s[i] % 10) != 0:
        flag = False
        break
if flag:
    print(0)
else:
    s.sort()
    s = s[::-1]
    Ncombination = 2**len(s)

    for c in range(Ncombination):
        SUM = 0
        combination = format(c, 'b').zfill(len(s))
        # print("combination", combination)
        for i in range(len(s)):
            # print("combination", i, combination[i])
            if combination[i] == "0":
                SUM += s[i]
        # print("SUM", SUM)
        if (SUM % 10) != 0:
            break
    print(SUM)

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
s = [int(raw_input()) for _ in range(N)]

flag = True
for i in range(len(s)):
    if (s[i] % 10) != 0:
        flag = False
        break
if flag:
    print(0)
else:
    s.sort()
    s = s[::-1]
    Ncombination = 2**len(s)

    for c in range(Ncombination):
        SUM = 0
        combination = format(c, 'b').zfill(len(s))
        # print("combination", combination)
        for i in range(len(s)):
            # print("combination", i, combination[i])
            if combination[i] == "0":
                SUM += s[i]
        # print("SUM", SUM)
        if (SUM % 10) != 0:
            break
    print(SUM)
~

Buggy submission (verdict: Runtime Error):
N = int(raw_input())
s = [int(raw_input()) for _ in range(N)]

flag = True
for i in range(len(s)):
    if (s[i] % 10) != 0:
        flag = False
        break
if flag:
    print(0)
else:
    s.sort()
    s = s[::-1]
    Ncombination = 2**len(s)

    for c in range(Ncombination):
        SUM = 0
        combination = format(c, 'b').zfill(len(s))
        # print("combination", combination)
        for i in range(len(s)):
            print("combination", i, combination[i])
            if combination[i] == "0":
                SUM += s[i]
        # print("SUM", SUM)
        if (SUM % 10) != 0:
            break
    print(SUM)
Problem p03773 (python)

Fixed submission:
A, B = map(int, raw_input().split())

result = A + B

while True:
    if 24 <= result:
        result -= 24
    else:
        break

print(result)

Buggy submission (verdict: Runtime Error):
import itertools
 
N, A, B = map(int, raw_input().split())
 
v = map(int, raw_input().split())
 
resultValue = 0
resultCount = 0
 
for pcs in range(B - A + 1):
    perm = list(itertools.combinations(v, B + pcs))
    for cand in perm:
        average = float(sum(cand)) / len(cand)
        if resultValue < average:
            resultValue = average
            resultCount = 1
        elif resultValue == average:
            resultCount += 1
 
print(resultValue)
print(resultCount)

Buggy submission (verdict: Runtime Error):
A, B = map(int, raw_input().split())

result = A + B

while True:
    if 24 <= result:
        result -= 24
    else:
        break

print(result)
Problem p03777 (python)

Fixed submission:
a, b = map(str, raw_input().split())

if a == b:
    print 'H'
else:
    print 'D'

Buggy submission (verdict: Runtime Error):
a, b = map(int, raw_input().split())
if a == b:
    print 'H'
else:
    print 'D'
Problem p03547 (python)

Fixed submission:
l = input().split()

a = int(l[0],16)
b = int(l[1],16)

if a == b:
	print("=")
elif a < b:
	print("<")
else:
	print(">")

Buggy submission (verdict: Runtime Error):
from sklearn.datasets import load_digits
input, ground_truth = load_digits(return_X_y=True)
 
l = input().split()
 
a = int(l[0],16)
b = int(l[1],16)
 
if a == b:
	print("=")
elif a < b:
	print("<")
else:
	print(">")

Buggy submission (verdict: Runtime Error):
from sklearn.datasets import load_digits
input, ground_truth = load_digits(return_X_y=True)

l = input().split()
 
a = int(l[0],16)
b = int(l[1],16)
 
if a == b:
	print("=")
elif a < b:
	print("<")
else:
	print(">")
Problem p03597 (python)

Fixed submission:
n = int(input())
m = int(input())
print( n*n - m )

Buggy submission (verdict: Runtime Error):
n = int(raw_input())
m = int(raw_input())
print( n*n - m )
Problem p03598 (python)

Fixed submission:
n = int(input())
k = int(input())
l = input().split()
ans = 0
for i in l:
  j = int(i)
  if( j < abs( j - k )  ):
    ans += 2*j
  else:
    ans += 2*abs(j-k)
print(ans)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
l = []
for i in range(n):
 l.append(int(input()))
ans = 0
for i in l:
 if( i < abs( i - k )  ):
  ans += 2*abs(i-k)
 else:
  ans += 2*i
print(ans)
Problem p03609 (python)

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


if t < x:
  print( x - t )
else:
  print( 0 )

Buggy submission (verdict: Runtime Error):
x = int(input())
t = int(input())

if t < x:
  print( x - t )
else:
  print( 0 )

Buggy submission (verdict: Runtime Error):
x = input()
t = input()

if t < x:
  print( x - t )
else:
  print( 0 )
Problem p03814 (python)

Fixed submission:
string = input()
index_of_A = string.index("A")
index_of_Z = string.rfind("Z")

print(index_of_Z - index_of_A + 1)

Buggy submission (verdict: Runtime Error):
string = input()
index_of_A = string.index("A")
index_of_Z = string.index("Z", index_of_A, len(string)-1)

print(index_of_Z - index_of_A + 1)

Buggy submission (verdict: Runtime Error):
string = input()
count = 0
for i in range(len(string)):
  if string[i] == "A":
    count = 1
    while string[i] != "Z":
      count += 1
      i += 1 
print(count+1)
Problem p03845 (python)

Fixed submission:
num_problems = input()
a = input()
total = 0
seconds_per = a.split()
for i in seconds_per:
  total += int(i)
drinks = int(input())
for i in range(drinks):
  b = input()
  c = b.split()
  question = int(c[0])
  change = int(c[1])
  new = total-int(seconds_per[question-1]) + change
  print(new)

Buggy submission (verdict: Runtime Error):
num_problems = int(input())
a = input()
seconds_per = a.split()
for i in seconds_per:
  total += int(i)
drinks = int(input())
for i in range(drinks):
  b = input()
  c = b.split()
  question = int(c[0])
  change = int(c[1])
  new = total-int(seconds_per[question-1]) + change
  print(new)

Buggy submission (verdict: Runtime Error):
num_problems = int(input())
a = input()
seconds_per = a.split()
drinks = int(input())
for i in range(drinks):
  b = input()
  c = b.split()
  question = int(c[0])
  change = int(c[1])
  copy = seconds_per[question-1]
  seconds_per[question-1] = change
  print(sum(seconds_per))
  seconds_per[question-1] = copy
Problem p03852 (python)

Fixed submission:
letter = input()
if letter in "aeiou":
  print("vowel")
else:
  print("consonant")

Buggy submission (verdict: Runtime Error):
letter = input()
if(letter == "a" or letter == "e" or letter = "i" or letter == "o" or letter == "u"):
  print("vowel")
else:
  print("consonant")
Problem p03962 (python)

Fixed submission:
j = (input())

x = j.split()
y = []

for i in x:
  if(i not in y):
    y.append(i)
print(len(y))

Buggy submission (verdict: Runtime Error):
j = int(input())

x = j.split()
y = []

for i in x:
  if(i not in y):
    y.append(i)
print(len(y))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = [a, b, c]
y = []

for i in x:
  if(i not in y):
    y.append(i)
print(len(y))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
s = {}
s.add(a)
s.add(b)
s.add(c)
print len(s)

Buggy submission (verdict: Runtime Error):

a = int(input())
b = int(input())
c = int(input())
s = {a, b, c}
print len(s)
Problem p03963 (python)

Fixed submission:
i = input()
j = i.split()
num_balls = int(j[0])
num_colors = int(j[1])
product = num_colors
if(num_balls > 1 and num_colors == 1):
  print(0)
else:
  for i in range(1, num_balls):
    product *= (num_colors - 1)
  print(product)

Buggy submission (verdict: Runtime Error):
i = input()
j = i.split()
num_balls = j[0]
num_colors = j[1]
product = num_colors
if(num_balls > 1 and num_colors == 1):
  print(0)
for i in range(1, num_balls):
  product *= (num_balls - 1)
print(product)
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
area = 0.5*(a+b)*h
print(int(area))

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
h = int(input())
area = 0.5(a+b)*h
print(area)
Problem p03998 (python)

Fixed submission:
alice = list(input())#aca
bob = list(input())#accc
charlie = list(input())#ca

current = alice
while(len(alice) >= 0 and len(bob) >= 0 and len(charlie) >= 0):
  # if(len(current) == 0):
  #   if(current is alice):
  #     print('A')
  #     break
  #   elif(current is bob):
  #     print('B')
  #     break
  #   elif(current is charlie):
  #     print('C')
  #     break
  if(current[0] == 'a'):
    del current[0]
    current = alice
    if(len(current) == 0):
      print('A')
      break
  elif(current[0] == 'b'):
    del current[0]
    current = bob
    if(len(current) == 0):
      print('B')
      break
  elif(current[0] == 'c'):
    del current[0]
    current = charlie
    if(len(current) == 0):
      print('C')
      break

Buggy submission (verdict: Runtime Error):
alice = list(input())
bob = list(input())
charlie = list(input())

current = alice
while(len(alice) > 0 and len(bob) > 0 and len(charlie) > 0):
  if(current[0] == 'a'):
	del current[0]
    current = alice
  elif(current[0] == 'b'):
    del current[0]
	currrent = bob
  elif(current[0] == 'c'):
    del current[0]
	current = charlie
if(len(alice) == 0):
  print('A')
elif(len(bob) == 0):
  print('B')
elif(len(charlie) == 0):
  print('C')
Problem p03469 (python)

Fixed submission:
S = input()
print('2018'+S[4:])

Buggy submission (verdict: Runtime Error):
import itertools

N, Y = (int(x) for x in input().split())
for x, y in itertools.product(range(N+1), range(N+1)):
  z = N - x - y
  if 0 <= z and 10000*x + 5000*y + 1000*z == Y:
    print('{} {} {}'.format(x, y, z))
    break
if not(x + y + z == N and 10000*x + 5000*y + 1000*z == Y):      
  print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
import itertools

N, Y = (int(x) for x in input().split())
for x, y in itertools.product(range(N+1), range(N+1)):
  z = N - x - y
  if 0 <= z and 10000*x + 5000*y + 1000*z == Y:
    print('{} {} {}'.format(x, y, z))
    break

if not(x + y + z == N and 10000*x + 5000*y + 1000*z == Y):      
  print('-1 -1 -1')

Buggy submission (verdict: Runtime Error):
import itertools

N, Y = (int(x) for x in input().split())
for x, y in itertools.product(range(N+1), range(N+1)):
  z == N - x - y
  if 0 <= z and 10000*x + 5000*y + 1000*z == Y:
    print('{} {} {}'.format(x, y, z))
    break

if not(x + y + z == N and 10000*x + 5000*y + 1000*z == Y):      
  print('-1 -1 -1')
Problem p03308 (python)

Fixed submission:
n = int(input())
A = list(map(int,input().split()))
print(max(A) - min(A))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = [map(int,input().split())]
print(max(A) - min(A))

Buggy submission (verdict: Runtime Error):
n = int(input())
A = [map(int,input().split())]
print(max.A - min.A)
Problem p03337 (python)

Fixed submission:
a,b = map(int,input().split())
c = [a + b,a - b,a * b]
print(max(c))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

ans = 0
for i in range(N):
    ans = max(ans,len(set(s[:i])) & set(s[i:]))
print(ans)
Problem p03338 (python)

Fixed submission:
N = int(input())
S = input()
ans = 0
for i in range(N):
    ans = max(ans,len(set(S[:i]) & set(S[i:])))
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

ans = 0
for i in range(N):
    ans = max(ans,len(set(s[:i]) & set(s[i:])))
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

ans = 0
for i in range(N):
    ans = max(ans,len(set(s[:i]) & set(s[i:]))
print(ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
S = input()

ans = 0
for i in range(N):
    ans = max(ans,len(set(s[:i])) & set(s[i:]))
print(ans)
Problem p03369 (python)

Fixed submission:
S = input()
a = S.count('o')
print(700 + 100 * a)

Buggy submission (verdict: Runtime Error):
S = input().
a = S.count('o')
print(700 + 100 * a)
Problem p03377 (python)

Fixed submission:
A,B,X = map(int,input().split())
if (A <= X <= (A + B)):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
n,m,x = map(int,input().split())
A = list(map(int,input().split()))

ans1 = len([a for a in A if a < x])
ans2 = len([a for a in A if a > x])
print(min(ans1,ans2))

Buggy submission (verdict: Runtime Error):
A,B,X = map(int,input().split)
if (A <= X <= (A + B)):
    print('YES')
else:
    print('NO')

Buggy submission (verdict: Runtime Error):
A,B,X = map(int,input())
if (A <= X <= (A + B)):
    print('YES')
else:
    print('NO')
Problem p03379 (python)

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

AB = sorted(A)
C = int(N//2)
for i in range(N):
    if A[i] <= AB[C-1]:
        print(AB[C])
    else:
        print(AB[C-1])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))

AB = sorted(A)
C = int(N/2)
for i in range(N):
    if AB[i] <= AB[C+1]:
        print(AB[C+1])
    else:
        print(AB[C])

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int,input().split()))

AB = sorted(A)
C = int(N/2)
for i in range(N):
    if AB[i] <= AB[C]:
        print(AB[C+1])
    else:
        print(AB[C])

Buggy submission (verdict: Runtime Error):
N = int,input().split()
A = list(map(int,input().split()))

AB = sorted(A)
C = int(N/2)
for i in range(N):
    if AB[i] <= AB[C-1]:
        print(AB[C])
    else:
        print(AB[C-1])

Buggy submission (verdict: Runtime Error):
N = int,input().split()
A = list(map(int,input().split()))

A1 = sorted(A)
a = int(N/2)
for i in range(N):
    if A1[i] <= A1[a-1]:
        print(A1[a])
    else:
        print(A1[a-1])

Buggy submission (verdict: Runtime Error):
N = int,input().split()
A = list(map(int,input().split()))

A1 = sorted(A)
a = int(n/2)
for i in range(N):
    if A1[i] <= A1[a-1]:
        print(A1[a])
    else:
        print(A1[a-1])
Problem p03455 (python)

Fixed submission:
a, b = map(int, input().split())
if (a*b) % 2:
    print("Odd")
else:
    print("Even")

Buggy submission (verdict: Runtime Error):
a, b=map(int, input(),split())
if (a*b)% 2:
 print("Odd")
else:
 print("Even")
Problem p03436 (python)

Fixed submission:
arr=[]
numbero=list(map(int, input().split()))
for i in range(numbero[0]):
    arr.append(input())
way=[[0 for i in range(numbero[1])] for j in range(numbero[0])]
way[0][0]=1
head=0
whoop=[[0,0]]
while head<len(whoop):
    u=whoop[head][0]
    v=whoop[head][1]
    head+=1
    if u>0:
        if way[u-1][v]==0 and arr[u-1][v]=='.':
            way[u-1][v]=way[u][v]+1
            whoop.append([u-1,v])
    if v>0:
        if way[u][v-1]==0 and arr[u][v-1]=='.':
            way[u][v-1]=way[u][v]+1
            whoop.append([u,v-1])
    if u<numbero[0]-1:
        if way[u+1][v]==0 and arr[u+1][v]=='.':
            way[u+1][v]=way[u][v]+1
            whoop.append([u+1,v])
    if v<numbero[1]-1:
        if way[u][v+1]==0 and arr[u][v+1]=='.':
            way[u][v+1]=way[u][v]+1
            whoop.append([u,v+1])
if way[numbero[0]-1][numbero[1]-1]==0:
    print(-1)
else:
    head=0
    for i in arr:
        head+=i.count('.')
    print(head-way[numbero[0]-1][numbero[1]-1])

Buggy submission (verdict: Runtime Error):
arr=[]
numbero=list(map(int, input().split()))
for i in range(numbero[0]):
    arr.append(input())
way=[[False for i in range(numbero[1])] for j in range(numbero[0])]
def waycon(i,j):
    way[i][j]=True
    if i>0:
        if not way[i-1][j] and arr[i-1][j]=='.':
            waycon(i-1,j)
    if j>0:
        if not way[i][j-1] and arr[i][j-1]=='.':
            waycon(i,j-1)
    if i<numbero[0]-1:
        if not way[i+1][j] and arr[i+1][j]=='.':
            waycon(i+1,j)
    if j<numbero[1]-1:
        if not way[i][j+1] and arr[i][j+1]=='.':
            waycon(i,j+1)
waycon(0,0)
if not way[numbero[0]-1][numbero[1]-1]:
    print(-1)
else:
Problem p03543 (python)

Fixed submission:
a=input()
def check(n):
	if n[0]==n[1]:
		if n[1]==n[2]:
			return "Yes"
		else:
			return "No"
	else:
		if n[1]==n[2]:
			if n[2]==n[3]:
				return "Yes"
			else:
				return "No"
		else:
			return "No"
print(check(a))

Buggy submission (verdict: Runtime Error):
n=int(input())
def lucas(n):
	if n==0:
		return 2
	if n==1:
		return 1
	if n>1:
		return lucas(n-1)+lucas(n-2)
print(lucas(n))
Problem p03544 (python)

Fixed submission:
n=int(input())
def lucas(n):
	a, b = 2, 1
	for i in range(n):
		a, b = b, a+b
	return a
print(lucas(n))

Buggy submission (verdict: Runtime Error):
n=int(input())
def lucas(n):
	if n=0:
		return 2
	if n=1:
		return 1
	if n>1:
		return lucas(n-1)+lucas(n-2)
print(lucas(n))