Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
class UnionFieldTree(object):
    def __init__(self, n):
        '''1-indexed'''
        self.parent = [i for i in range(n+1)] 
        self.size = [0] + [1] * n

    def merge(self, a, b):
        '''merge b into a'''
        a = self.root(a)
        b = self.root(b)
        self.parent[b] = self.parent[a]
        self.size[a] += self.size[b]

    def root(self, a):
        parent = self.parent[a]
        if parent == a:
            return a
        r = self.root(parent)
        self.parent[a] = r
        return r
    
    def same_group(self, a, b):
        return self.root(a) == self.root(b)


def main():
    N, M = map(int, input().split())
    AB = [map(int, input().split()) for _ in range(M)]
    
    uf = UnionFieldTree(N)

    v_sum = N*(N-1)//2
    ans = [v_sum]

    for a, b in reversed(AB):
        if not uf.same_group(a, b):
            ra = uf.root(a)
            rb = uf.root(b)
            v_sum -= uf.size[ra] * uf.size[rb]
            uf.merge(a, b)
        ans.append(v_sum)

    [print(a) for a in reversed(ans[:M])]


main()




Fixed submission:
import sys
sys.setrecursionlimit(1000000)

input = sys.stdin.readline

class UnionFieldTree(object):
    def __init__(self, n):
        '''1-indexed'''
        self.parent = [i for i in range(n+1)] 
        self.size = [0] + [1] * n

    def merge(self, a, b):
        '''merge b into a'''
        a = self.root(a)
        b = self.root(b)
        self.parent[b] = self.parent[a]
        self.size[a] += self.size[b]

    def root(self, a):
        parent = self.parent[a]
        if parent == a:
            return a
        r = self.root(parent)
        self.parent[a] = r
        return r
    
    def same_group(self, a, b):
        return self.root(a) == self.root(b)


def main():
    N, M = map(int, input().split())
    AB = [map(int, input().split()) for _ in range(M)]
    
    uf = UnionFieldTree(N)

    v_sum = N*(N-1)//2
    ans = [v_sum]

    for a, b in reversed(AB):
        if not uf.same_group(a, b):
            ra = uf.root(a)
            rb = uf.root(b)
            v_sum -= uf.size[ra] * uf.size[rb]
            uf.merge(a, b)
        ans.append(v_sum)

    [print(a) for a in reversed(ans[:M])]


main()
Buggy python submission (verdict: Runtime Error):
def main():
    n, k = map(int, input().split())
    sushi = [list(map(int, input().split())) for _ in range(n)]
    sushi = sorted(sushi, key=lambda x: x[1], reverse=True)

    first = set()
    second = []
    point = 0
    for s in sushi[:k]:
        if s[0] not in first:
            first.add(s[0])
        else:
            second.append(s)
        point += s[1]
    point += len(first) ** 2
    ans = point

    for s in sushi[k:]:
        if s[0] not in first:
            point = point + s[1] - second.pop()[1] + \
                (len(first) + 1) ** 2 - len(first) ** 2
            first.add(s[0])
            ans = max(ans, point)
    print(ans)


main()


Fixed submission:
def main():
    n, k = map(int, input().split())
    sushi = [list(map(int, input().split())) for _ in range(n)]
    sushi = sorted(sushi, key=lambda x: x[1], reverse=True)

    first = set()
    second = []
    point = 0
    for s in sushi[:k]:
        if s[0] not in first:
            first.add(s[0])
        else:
            second.append(s)
        point += s[1]
    point += len(first) ** 2
    ans = point

    for s in sushi[k:]:
        if len(second) == 0:
            break
        if s[0] not in first:
            point = point + s[1] - second.pop()[1] + \
                (len(first) + 1) ** 2 - len(first) ** 2
            first.add(s[0])
            ans = max(ans, point)
    print(ans)


main()
Buggy python submission (verdict: Time Limit Exceeded):
from operator import mul
from functools import reduce


