Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# Exercício 15.4-3 - Cormen 3 ed.

s = input()
t = input()
# s = "a" * 3000
# t = "a" * 2980
n = len(s) + 1
m = len(t) + 1
c = [[-1] * (m) for x in [-1] * (n)]

def lcsLengthMemoized(i, j):
    global c
    if c[i][j] != -1:
        return c[i][j]
    if i == 0 or j == 0:
        c[i][j] = 0
        return c[i][j]
    global s, t
    if s[i - 1] == t[j - 1]:
        c[i][j] = lcsLengthMemoized(i - 1, j - 1) + 1
        return c[i][j]
    top_p = lcsLengthMemoized(i - 1, j)
    left_p = lcsLengthMemoized(i, j - 1)
    c[i][j] = max(top_p, left_p)
    return c[i][j]
    
def getLCS(i, j, lcs=""):
    global c
    if c[i][j] == 0:
        return lcs
    global s, t
    if s[i - 1] == t[j - 1]: # volta uma linha e uma coluna
        lcs += getLCS(i - 1, j - 1, lcs)
        lcs += s[i - 1]
        return lcs
    elif c[i - 1][j] > c[i][j - 1]: # volta uma linha na mesma coluna
        lcs += getLCS(i - 1, j, lcs)
    else: # volta uma coluna na mesma linha
        lcs += getLCS(i, j - 1, lcs)
    return lcs

lcsLengthMemoized(n - 1, m - 1)
print(getLCS(n - 1, m - 1))

Fixed submission:
def main():
  import numpy as np

  s = np.array(list(input()), np.unicode)
  sl = len(s)
  t = np.array(list(input()), np.unicode)
  tl = len(t)
  equal = (s[:, None] == t[None, :])

  dp = [np.zeros(tl + 1, np.int32)]
  for i in range(sl):
    tmp = dp[-1].copy()
    np.maximum(tmp[1:], tmp[:-1] + equal[i], out=tmp[1:])
    np.maximum.accumulate(tmp, out=tmp)
    dp.append(tmp)

  answer = ''
  while sl > 0 and tl > 0:
    if s[sl - 1] == t[tl - 1]:
      sl -= 1
      tl -= 1
      answer += s[sl]
      continue

    if dp[sl - 1][tl] > dp[sl][tl - 1]:
      sl -= 1
    else:
      tl -= 1

  print(answer[::-1])

if __name__ == '__main__':
  main()
Buggy python submission (verdict: Runtime Error):
def main():
    n, m = [int(x) for x in input().split()]
    global dp
    dp = [-1]*n
    grafo = [[] for _ in range(n)]

    for _ in range(m):
        x, y = [int(x) for x in input().split()]
        x -= 1
        y -= 1

        grafo[x].append(y)

    resp = 0
    for u in range(n):
        resp = max(dfs(u, grafo), resp)

    print(resp)
        

def dfs(u, grafo):
    global dp

    if len(grafo[u]) == 0:
        dp[u] = 0
        return dp[u]

    if dp[u] != -1:
        return dp[u]


    for v in grafo[u]:
        dp[u] = max(dfs(v, grafo) + 1, dp[u])

    return dp[u]
        
main()

Fixed submission:
from collections import deque

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


grafo = [[] for i in range(n+1)]

num_adj = [0] * (n+1)

for i in range(m):
    u, v = map(int,input().split())
    grafo[u].append(v)
    num_adj[v] += 1

q = deque()

for i in range(1, n+1):
    if num_adj[i] == 0:
        q.append(i)

dp = [0] * (n + 1)

while q:
    n = q.popleft()
    for s in grafo[n]:
        num_adj[s] -= 1

        if num_adj[s] == 0:
            q.append(s)
            dp[s] = dp[n] + 1

print(max(dp))
Buggy python submission (verdict: Time Limit Exceeded):
mod = 10**9+7
 