def cmb(n, r):
    r = min(n-r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


def main():
    n, m = map(int, input().split())
    MOD = 10 ** 9 + 7

    m0 = m
    primes = {}
    p = 2
    # prime factorization
    while m0 > 1:
        if m0 % p == 0:
            m0 /= p
            if p in primes:
                primes[p] += 1
            else:
                primes[p] = 1
        else:
            p += 1

    ans = 1
    for _, v in primes.items():
        ans *= cmb(n - 1 + v, v)
        ans %= MOD
    print(ans)


main()


Fixed submission:
from operator import mul
from functools import reduce


def cmb(n, r):
    r = min(n-r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


def main():
    n, m = map(int, input().split())
    MOD = 10 ** 9 + 7

    m0 = m
    primes = {}
    p = 2
    rtm = int(m ** 0.5 + 1)
    # prime factorization
    while m0 > 1:
        if m0 % p == 0:
            m0 /= p
            if p in primes:
                primes[p] += 1
            else:
                primes[p] = 1
        else:
            p += 1
        # m is prime
        if rtm <= p:
            primes[1] = 1
            break

    ans = 1
    for _, v in primes.items():
        ans *= cmb(n - 1 + v, v)
        ans %= MOD
    print(ans)


main()

Buggy python submission (verdict: Time Limit Exceeded):
from scipy.misc import comb


def main():
    n, m = map(int, input().split())
    MOD = 10 ** 9 + 7

    m0 = m
    primes = {}
    p = 2
    # prime factorization
    while m0 > 1:
        if m0 % p == 0:
            m0 /= p
            if p in primes:
                primes[p] += 1
            else:
                primes[p] = 1
        else:
            p += 1

    ans = 1
    for _, v in primes.items():
        ans *= comb(n - 1 + v, v, exact=True)
        ans %= MOD
    print(ans)


main()


Fixed submission:
from operator import mul
from functools import reduce


def cmb(n, r):
    r = min(n-r, r)
    if r == 0:
        return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1, r + 1))
    return over // under


def main():
    n, m = map(int, input().split())
    MOD = 10 ** 9 + 7

    m0 = m
    primes = {}
    p = 2
    rtm = int(m ** 0.5 + 1)
    # prime factorization
    while m0 > 1:
        if m0 % p == 0:
            m0 /= p
            if p in primes:
                primes[p] += 1
            else:
                primes[p] = 1
        else:
            p += 1
        # m is prime
        if rtm <= p:
            primes[1] = 1
            break

    ans = 1
    for _, v in primes.items():
        ans *= cmb(n - 1 + v, v)
        ans %= MOD
    print(ans)


main()
Buggy python submission (verdict: Runtime Error):
import decimal,math
from collections import Counter,defaultdict
from fractions import gcd
from bisect import bisect_right,bisect_left
decimal.getcontext().prec = 10
N=int(raw_input())

arr=map(int,raw_input().split())
arr=sorted(arr)
# l = float(pow(2,N-1))
ans=(arr[0]+arr[1])/l
# print ans
for i in range(1,N):
	arr[i] = (arr[i]+arr[i-1])/2.0
	# print arr
print arr[-1]	


Fixed submission:
import decimal,math
from collections import Counter,defaultdict
from fractions import gcd
from bisect import bisect_right,bisect_left
decimal.getcontext().prec = 10
N=int(raw_input())

arr=map(int,raw_input().split())
arr=sorted(arr)
# l = float(pow(2,N-1))
# ans=(arr[0]+arr[1])/l
# print ans
for i in range(1,N):
	arr[i] = (arr[i]+arr[i-1])/2.0
	# print arr
print arr[-1]
Buggy python submission (verdict: Runtime Error):
import decimal,math
decimal.getcontext().prec = 100
def sum1(pre,l,r):
    l=max(l,0)
    if(l==0):
        return pre[r]
    return pre[r] - pre[l - 1]
abc=[]
def printDivisors(n) : 
    i = 1
    while i <= math.sqrt(n): 
          
        if (n % i == 0) : 
              
            if (n / i == i) : 
                abc.append(i) 
            else : 
                abc.append(i)
                abc.append(n/i)
        i = i + 1
n,k=map(int,raw_input().split())

arr=map(int,raw_input().split())
printDivisors(s)
abc.sort()
abc=abc[::-1]
ans=1
for i in abc:
    l=0
    flag=0
    c=[]
    for j in arr:
        c.append(j%i)
    c.sort()
    if(sum(c[:-sum(c)/i])<=k)
        print i
        exit()

Fixed submission:
import decimal,math
decimal.getcontext().prec = 100
def sum1(pre,l,r):
    l=max(l,0)
    if(l==0):
        return pre[r]
    return pre[r] - pre[l - 1]