n = int(input())
a = [[int(x) for x in input().split()] for _ in range(n)]
 
dp = [-1 for __ in range(1 << n)]
dp[0] = 1
 
 
def dfs(bit, i):
    if dp[bit] != -1:
        return dp[bit]
    else:
        tmp = 0
        for j in range(n):
            if bit & (1 << j) and a[i][j]:
                tmp += dfs(bit ^ (1 << j), i+1)
    dp[bit] = tmp % mod
    return dp[bit]
 
 
print(dfs(2**n-1, 0))

Fixed submission:
mod = 10**9+7
 
n = int(input())
a = [[int(x) for x in input().split()] for _ in range(n)]
 
dp = [-1 for __ in range(1 << n)]
dp[0] = 1
 
 
def dfs(bit, i):
    if dp[bit] != -1:
        return dp[bit]
    else:
        tmp = 0
        for j in range(n):
            if bit & (1 << j) and a[i][j]:
                tmp += dfs(bit ^ (1 << j), i+1)
    dp[bit] = tmp % mod
    return dp[bit]
 
 
print(dfs(2**n-1, 0))
Buggy python submission (verdict: Runtime Error):
a = input("enter : ")
b = list(a)
c = [];
for i in b:
    if(i != " "):
        c.append(i)
d = 0;
if int(c[2])-1>=int(c[0])+int(c[1]):
    d = int(c[0])+int(c[1])+int(c[1])+1
else:
    d = int(c[1])+int(c[2])

print(d)
    


Fixed submission:
x=input().split()
a=int(x[0])
b=int(x[1])
c=int(x[-1])
n=0
if b>=c:
    n+=b+c
    print(n)
else:
    n+=2*b
    c-=b
    if a>=c:
        n+=c
        print(n)
    else:
        n+=a+1  
        print(n)
Buggy python submission (verdict: Runtime Error):
def ctonum(c):
	alp = "qwertyuiopasdfghjklzxcvbnm"
	for i in range(len(alp)):
		if c == alp[i]:
			return i

countS=[0 for i in range(100)]
countT=[0 for i in range(100)]

S=input()
T=input()

for i in range(len(S)):
	countS[ctonum[S(i)]]+=1
	countT[ctonum[T(i)]]+=1
	
countS.sort()
countT.sort()

if countS==countT:
	print("Yes")
else:
	print("No")

Fixed submission:
str1= list(raw_input())
str2 = list(raw_input())
from collections import Counter
# import operator
resstr2 = Counter(str2)
resstr1 = Counter(str1)

# a = sorted(res.values())
res1 = Counter(resstr1.values())
res2 =  Counter(resstr2.values())
result = "Yes"
for k , i in res1.iteritems():
    if res2[k] != i:
        result = "No"
        break
print result

Buggy python submission (verdict: Runtime Error):
def ctonum(c):
	alp="qwertyuiopasdfghjklzxcvbnm"
	for i in range(len(alp)):
		if yay == alp[i]:
			return i

countS=[0 for i in range(100)]
countT=countS

S,T=input(),input()

for i in range(len(S)):
	countS[ctonum[S[i]]]+=1
	countT[ctonum[T[i]]]+=1
	
countS.sort()
countT.sort()

if countS==countT:
	print("Yes")
else:
	print("No")

Fixed submission:
str1= list(raw_input())
str2 = list(raw_input())
from collections import Counter
# import operator
resstr2 = Counter(str2)
resstr1 = Counter(str1)

# a = sorted(res.values())
res1 = Counter(resstr1.values())
res2 =  Counter(resstr2.values())
result = "Yes"
for k , i in res1.iteritems():
    if res2[k] != i:
        result = "No"
        break
print result

Buggy python submission (verdict: Runtime Error):
def ctonum(c):
	alp="qwertyuiopasdfghjklzxcvbnm"
	for i in len(alp):
		if yay == alp[i]:
			return i

countS=[0 for i in range(100)]
countT=countS