abc=[]
def printDivisors(n) : 
    i = 1
    while i <= math.sqrt(n): 
          
        if (n % i == 0) : 
              
            if (n / i == i) : 
                abc.append(i) 
            else : 
                abc.append(i)
                abc.append(n/i)
        i = i + 1
n,k=map(int,raw_input().split())

arr=map(int,raw_input().split())
s=sum(arr)
printDivisors(s)
abc.sort()
abc=abc[::-1]
ans=1
for i in abc:
    l=0
    flag=0
    c=[]
    for j in arr:
        c.append(j%i)
    c.sort()
    if(sum(c[:-sum(c)/i])<=k):
        print i
        exit()
Buggy python submission (verdict: Time Limit Exceeded):
n,W=map(int,raw_input().split())
w=[]
val=[]
for i in range(n):
    p=map(int,raw_input().split())
    w.append(p[0])
    val.append(p[1])
dp = [0]*(W+1)
for i in range(n):
    for j in range(W,w[i]-1,-1):
        dp[j]=max(dp[j],dp[j-w[i]]+val[i])
print dp[-1]

Fixed submission:
n,W=map(int,raw_input().split())
w=[]
val=[]
for i in range(n):
    p=map(int,raw_input().split())
    w.append(p[0])
    val.append(p[1])
dp = [0]*(W+1)
for i in range(n):
    for j in range(W,w[i]-1,-1):
        dp[j]=max(dp[j],dp[j-w[i]]+val[i])
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
import decimal,math
from collections import Counter,defaultdict
from fractions import gcd
from bisect import bisect_right,bisect_left
decimal.getcontext().prec = 100


adj=[]
n,m = map(int,raw_input().split())
for i in range(n+1):
	adj.append([])
dp=[0]*(n+1)	
def dd(l):
	if(dp[l]!=-1):
		return dp[l]
	ma=dd(adj[l][0])
	for j in range(1,len(adj[l])):
		ma=max(ma,dd(adj[l][j]))
	dp[l]=ma+1
	return ma+1	
for i in range(m):
	x,y = map(int,raw_input().split())
	adj[y].append(x)
	dp[y]=-1
ans=[]
for i in range(1,n+1):
	ans.append(dd(i))
	# print i
print max(ans)	

Fixed submission:
import decimal,math
from collections import Counter,defaultdict
from fractions import gcd
from bisect import bisect_right,bisect_left
decimal.getcontext().prec = 100
import sys
sys.setrecursionlimit(1000000)

adj=[]
n,m = map(int,raw_input().split())
for i in range(n+1):
	adj.append([])
dp=[0]*(n+1)	
def dd(l):
	if(dp[l]!=-1):
		return dp[l]
	ma=dd(adj[l][0])
	for j in range(1,len(adj[l])):
		ma=max(ma,dd(adj[l][j]))
	dp[l]=ma+1
	return ma+1	
for i in range(m):
	x,y = map(int,raw_input().split())
	adj[y].append(x)
	dp[y]=-1
ans=[]
for i in range(1,n+1):
	ans.append(dd(i))
	# print i