S,T=input(),input()

for i in range(len(S)):
	countS[ctonum[S[i]]]+=1
	countT[ctonum[T[i]]]+=1
	
countS.sort()
countT.sort()

if countS==countT:
	print("Yes")
else:
	print("No")

Fixed submission:
str1= list(raw_input())
str2 = list(raw_input())
from collections import Counter
# import operator
resstr2 = Counter(str2)
resstr1 = Counter(str1)

# a = sorted(res.values())
res1 = Counter(resstr1.values())
res2 =  Counter(resstr2.values())
result = "Yes"
for k , i in res1.iteritems():
    if res2[k] != i:
        result = "No"
        break
print result
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
for c in range(1, 4):
    if (a*b*c) % 2 != 0:
        print('Yes')
        exit()
print('No')

Fixed submission:
line = input()
num_a, num_b = [int(n) for n in line.split()]
value = "Yes"
if (num_a * num_b)%2 == 0:
    value = "No"
print(value)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
f = open('pokemon', 'r')
names = []
for line in f:
    names.append(line)
max_length = 0
pokemon = ''
for i in range(len(names)):
    p = [names[i]]
    start = names[i][-2]
    shiritori = True
    count = 1
    while shiritori == True:
        shiritori = False
        for j in range(len(names)):
            if i != j and names[j][0] == start and not names[j] in p:
                count += 1
                start = names[j][-2]
                shiritori = True
                p.append(names[j])
                if count > max_length:
                    max_length = count
                    pokemon = names[i]
                break
    print (p)
print (pokemon + str(max_length))

Fixed submission:
num=int(input())
list1=[]
flag=0
j=0

for i in range(num):

    a=input()



    if a in list1:
        flag+=1
    list1.append(a)
    if j>0:
        if list1[i-1][len(list1[i-1])-1]==list1[i][0]:
           pass

        else:
          flag+=2

    j=1

if flag>0:
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
import sys
n = int (input())
words = []
No=" "
for i in range (n) :
    words.append(input())
for x in range(len(words)):
    if words.count(words[x]) > 1 or words[x+1][0] != words[x][-1]:
        No="No"
        print (No)
        sys.exit() 
If No != "No":
     print ("Yes")

Fixed submission:
num=int(input())
list1=[]
flag=0
j=0

for i in range(num):

    a=input()



    if a in list1:
        flag+=1
    list1.append(a)
    if j>0:
        if list1[i-1][len(list1[i-1])-1]==list1[i][0]:
           pass

        else:
          flag+=2

    j=1

if flag>0:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
n=input (int()) 
x=0
if n%2==0:
    x=(n/2)**2
else:
    x=((n//2)+1)*(n//2)
print(x)

Fixed submission:
k=int(input())
if (k%2)==1 and k<=100:
    a=k//2
    b=k//2+1
elif (k%2)==0 and k<=100:
    a=k//2
    b=k//2
print(a*b)

Buggy python submission (verdict: Runtime Error):
team=input()
x=team[0]
flag=0
d=0
for i in range(Len(team)):
   if team[i]==x:
       flag+=1
   else:
        x=team[i]
        flag=0
   if flag==7:
       print("yes")
        d=1
       break
if d!=1:
    print("no")


Fixed submission:
k=int(input())
if (k%2)==1 and k<=100:
    a=k//2
    b=k//2+1
elif (k%2)==0 and k<=100:
    a=k//2
    b=k//2
print(a*b)

Buggy python submission (verdict: Runtime Error):
k=input()
pair=0
odd=0
even=0
for i in range(1,k+1) 
     if i%2==0:
        even+=1
     else:
            odd+=1
print(odd*even)



Fixed submission:
k=int(input())
if (k%2)==1 and k<=100:
    a=k//2
    b=k//2+1
elif (k%2)==0 and k<=100:
    a=k//2
    b=k//2
print(a*b)

Buggy python submission (verdict: Runtime Error):
K = map(int, input().split())
if K%2 ==0:
    print((K/2) ** 2)
else:
    print((K**2 - 1)/4)


Fixed submission:
k=int(input())
if (k%2)==1 and k<=100:
    a=k//2
    b=k//2+1
elif (k%2)==0 and k<=100:
    a=k//2
    b=k//2
print(a*b)

Buggy python submission (verdict: Runtime Error):
k = map(int, input())
if k%2 == 0:
    evens = k/2
    odds = k/2
    total = evens*odds
else:
    evens = (k-1)/2
    odds = k - evens
    total = evens*odds
print(total)


Fixed submission:
k=int(input())
if (k%2)==1 and k<=100:
    a=k//2
    b=k//2+1
elif (k%2)==0 and k<=100:
    a=k//2
    b=k//2
print(a*b)
Buggy python submission (verdict: Runtime Error):
value = input()
N,i = value.split()
N = int(N)
i = int(i)

print (N - i + 1)

Fixed submission:
N,i=map(int,input().split( ))
count=0

while N>=i:
    count+=1
    N-=1


print(count)

Buggy python submission (verdict: Runtime Error):
N,i=int(input ("enter the number of cars and car ))
X=N-i+1
Print(x)

Fixed submission:
N,i=map(int,input().split( ))
count=0

while N>=i:
    count+=1
    N-=1


print(count)

Buggy python submission (verdict: Runtime Error):
N,i=map(int,input().split())
if 1<=n<=100:
if 1<=i<=n:
print(N-i+1)
    


Fixed submission:
N,i=map(int,input().split( ))
count=0

while N>=i:
    count+=1
    N-=1


print(count)

Buggy python submission (verdict: Runtime Error):
N= int(input())
i= int(input())
j=0

j=N-i+1

print (j)
    


Fixed submission:
N,i=map(int,input().split( ))
count=0

while N>=i:
    count+=1
    N-=1


print(count)

Buggy python submission (verdict: Runtime Error):
N , i = map( int input( ) )
x = (N - i) + 1
print ( x )


Fixed submission:
N,i=map(int,input().split( ))
count=0

while N>=i:
    count+=1
    N-=1


print(count)

Buggy python submission (verdict: Runtime Error):
N , i = map( int input( ) )
x = N - i + 1
print ( x )


Fixed submission:
N,i=map(int,input().split( ))
count=0

while N>=i:
    count+=1
    N-=1


print(count)
Buggy python submission (verdict: Runtime Error):
n=int(input())
t=n
s=0

while t>n:
  a=t%10
  s=s+a
  t//=10
  
if n%s==0:
  print("Yes")
else:
  print("No")

Fixed submission:
n=int(input())
t=n
s=0

while t>0:
  a=t%10
  s=s+a
  t//=10
  
if n%s==0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n=int(raw_input())
maxv=n
for a in xrang(1,n+1):
  b=n-a
  if a>b: break
  sa=sum([int(x) for x in str(a)])
  sb=sum([int(x) for x in str(b)])
  maxv=min(maxv, sa+sb)
print(maxv)

Fixed submission:
n = input()

powers10 = [10**i for i in range(1, 6)]
print(10 if int(n) in powers10 else sum(int(d) for d in n))
Buggy python submission (verdict: Runtime Error):
maior=0
A = int(input())
B = int(input())
lista = [A+B, A-B, A*B]
for i in range(0,3):
    if lista[i]> maior:
        maior = lista[i]
print(maior)

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

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
if(a+b > a * b and a+b > a-b):
    print(a+b)
elif(a*b > a + b and a*b > a - b):
    print(a*b)
else:
    print(a-b)

Fixed submission:
a, b = map(int, input().split())
c = max([a +b, a-b, a*b])
print(c)
Buggy python submission (verdict: Runtime Error):
line = input()
a, b, c, k = [int(n) for n in line.split()]
numbers = [a, b, c]
numbers.sort(reverse=True)
numbers[0] *= 2 ** k
print(sum(numbers))


Fixed submission:
line = input()

a, b, c = [int(n) for n in line.split()]
k = int(input())

max_val = max(a, b, c)
max_val_mem = max_val

amax = False
bmax = False
cmax = False

for _ in range(k):
    max_val *= 2

if max_val_mem == a:
    amax = True
    print(str(max_val+ b+ c))
elif max_val_mem == b:
    bmax = True
    print(str(max_val+ a+ c))
elif max_val_mem == c:
    cmax = True
    print(str(max_val+ a+ b))

Buggy python submission (verdict: Runtime Error):
line = input()
A, B ,C , K = [int(u) for u in line.split()]
u=[A,B,C]
j = max(u)
u.remove(j)
u.append(j*2**K)
print(sum(u))

Fixed submission:
line = input()

a, b, c = [int(n) for n in line.split()]
k = int(input())

max_val = max(a, b, c)
max_val_mem = max_val

amax = False
bmax = False
cmax = False

for _ in range(k):
    max_val *= 2

if max_val_mem == a:
    amax = True
    print(str(max_val+ b+ c))
elif max_val_mem == b:
    bmax = True
    print(str(max_val+ a+ c))
elif max_val_mem == c:
    cmax = True
    print(str(max_val+ a+ b))

Buggy python submission (verdict: Runtime Error):
line = input()
A, B, K = [int(u) for u in line.split()]
u=[A,B,C]
j = max(u)
u.remove(j)
u.append(j*2**K)
print(sum(u))

Fixed submission:
line = input()

a, b, c = [int(n) for n in line.split()]
k = int(input())

max_val = max(a, b, c)
max_val_mem = max_val

amax = False
bmax = False
cmax = False

for _ in range(k):
    max_val *= 2

if max_val_mem == a:
    amax = True
    print(str(max_val+ b+ c))
elif max_val_mem == b:
    bmax = True
    print(str(max_val+ a+ c))
elif max_val_mem == c:
    cmax = True
    print(str(max_val+ a+ b))
Buggy python submission (verdict: Runtime Error):
a=int(input(''))
for i in range(1,pow(10,a)):
    b=int(i/100000)
    c=int(i/10000%10)
    d=int(i/1000%10)
    e=int(i/100%10)
    f=int(i/10%10)
    g=int(i%10)
    if((b**5+c**5+d**5+e**5+f**5+g**5)==i):
        print(i)

Fixed submission:
a,b=input().split()
a=int(a)
b=int(b)
c=0
for i in range(a,b+1):
    i=str(i)
    if i[0]==i[4] and i[1]==i[3]:
        c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
N=int(input())

for i in range(0,N):
    s1=input()
    s2='PWGY'
    c=0
    s1=set(s1)
    for j in s1:
        if j in s2:
            c+=1
    
    #o=['One','Two','Three','Four']
    #print(o[c-1])
    if c==1:
        print("One")
    elif c==2:
        print("Two")
    elif c==3:
        print("Three")
    else:
        print("Four")
    

Fixed submission:
n = int(input())
li = []
count =0

liste = [x for x in input().split()]
temp = []

for i in range(len(liste)):
    if liste[i] not in temp:
        temp.append(liste[i])

if len(temp)==3:
    print("Three")

else:
    print("Four")
Buggy python submission (verdict: Runtime Error):
x=int(input())
y=int(input())
z=int(input())
left=x-y
// Input
print(left%z)


Fixed submission:
total = int(input())
cake = int(input())
donut = int(input())
money = total - cake
while money >= donut:
    money = money - donut
print(money)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
 
 result= 0
 
for xx in range(a+1):
    A = 500*xx
    for y in range(b+1) :
        B = 100*y
        for z in range(c+1):
            C = 50*z
            if x == A+B+C:
                result += 1
            else:
                continue
 
 
print(result)

Fixed submission:
#!/usr/bin/env python3
from itertools import product
import sys
 
 
def solve(AA: int, BB: int, CC: int, XX: int):
    print(sum(
        1
        for a, b, c in product(range(AA + 1), range(BB + 1), range(CC + 1))
        if a * 500 + b * 100 + c * 50 == XX
    ))
 
 
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    solve(A, B, C, X)
 
 
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
 
ans = 0
 
for xx in range(a+1):
    A = 500*xx
    for y in range(b+1):
        B = 100*y
        for z in range(c+1):
            C = 50*z
            if x == A+B+C:
                ans += 01
            else:
                continue
 
 
print(ans)


Fixed submission:
#!/usr/bin/env python3
from itertools import product
import sys
 
 
def solve(AA: int, BB: int, CC: int, XX: int):
    print(sum(
        1
        for a, b, c in product(range(AA + 1), range(BB + 1), range(CC + 1))
        if a * 500 + b * 100 + c * 50 == XX
    ))
 
 
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    X = int(next(tokens))  # type: int
    solve(A, B, C, X)
 
 
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
    a, b = map(int, input().split())
    s = input()
     
    if s[a] == '-' and s[:a].isdigit() and s[a+1:].isdigit():
        print('Yes')
    else:
        print('No')

Fixed submission:
A, B =map(int, input().split())
S = input()
NUM = list(range(10))
X = 0
while X != A+B+1:
    if X == A:
        if S[X] != "-":
            print("No")
            quit()
        X += 1
    else:
        if S[X] == "-":
            print("No")
            quit()
        if int(S[X]) in NUM:
            X += 1
        else:
            print("No")
            quit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
X,Y = map(int,input())
ans = 0
while X <= Y:
	ans += 1
	X *= 2
print(ans)

Fixed submission:
X,Y = map(int,input().split())
ans = 0
while X <= Y:
	ans += 1
	X *= 2
print(ans)

Buggy python submission (verdict: Runtime Error):
X,Y = map(int,input().split())
ans = 0
while X <= Y:
	ans += 1
	X * = 2
print(ans)

Fixed submission:
X,Y = map(int,input().split())
ans = 0
while X <= Y:
	ans += 1
	X *= 2
print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
arr = []
out = {}

for i in range(n):
	arr.append(int(input()))
	
	if out.get(arr[-1], False):
		out[arr[-1]] += 1
	else:
		out[arr[-1]] = 1

count = 0
for key in out:
	if key > out[key]:
		count += out[key]
	else:
		count += out[key] - key

print(count)

Fixed submission:
from collections import Counter
a = int(input())
l = list(map(int, input().split()))
#i = 1

c=Counter(l)
d = dict(c)
kv = []
for k,v in d.items():
    if k>v:
        kv.append(v)
    elif k<v:
        t = v-k
        kv.append(t)
s = sum(kv)
print(s)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
a = int(input())
l = []
for i in range(0,a):
    b = int(input())
    l.append(b)
c=Counter(l)
d = dict(c)
kv = []
for k,v in d.items():
    if k>v:
        kv.append(v)
    elif k<v:
        t = v-k
        kv.append(t)
s = sum(kv)
print(s)




Fixed submission:
from collections import Counter
a = int(input())
l = list(map(int, input().split()))
#i = 1

c=Counter(l)
d = dict(c)
kv = []
for k,v in d.items():
    if k>v:
        kv.append(v)
    elif k<v:
        t = v-k
        kv.append(t)
s = sum(kv)
print(s)

Buggy python submission (verdict: Runtime Error):
from collections import Counter
a = int(input())
l = []
for i in range(0,a):
    b = int(input())
    l.append(b)
c=Counter(l)
d = dict(c)
kv = []
for k,v in d.items():
    if k>v:
        t = v
        kv.append(t)
    elif k<v:
        t = v-k
        kv.append(t)
    elif k==v:
       t= 0
       kv.append(t)        
s = sum(kv)
print(s)




Fixed submission:
from collections import Counter
a = int(input())
l = list(map(int, input().split()))
#i = 1

c=Counter(l)
d = dict(c)
kv = []
for k,v in d.items():
    if k>v:
        kv.append(v)
    elif k<v:
        t = v-k
        kv.append(t)
s = sum(kv)
print(s)
Buggy python submission (verdict: Runtime Error):
m = input().split()

a = m[0]

if a[::-1] == m[1]:
    print("YES")
else:
    print("NO")

Fixed submission:
rli,cli=list(input()),list(input())
if rli[0]==cli[2] and rli[1]==cli[1] and rli[2]==cli[0]:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
a=[]
a[1]=[]
a[2]=[]
for i in range (3):
	a[1].append(input())
for i in range (3):
	a[2].append(input())
for i in range (3):
	if a[1][i]!=a[2][2-i]:		
		print("NO")
 		break
 	else:
 		if i==2:
 			print("YES")
  		continue

  

Fixed submission:
rli,cli=list(input()),list(input())
if rli[0]==cli[2] and rli[1]==cli[1] and rli[2]==cli[0]:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
l=[list(map(int,input().split())) for i in range(3)]

sorted_l = [sorted(l[0]),sorted(l[1])]

from bisect import bisect_left

ans=0
for i in range(n):
    for j in range(n):
        if sorted_l[1][j]<l[2][i]:
            if sorted_l[1][j]<sorted_l[0][0]:
                continue
            elif sorted_l[1][j]>sorted_l[0][-1]:
                ans+=n
            else:
                ans+=(bisect_left(sorted_l[0],sorted_l[1][j]))
        else:
            break
print(ans)

Fixed submission:
from bisect import bisect_left as bl, bisect_right as br
n = input()
a = sorted([int(x) for x in raw_input().split()])
b = sorted([int(x) for x in raw_input().split()])
c = sorted([int(x) for x in raw_input().split()])
ans = 0
for bi in b:
	ans += (bl(a, bi) * (n - br(c, bi)))
print ans
Buggy python submission (verdict: Runtime Error):
#asfddddddd
n, m  = map(int, input().split())
print(m + m - n)

Fixed submission:
#asfddddddd
n = int(input())
m = int(input())
print(m + m - n)
Buggy python submission (verdict: Time Limit Exceeded):
num = int(input().strip())
nums = []
while num > 0:
    tmp = int(input().strip())
    if tmp in nums:
        nums.remove(tmp)
    else:
        nums.append(tmp)
    num -= 1
print(len(nums))

Fixed submission:
n = input()
d = {}
for x in xrange(n):
    temp = input()
    try:
        d[temp] = (d[temp] + 1) % 2
    except:
        d[temp] = 1
print sum(d.values())

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

a_list = [0 for x in range(1000000000)]

for i in range(N):
    a = input()
    a = int(a)
    a_list[a] = (a_list[a] + 1) % 2

print(a_list.count(1))

Fixed submission:
n = input()
d = {}
for x in xrange(n):
    temp = input()
    try:
        d[temp] = (d[temp] + 1) % 2
    except:
        d[temp] = 1
print sum(d.values())
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int, input().split)
n=int(input)
oneltr=min(4*a, 2*b, c, 2*a+b)
twoltr=min(8*a, 4*b, 2*c, d, c+2*b, c+b+2*a,c+4*a,4*a+2*b,b+6*a,3*b+2*a)

if(n%2==0) :
                   print(n//2*twoltr)
else :
                    print(oneltr+(n-1)//2*twoltr)


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

twoval=min(8*a,4*a+2*b,4*b,2*b+c,2*c,d)
oneval=min(4*a,2*b,2*a+b,c)

if n%2==0:
    print(twoval*(n//2))
else:
    print(oneval+twoval*((n-1)//2))