print max(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import decimal,math
# from decimal import Decimal as co
from collections import Counter,defaultdict
from fractions import gcd
from bisect import bisect_right,bisect_left
decimal.getcontext().prec = 10
import sys
sys.setrecursionlimit(1000000)
co=decimal.Decimal
n=int(raw_input())
p = map(float,raw_input().split())
dp = [[co(0)]*(n+1) for i in range(n+1)]
dp[0][0]=co(1)
for i in range(1,n+1):
	for j in range(0,i+1):
		if(j==0):
			dp[i][j]=dp[i-1][j]*(1-co(p[i-1]))
		else:
			dp[i][j]=dp[i-1][j]*(1-co(p[i-1]))+dp[i-1][j-1]*co(p[i-1])
ans=co(0.0)
for j in range(n/2+1,n+1):
	ans=ans+dp[n][j]
print ans				
			


Fixed submission:
import decimal,math
# from decimal import Decimal as co
from collections import Counter,defaultdict
from fractions import gcd
from bisect import bisect_right,bisect_left
decimal.getcontext().prec = 10
import sys
sys.setrecursionlimit(1000000)
# co=decimal.Decimal
n=int(raw_input())
p = map(float,raw_input().split())
dp = [[(0.0)]*(n+1) for i in range(n+1)]
dp[0][0]=(1.0)
for i in range(1,n+1):
	for j in range(0,i+1):
		if(j==0):
			dp[i][j]=dp[i-1][j]*(1-(p[i-1]))
		else:
			dp[i][j]=dp[i-1][j]*(1-(p[i-1]))+dp[i-1][j-1]*(p[i-1])
ans=(0.0)
for j in range(n/2+1,n+1):
	ans=ans+dp[n][j]
print ans

Buggy python submission (verdict: Time Limit Exceeded):
import decimal,math
# from decimal import Decimal as co
from collections import Counter,defaultdict
from fractions import gcd
from bisect import bisect_right,bisect_left
decimal.getcontext().prec = 40
import sys
sys.setrecursionlimit(1000000)
co=decimal.Decimal
n=int(raw_input())
p = map(float,raw_input().split())
dp = [[co(0)]*(n+1) for i in range(n+1)]
dp[0][0]=co(1)
for i in range(1,n+1):
	for j in range(0,i+1):
		if(j==0):
			dp[i][j]=dp[i-1][j]*(1-co(p[i-1]))
		else:
			dp[i][j]=dp[i-1][j]*(1-co(p[i-1]))+dp[i-1][j-1]*co(p[i-1])
ans=co(0.0)
for j in range(n/2+1,n+1):
	ans=ans+dp[n][j]
print ans				
			


Fixed submission:
import decimal,math
# from decimal import Decimal as co
from collections import Counter,defaultdict
from fractions import gcd
from bisect import bisect_right,bisect_left
decimal.getcontext().prec = 10
import sys
sys.setrecursionlimit(1000000)
# co=decimal.Decimal
n=int(raw_input())
p = map(float,raw_input().split())
dp = [[(0.0)]*(n+1) for i in range(n+1)]
dp[0][0]=(1.0)
for i in range(1,n+1):
	for j in range(0,i+1):
		if(j==0):
			dp[i][j]=dp[i-1][j]*(1-(p[i-1]))
		else:
			dp[i][j]=dp[i-1][j]*(1-(p[i-1]))+dp[i-1][j-1]*(p[i-1])
ans=(0.0)
for j in range(n/2+1,n+1):
	ans=ans+dp[n][j]
print ans
Buggy python submission (verdict: Runtime Error):
K,X = map(int,input().split())
i = X - K + 1
lis = []
while i <= n + K - 1:
  lis.append(i)
  i += 1
print(lis)

Fixed submission:
K,X = map(int,input().split())
i = X - K + 1
lis = []
while i <= X + K - 1:
  lis.append(str(i))
  i += 1

s = ' '.join(lis)
print(s)
Buggy python submission (verdict: Runtime Error):
A,B,C = map(int,input().split())
print( C + B - A if c + B - A >= 0 else 0)

Fixed submission:
A,B,C = map(int,input().split())
print( C + B - A if C + B - A >= 0 else 0)
Buggy python submission (verdict: Runtime Error):
N = int(input())
li = list(map(int,input().split()))
out_count = 0
if li[0] > li[1] + 1:
  out_count += 1

for j in range(N - 1 , 0 , -1):
  if li[j] >= li[j - 1] + 2:
    out_count += 1
  elif li[j] == li[j - 1] + 1:
    li[j - 1] -= 1


if out_count == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
N = int(input())
li = list(map(int,input().split()))
out_count = 0

for j in range(N - 1 , 0 , -1):
  if li[j] <= li[j - 1] - 2:
    out_count += 1
  elif li[j] == li[j - 1] - 1:
    li[j - 1] -= 1
if out_count == 0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
li = list(map(int,input().split()))
out_count = 0


for j in range(N - 1 , 0 , -1):
  if li[j] >= li[j - 1] + 2:
    out_count += 1
  elif li[j] == li[j - 1] + 1:
    li[j - 1] -= 1

if li[0] > li[1] + 1:
  out_count += 1
    
if out_count == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
N = int(input())
li = list(map(int,input().split()))
out_count = 0

for j in range(N - 1 , 0 , -1):
  if li[j] <= li[j - 1] - 2:
    out_count += 1
  elif li[j] == li[j - 1] - 1:
    li[j - 1] -= 1
if out_count == 0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
li = list(map(int,input().split()))
out_count = 0


for j in range(N - 1 , 0 , -1):
  if li[j] >= li[j - 1] + 2:
    out_count += 1
  elif li[j] == li[j - 1] + 1:
    li[j - 1] -= 1

if li[0] > li[1]:
  out_count += 1
    
if out_count == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
N = int(input())
li = list(map(int,input().split()))
out_count = 0

for j in range(N - 1 , 0 , -1):
  if li[j] <= li[j - 1] - 2:
    out_count += 1
  elif li[j] == li[j - 1] - 1:
    li[j - 1] -= 1
if out_count == 0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
li = list(map(int,input().split()))
out_count = 0


for j in range(N - 1 , 0 , -1):
  if li[j] >= li[j - 1] + 2:
    out_count += 1
  elif li[j] == li[j - 1] + 1:
    li[j - 1] -= 1
if li[0] > li[1]:
  out_count += 1
    
if out_count == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
N = int(input())
li = list(map(int,input().split()))
out_count = 0

for j in range(N - 1 , 0 , -1):
  if li[j] <= li[j - 1] - 2:
    out_count += 1
  elif li[j] == li[j - 1] - 1:
    li[j - 1] -= 1
if out_count == 0:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
li = list(map(int,input().split()))
out_count = 0


for j in range(N - 1 , 0 , -1):
  if li[j] >= li[j - 1] + 2:
    out_count += 1
  elif li[j] == li[j - 1] + 1:
    li[j - 1] -= 1
if li[0] > li[1]:
  out_count += 1
    
if out_count == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
N = int(input())
li = list(map(int,input().split()))
out_count = 0

for j in range(N - 1 , 0 , -1):
  if li[j] <= li[j - 1] - 2:
    out_count += 1
  elif li[j] == li[j - 1] - 1:
    li[j - 1] -= 1
if out_count == 0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
import math
N,D =map(int,input().split())

x = D * 2 + 1

pre_answer = N / X
print(math.ceil(pre_answer))


Fixed submission:
import math
N,D =map(int,input().split())

X = D * 2 + 1

pre_answer = N / X
print(math.ceil(pre_answer))

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

x = D * 2 + 1

pre_answer = - (-N // X)
print(int(pre_answer))


Fixed submission:
import math
N,D =map(int,input().split())

X = D * 2 + 1

pre_answer = N / X
print(math.ceil(pre_answer))
Buggy python submission (verdict: Runtime Error):
N = int(input())
rest = []
for i in range(N):
  S,P = input().split()
  inrest = [ i + 1 , str(S) , int(P)]
  rest.append(inrest)

rest = sorted(rest , key = lambda x:x[2] , reverse = True)
rest = sorted(rest , key = lambda x:x[1])

for i in range(N):
  print(lest[i][0])

Fixed submission:
N = int(input())
rest = []
for i in range(N):
  S,P = input().split()
  inrest = [ i + 1 , str(S) , int(P)]
  rest.append(inrest)

rest = sorted(rest , key = lambda x:x[2] , reverse = True)
rest = sorted(rest , key = lambda x:x[1])

for i in range(N):
  print(rest[i][0])
Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
li[0] = A
li[1] = B
li[2] = T
ans = int(T / A) * B
print(ans)

Fixed submission:
li = list(map(int,input().split()))
A = li[0]
B = li[1]
T = li[2]
ans = int(T / A) * B
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))

cost = []

for i in range(N):
  X = V[i] - C[i]
  cost.append(X)
  
new_cost = sorted(cost , reverse = True)
print(new_cost[0] + new_cost[1])

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

cost = []

for i in range(N):
  X = V[i] - C[i]
  if X >= 0:
    cost.append(X)

print(sum(cost))
Buggy python submission (verdict: Runtime Error):
N = int(input())
hotel = list(map(int,input().split()))
new =[]

count = 0
for i in hotel:
  new.append(hotel(i))
  if hotel(i) == max(new):
    count += 1
print(count)

Fixed submission:
N = int(input())
hotel = list(map(int,input().split()))
new =[]

count = 0
for i in hotel:
  new.append(i)
  if i == max(new):
    count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
height = []
count = 0
for i in range(N):
  x = int(input())
  height.append(x)
  if x == max(height):
    count += 1

print(count)

Fixed submission:
N = int(input())
hotel = list(map(int,input().split()))
new =[]

count = 0
for i in hotel:
  new.append(i)
  if i == max(new):
    count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
height = []
count = 0
for i in range(N):
  x = int(input())
  height.append(x)
  if height[i] == max(height):
    count += 1

print(count)

Fixed submission:
N = int(input())
hotel = list(map(int,input().split()))
new =[]

count = 0
for i in hotel:
  new.append(i)
  if i == max(new):
    count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
N = int(input())
height = []
count = 0
for i in range(N):
  x = int(input())
  height.append(x)
  if max(height) == height[i]:
    count += 1

print(count)

Fixed submission:
N = int(input())
hotel = list(map(int,input().split()))
new =[]

count = 0
for i in hotel:
  new.append(i)
  if i == max(new):
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
a = li[0]
e = li[4]
k = li[5]

if e - a <= k:
    print("Yay!")
else:
    print(":(")

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

if e - a <= k:
    print("Yay!")
else:
    print(":(")

Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
a = li[0]
e = li[4]
k = li[5]

if e - a < k:
    print("Yay!")
else:
    print(":(")

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

if e - a <= k:
    print("Yay!")
else:
    print(":(")

Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
li[0] = a
li[4] = e
li[5] = k

if e - a < k:
    print("Yay!")
else:
    print(":(")

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

if e - a <= k:
    print("Yay!")
else:
    print(":(")

Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
li[0] = a
li[4] = e
li[5] = k

if e - a <= k:
    print("Yay!")
else:
    print(":(")

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

if e - a <= k:
    print("Yay!")
else:
    print(":(")

Buggy python submission (verdict: Runtime Error):
li = list(map(int,input().split()))
li[0] = a
li[4] = e
li[5] = k

if e - a <= 15:
    print("Yay!")
else:
    print(":(")

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

if e - a <= k:
    print("Yay!")
else:
    print(":(")
Buggy python submission (verdict: Runtime Error):
X,Y = map(int(input().split())
print(int(X + Y /2))

Fixed submission:
X,Y = map(int,input().split())
print(int(X + Y /2))

Buggy python submission (verdict: Runtime Error):
X,Y = int(input())
print(int(X + Y /2))

Fixed submission:
X,Y = map(int,input().split())
print(int(X + Y /2))
Buggy python submission (verdict: Runtime Error):
a = input()
count = 0
for i in range(len(a)):
  if a[i] = 'o':
    count += 1
print(700 + count * 100)

Fixed submission:
print( 700 + input().count('o') * 100)
Buggy python submission (verdict: Runtime Error):
N = int(input())
li = []
a = []
b = []
for i in range(N):
  li.append(int(input()))
li.sort(reverse = True)
for i in li[0::2]:
  a.append(i)
for i in li [1::2]:
  b.append(i)
print(sum(a) - sum(b))

Fixed submission:
N = int(input())
li = list(map(int,input().split()))
a = []
b = []

li.sort(reverse = True)
for i in li[0::2]:
  a.append(i)
for i in li [1::2]:
  b.append(i)
print(sum(a) - sum(b))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
c = a + b
print("Even" if c % 2 == 0 "Odd" else)

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

Buggy python submission (verdict: Runtime Error):
a,b = int(input().split())
c = a * b
if c % 2 == 1:
  print('Odd')
else:
  print('Even')

Fixed submission:
a,b = map(int,input().split())
c = a * b
if c % 2 == 1:
  print('Odd')
else:
  print('Even')
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
new_s = s.sort()
new_t = t.sort(reverse = True)
js = ''.join(new_s)
jt = ''.join(new_t)
if js > jt:
  print('Yes')
else:
  print('No')

Fixed submission:
s = list(input())
t = list(input())
s.sort()
t.sort(reverse = True)
js = ''.join(s)
jt = ''.join(t)
if js < jt:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
s = list(input())
t = list(input())
new_s = s.sort()
new_t = t.sort(reverse = True)
js = ''.join(new_s)
jt = ''.join(new_t)
if js > jt:
  print('Yes')
else:
  print('No')

Fixed submission:
s = list(input())
t = list(input())
s.sort()
t.sort(reverse = True)
js = ''.join(s)
jt = ''.join(t)
if js < jt:
  print('Yes')
else:
  print('No')