Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = [int(x) for x in input().split()]

nums = []
nums_2 = []
for i in range(N):
  num = int(A[i])
  s = 0
  k = 0
  for j in range(i+1,N):
    if A[j] < num:
      s += 1
  nums.append(s)
  for t in range(N):
    if A[t] < num:
      k += 1
  nums_2.append(k)

result = 0
for i in range(N):
  result += ((K*(K-1))/2)*(nums_2[i]) + K*nums[i]


print(int(result%(10e+8+7)))

Fixed submission:
month,day = map(int,input().split())

if day < 22:
  print(0)
else:
  s = 0
  for j in range(month+1):
    for i in range(22,day+1):
      num_1 = i%10
      num_2 = (i-num_1)/10
      if  num_1< 2:
        continue
      elif num_1 * num_2 == j:
        s += 1
  print(s)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = [int(x) for x in input().split()]

nums = []
nums_2 = []
for i in range(N):
  num = int(A[i])
  s = 0
  k = 0
  for j in range(i,N):
    if A[j] < num:
      s += 1
  nums.append(s)
  for t in range(N):
    if A[t] < num:
      k += 1
  nums_2.append(k)

result = 0
for i in range(N):
  result += ((K*(K-1))/2)*(nums_2[i]) + K*nums[i]


print(int(result%(N,K = map(int,input().split())
A = [int(x) for x in input().split()]

nums = []
nums_2 = []
for i in range(N):
  num = int(A[i])
  s = 0
  k = 0
  for j in range(i,N):
    if A[j] < num:
      s += 1
  nums.append(s)
  for t in range(N):
    if A[t] < num:
      k += 1
  nums_2.append(k)

result = 0
for i in range(N):
  result += ((K*(K-1))/2)*(nums_2[i]) + K*nums[i]

print(int(result/(10**9+7)))


Fixed submission:
month,day = map(int,input().split())

if day < 22:
  print(0)
else:
  s = 0
  for j in range(month+1):
    for i in range(22,day+1):
      num_1 = i%10
      num_2 = (i-num_1)/10
      if  num_1< 2:
        continue
      elif num_1 * num_2 == j:
        s += 1
  print(s)

Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = [int(x) for x in input().split()]

nums = []
nums_2 = []
for i in range(N):
  num = int(A[i])
  s = 0
  k = 0
  for j in range(i,N):
    if A[j] < num:
      s += 1
  nums.append(s)
  for t in range(N):
    if A[t] < num:
      k += 1
  nums_2.append(k)

result = 0
for i in range(N):
  result += ((K*(K-1))/2)*(nums_2[i]) + K*nums[i]


print(int(result%(10E9+7)))

Fixed submission:
month,day = map(int,input().split())

if day < 22:
  print(0)
else:
  s = 0
  for j in range(month+1):
    for i in range(22,day+1):
      num_1 = i%10
      num_2 = (i-num_1)/10
      if  num_1< 2:
        continue
      elif num_1 * num_2 == j:
        s += 1
  print(s)
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
A = [int(x) for x in input().split()]

nums = []
nums_2 = []
for i in range(N):
  num = int(A[i])
  s = 0
  k = 0
  for j in range(i,N):
    if A[j] < num:
      s += 1
  nums.append(s)
  for t in range(N):
    if A[t] < num:
      k += 1
  nums_2.append(k)

result = 0
for i in range(N):
  result += ((K*(K-1))/2)*(nums_2[i]) + K*nums[i]


print(int(result%(N,K = map(int,input().split())
A = [int(x) for x in input().split()]

nums = []
nums_2 = []
for i in range(N):
  num = int(A[i])
  s = 0
  k = 0
  for j in range(i,N):
    if A[j] < num:
      s += 1
  nums.append(s)
  for t in range(N):
    if A[t] < num:
      k += 1
  nums_2.append(k)

result = 0
for i in range(N):
  result += ((K*(K-1))/2)*(nums_2[i]) + K*nums[i]

print(int(result/(10**9+7)))


Fixed submission:
def solve():
    N, K, *a_l = map(int, open(0).read().split())
    MOD = 10**9+7
    count_a, count_b = 0, 0
    inversion = 0

    for i in range(N):
        for j in range(N):
            if a_l[i] > a_l[j]:
                if i < j:
                    count_a += 1
                count_b += 1

    inversion = count_a * K + count_b * (K * (K - 1)) // 2
    print(inversion%MOD)



if __name__ == '__main__':
    solve()
Buggy python submission (verdict: Time Limit Exceeded):
N,K = map(int,input().split())
h = [int(i) for i in input().split()]

def chmin(a,b):
    if a > b:
        return b
    else:
        return a

dp = [float("inf") for _ in range(N)]
dp[0] = 0

for i in range(N-1):
    for k in range(1,chmin(K+1,N-i)):
        dp[i+k] = chmin(dp[i+k],dp[i]+abs(h[i]-h[i+k]))

print(dp[N-1])

Fixed submission:
N,K = map(int,input().split())
h = [int(i) for i in input().split()]

def chmin(a,b):
    if a > b:
        return b
    else:
        return a

dp = [float("inf") for _ in range(N)]
dp[0] = 0

for i in range(N-1):
    for k in range(1,chmin(K+1,N-i)):
        dp[i+k] = chmin(dp[i+k],dp[i]+abs(h[i]-h[i+k]))

print(dp[N-1])
Buggy python submission (verdict: Runtime Error):
d, t, s = list(map(int, input()))
if (s * t >= d):
  print('Yes')
else:
  print('No')

Fixed submission:
d, t, s = list(map(int, input().split(' ')))
if (s * t >= d):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
d, t, s = list(map(int, input()))
if (s * t >= d):
  print('Yes')
else:
  print('No')

Fixed submission:
d, t, s = list(map(int, input().split(' ')))
if (s * t >= d):
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
d, t, s = list(map(int, input()))
print(s * t >= d)

Fixed submission:
d, t, s = list(map(int, input().split(' ')))
if (s * t >= d):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
import fractions

A, B = map(int, input().split())
g = fractions.gcd(A, B)

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            # print(i)
            flag = 1
            for j in range(2, int(math.sqrt(i))+1):
                if i%j == 0:
                    flag = 0
                    break
            if flag == 1:
                divisors.append(i)
            if i != n // i:
                flag = 1
                for j in range(2, int(math.sqrt(n // i))+1):
                    if (n // i) %j == 0:
                        flag = 0
                        break
                if flag == 1:
                    divisors.append(n//i)
    return divisors

print(len(make_divisors(g)))

Fixed submission:
import fractions

A, B = map(int, input().split())
g = fractions.gcd(A, B)

def make_divisors(n):
    count = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            # print(i)
            flag = 1
            for j in range(2, int(i**0.5)+1):
                if i%j == 0:
                    flag = 0
                    break
            if flag == 1:
                count += 1
            if i != n // i:
                flag = 1
                for j in range(2, int((n // i)**0.5)+1):
                    if (n // i) %j == 0:
                        flag = 0
                        break
                if flag == 1:
                    count += 1
    return count

print(make_divisors(g))

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

A, B = map(int, input().split())
g = math.gcd(A, B)

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

print(len(make_divisors(g))-1)

Fixed submission:
import fractions

A, B = map(int, input().split())
g = fractions.gcd(A, B)

def make_divisors(n):
    count = 0
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            # print(i)
            flag = 1
            for j in range(2, int(i**0.5)+1):
                if i%j == 0:
                    flag = 0
                    break
            if flag == 1:
                count += 1
            if i != n // i:
                flag = 1
                for j in range(2, int((n // i)**0.5)+1):
                    if (n // i) %j == 0:
                        flag = 0
                        break
                if flag == 1:
                    count += 1
    return count

print(make_divisors(g))
Buggy python submission (verdict: Runtime Error):
n = int(input())
 
for i in range(1,n):
  ans += (n-1)//i
print(ans)

Fixed submission:
n = int(input())
 
ans = 0
for i in range(1,n):
  ans += (n-1)//i
print(ans)

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

for i in range(1,n):
  ans += (n-1)//a
print(ans)

Fixed submission:
n = int(input())
 
ans = 0
for i in range(1,n):
  ans += (n-1)//i
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import collections

def prime_factorize(n):
	a = []
	while n % 2 == 0:
		a.append(2)
		n //= 2
	f = 3
	while f * f <= n:
		if n % f == 0:
			a.append(f)
			n //= f
		else:
			f += 2
	if n != 1:
		a.append(n)
	return a

n = int(input())
ans = 0

for j in range(1,n):
	c = collections.Counter(prime_factorize(j)) 
	cnt = 1
	for i in c.values():
		cnt = cnt * (i+1)
	ans = ans + cnt

print(ans)

Fixed submission:
n = int(input())
 
ans = 0
for i in range(1,n):
  ans += (n-1)//i
print(ans)
Buggy python submission (verdict: Runtime Error):
import random

s = input()

len_s = len(s)

num = random.randint(0,len_s-4)

name = s[num]+s[num+1]+s[num+2]

print(name)

Fixed submission:
import random

s = input()

len_s = len(s)

if len_s==3:
	num = 0
else:
	num = random.randint(0,len_s-4)

name = s[num]+s[num+1]+s[num+2]

print(name)
Buggy python submission (verdict: Runtime Error):
n=input()

c=0
flag=0
for i in range(n):
  a,b = map(int(),input().split())
  if(a==b):
    c+=1
  else:
    c=0
  if(c==3):
    print("Yes")
    flag=1
    break
if(flag==0):
  print("No")

Fixed submission:
n=int(input())

c=0
flag=0
for i in range(n):
  a,b = map(int,input().split())
  if(a==b):
    c+=1
  else:
    c=0
  if(c==3):
    print("Yes")
    flag=1
    break
if(flag==0):
  print("No")

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

c=0
flag=0
for i in range(n):
  a,b = map(int,input().split())
  if(a==b):
    c+=1
  else:
    c=0
  if(c==3):
    print("Yes")
    flag=1
    break
if(flag==0):
  print("No")

Fixed submission:
n=int(input())

c=0
flag=0
for i in range(n):
  a,b = map(int,input().split())
  if(a==b):
    c+=1
  else:
    c=0
  if(c==3):
    print("Yes")
    flag=1
    break
if(flag==0):
  print("No")
Buggy python submission (verdict: Runtime Error):
from sys import stdin
input = stdin.readline

X,K,D = map(int, input().split())
X=abs(X)
if(X>K*D):
  print(X-K*D)
elif(X>=D):
  m = X % D
  q = X//D
  K = K-q
  if(K==0):
    print(m)
  elif(m>abs(m-D) or K%2==1):
    print(abs(m-D))
  else:
    print(m)
else:
  if(K%2==1):
    print(abs(m-D))
  else:
    print(X)
  
    

Fixed submission:
from sys import stdin
input = stdin.readline

X,K,D = map(int, input().split())
X=abs(X)
if(X>K*D):
  print(X-K*D)
elif(X>=D):
  m = X % D
  q = X//D
  K = K-q
  if(K==0):
    print(m)
  elif(K%2==1):
    print(abs(m-D))
  else:
    print(m)
else:
  if(K%2==1):
    print(abs(X-D))
  else:
    print(X)
Buggy python submission (verdict: Time Limit Exceeded):
def func():
    a,b = (int(i) for i in input().split())
    if(a>b):
        a,b = b,a
    ans = 1
    
    if(a%2==0 and b%2==0):
        ans += 1
       
    for j in range(3,a+1,2):
        if(a%j==0 and b%j==0):
            a = a // j
            b = b // j
            ans += 1
            
    return ans


print(func())

Fixed submission:
import math
def func(num):
    lists = []
    root = math.floor(math.sqrt(num))
    
    while(num%2==0):
        num = num // 2
        if(num%2!=0):
            lists.append(2)
            
    for j in range(3,root+2,2):
        while(num%j==0):
            num = num //j
            if(num%j!=0):
                lists.append(j)
        if(num==1):
            break

    if(num>2):
        lists.append(num)
    return lists

if __name__ == "__main__":
    a,b = (int(i) for i in input().split())
    
    lists1 = func(a)
    lists2 = func(b)
    
    ans = set(lists1) & set(lists2)
    print(len(ans)+1)
Buggy python submission (verdict: Runtime Error):
import numpy as np

def set_list(es):
    return len(list(set(es))) == 1

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

if(len(a)==2):
    print((a[0]+a[1])/2)  
elif(len(a)!=2 and set_list(a)):
    print(a[0])
else:
  for i in range(1,n):
    idx = np.argmin(a)
    num1 = a.pop(idx)
    idx = np.argmin(a)
    num2 = a.pop(idx)
    a.append((num1+num2)/2)
	print(a[0])

Fixed submission:
import numpy as np

def set_list(es):
    return len(list(set(es))) == 1

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

if(len(a)==2):
    print((a[0]+a[1])/2)    
elif(len(a)!=2 and set_list(a)):
    print(a[0])
else:
    for i in range(1,n):
        idx = np.argmin(a)
        num1 = a.pop(idx)
        idx = np.argmin(a)
        num2 = a.pop(idx)
        a.append((num1+num2)/2)
    print(a[0])
Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
n = int(input())
s = [input() for i in range(n)]
tmp = [defaultdict(int) for i in range(n)]

for j in range(len(s)):
    for k in s[j]:
        tmp[j][k] += 1
        
ans = 0
for i in range(0,len(s)):
    for j in range(i+1,len(s)):
        if(tmp[i]==tmp[j]):
            ans += 1
print(ans)

Fixed submission:
from collections import defaultdict
dic = defaultdict(int)

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

ans = 0
for j in range(len(s)):
    mozi = sorted(s[j])
    mozi_s = "".join(mozi)
    ans += dic[mozi_s]
    dic[mozi_s] += 1
    
print(ans)

Buggy python submission (verdict: Runtime Error):
from collections import defaultdict
tmp = [defaultdict(int) for i in range(n)]
n = int(input())
s = [input() for i in range(n)]

for j in range(len(s)):
    for k in s[j]:
        tmp[j][k] += 1
        
ans = 0
for i in range(0,len(s)):
    for j in range(i+1,len(s)):
        if(tmp[i]==tmp[j]):
            print(s[i])
            print(s[j])
            ans += 1
print(ans)

Fixed submission:
from collections import defaultdict
dic = defaultdict(int)

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

ans = 0
for j in range(len(s)):
    mozi = sorted(s[j])
    mozi_s = "".join(mozi)
    ans += dic[mozi_s]
    dic[mozi_s] += 1
    
print(ans)
Buggy python submission (verdict: Runtime Error):
import heapq

n,m = (int(i) for i in input().split())
jobs = [[] for i in range(m)]
for i in range(n):
    tmp,tmp2 = (int(i) for i in input().split())
    if(tmp>m):
        continue
    jobs[m-tmp].append(tmp2)
    
ans = 0
h=[]
for i in range(m-1,-1,-1):
    for b in jobs[i]:
        heapq.heappush(h,b)
        heapq._heapify_max(h)
        
    if(len(h)!=0):
        ans += heapq._heappop_max(h)
        print(h)

print(ans)

Fixed submission:
import heapq

n,m = (int(i) for i in input().split())
jobs = [[] for i in range(m)]
for i in range(n):
    tmp,tmp2 = (int(i) for i in input().split())
    if(tmp>m):
        continue
    jobs[m-tmp].append(tmp2)
    
ans = 0
h=[]
for i in range(m-1,-1,-1):
    for b in jobs[i]:
        heapq.heappush(h,-b)
        
    if(len(h)!=0):
        a = -heapq.heappop(h)
        ans += a

print(ans)

Buggy python submission (verdict: Runtime Error):
n,m = (int(i) for i in input().split())
a=[]
b=[]
jobs = [[] for i in range(m)]
for i in range(n):
    tmp,tmp2 = (int(i) for i in input().split())
    if(tmp>m):
        continue
    a.append(tmp)
    b.append(tmp2)
    jobs[m-tmp].append(tmp2)
    
ans = 0
h=[]
for i in range(m-1,-1,-1):
    for b in jobs[i]:
        heapq.heappush(h,b)
        heapq._heapify_max(h)
        
    if(len(h)!=0):
        ans += heapq._heappop_max(h)

print(ans)

Fixed submission:
import heapq

n,m = (int(i) for i in input().split())
jobs = [[] for i in range(m)]
for i in range(n):
    tmp,tmp2 = (int(i) for i in input().split())
    if(tmp>m):
        continue
    jobs[m-tmp].append(tmp2)
    
ans = 0
h=[]
for i in range(m-1,-1,-1):
    for b in jobs[i]:
        heapq.heappush(h,-b)
        
    if(len(h)!=0):
        a = -heapq.heappop(h)
        ans += a

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = [int(i) for i in input().split()]

flag = 1
for i in range(len(h)-1):
    for j in range(i+1,len(h)):
        if(h[i]-h[j]>=2):
            print("No")
            flag=0
            break
    if(flag==0):
        break
            
if(flag==1):
    print("Yes")

Fixed submission:
a,b,c = (int(i) for i in input().split())

if(b+c-a>=0):
  print(b+c-a)
else:
  print(0)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = [int(i) for i in input().split()]

flag = 1
for i in range(len(h)-1):
    for j in range(i+1,len(h)):
        if(h[i]-h[j]>=2):
            print("No")
            flag=0
            break
    if(flag==0):
        break
            
if(flag==1):
    print("Yes")

Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]

flag = 1
temp = h[0]
for i in range(len(h)-1):
    if(temp<h[i]):
        temp = h[i]
    if(temp-h[i+1]>=2):
        print("No")
        flag=0
        break
            
if(flag==1):
    print("Yes")

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = [int(i) for i in input().split()]

flag = 1
while(flag==1):
    for i in range(len(h)-1):
        if(h[i+1]<h[i]):
            h[i] -= 1
            for j in range(i+1,len(h)):
                if(h[j]<h[i]):
                    print("No")
                    flag=0
                    break
        if(flag==0):
            break
            
    if(flag==1):
        print("Yes")
        break

Fixed submission:
n = int(input())
h = [int(i) for i in input().split()]

flag = 1
temp = h[0]
for i in range(len(h)-1):
    if(temp<h[i]):
        temp = h[i]
    if(temp-h[i+1]>=2):
        print("No")
        flag=0
        break
            
if(flag==1):
    print("Yes")
Buggy python submission (verdict: Runtime Error):
ans = 0
for i in range(n):
    for j in range(i,i+2):
        tmp = b[i]
        b[i] -= a[j]        
        if b[i]<=0:
            ans += tmp
            a[j] -= tmp
            break
        else:
            ans += a[j]
            a[j] = 0
            
print(ans)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
b = [int(i) for i in input().split()]
ans = 0
for i in range(n):
    for j in range(i,i+2):
        tmp = b[i]
        b[i] -= a[j]        
        if b[i]<=0:
            ans += tmp
            a[j] -= tmp
            break
        else:
            ans += a[j]
            a[j] = 0
            
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np 
n = int(input())
a = [int(input()) for i in range(n)]
aa = np.array(a)

for i in range(n):
    tmp = np.delete(aa,i)
    print(max(tmp))

Fixed submission:
import numpy as np 
n = int(input())
a = [int(input()) for i in range(n)]
aa = np.array(a)
maxa = max(aa)
argmax = np.argmax(aa)

for i in range(n):
    if i == argmax:
        tmp = np.delete(aa,i)
        print(max(tmp))
    else:
        print(maxa)
Buggy python submission (verdict: Time Limit Exceeded):
l = input()
a = l[0]
b = l[1]
c = l[2]
d = l[3]


while(True):
    if(a==b and b==c and c==d):
        print("No")
        break
    if(a==b and c==d):
        print("Yes")
        break
    if(a==c and b==d):
        print("Yes")
        break
    if(a==d and c==b):
        print("Yes")
        break
    print("No")

Fixed submission:
l = input()
a = l[0]
b = l[1]
c = l[2]
d = l[3]


while(True):
    if(a==b and b==c and c==d):
        print("No")
        break
    if(a==b and c==d):
        print("Yes")
        break
    if(a==c and b==d):
        print("Yes")
        break
    if(a==d and c==b):
        print("Yes")
        break
    else:
      print("No")
      break
Buggy python submission (verdict: Runtime Error):
i = input()

for j in range(i-1):
  if(j==j+1):
    print("Bad")
    break
  else(j==(len(i)-2)):
    print("Good")

Fixed submission:
i = input()
k=1
for j in range(len(i)-1):
  if(i[j]==i[j+1]):
    print("Bad")
    k=0
    break
    
if(k==1):
  print("Good")
Buggy python submission (verdict: Runtime Error):
t = input()
s = input()
s = s.split()
list=[]
for i in range(len(s)):
  list.append(int(s[i]))

kind = 1
counter=0

for i in range(len(list)-1):
  if(list[i]>=list[i+1]):
    if(kind==1):
      kind = kind + 1
    else:
      if(counter==kind-1):
        kind = kind + 1
        counter=0    
      else:
        counter = counter + 1
      
print(kind)
    

Fixed submission:
s = input()
list = list(s)
count=0
b=0

for i in range(len(list)):
  if(list[i] == "W"):
    count+=b
    continue
  else:
    if(i == len(list)-1):
      break
    b += 1
      
print(count)

Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
list=[]
list = t.split()
print(list)
ans=0

def even(i,k):
  for j in range(k+1,len(list)):
    if(int(list[j])%2==0):
      s = i + int(list[j])
      if(power(s)):
        return 1
    else:
      continue
      
  return 0
  
def odd(i,k):
  for j in range(k+1,len(list)):
    if(int(list[j])%2==0):
      continue
    else:
      s = i + int(list[j])
      if(power(s)):
        return 1
      
  return 0
      

def power(s):
  while(True):
    s = int(s / 2)
    if(s==1):
       return 1

    if(s % 2 != 0):
      break      
      return 0

for i in range(len(list)-1):
  if(int(list[i]) % 2 == 0):
    if(even(int(list[i]),i)):
      ans = ans+1
  else:
    if(odd(int(list[i]),i)):
      ans = ans+1

print(ans)

Fixed submission:
s = input()
list = list(s)
count=0
b=0

for i in range(len(list)):
  if(list[i] == "W"):
    count+=b
    continue
  else:
    if(i == len(list)-1):
      break
    b += 1
      
print(count)

Buggy python submission (verdict: Runtime Error):
s=input()
t=input()
list=[]
list = t.split()
print(list)
ans=0

def even(i,k):
  for j in range(k+1,len(list)):
    if(int(list[j])%2==0):
      s = i + int(list[j])
      if(power(s)):
        return 1
    else:
      continue
      
  return 0
  
def odd(i,k):
  for j in range(k+1,len(list)):
    if(int(list[j])%2==0):
      continue
    else:
      s = i + int(list[j])
      if(power(s)):
        return 1
      
  return 0
      

def power(s):
  while(True):
    s = int(s / 2)
    if(s==1):
       return 1

    if(s % 2 != 0):
      break      
      return 0

for i in range(len(list)-1):
  if(int(list[i]) % 2 == 0):
    if(even(int(list[i]),i)):
      ans = ans+1
  else:
    if(odd(int(list[i]),i)):
      ans = ans+1

print(ans)

Fixed submission:
s = input()
list = list(s)
count=0
b=0

for i in range(len(list)):
  if(list[i] == "W"):
    count+=b
    continue
  else:
    if(i == len(list)-1):
      break
    b += 1
      
print(count)

Buggy python submission (verdict: Runtime Error):
list = list(s)
count=0
b=0

for i in range(len(list)):
  if(list[i] == "W"):
    count+=b
    continue
  else:
    if(i == len(list)-1):
      break
    b += 1
      
print(count)

Fixed submission:
s = input()
list = list(s)
count=0
b=0

for i in range(len(list)):
  if(list[i] == "W"):
    count+=b
    continue
  else:
    if(i == len(list)-1):
      break
    b += 1
      
print(count)
Buggy python submission (verdict: Runtime Error):
import sys
n=input()
list = n.split(" ")
n=int(list[0])
k=int(list[1])

trees = []
for i in range(n):
  trees.append(int(input()))

def merge_sort(alist):
  if len(alist) <= 1:
    return alist
  
  mid = int(len(alist)/2)
  left = alist[:mid]
  right = alist[mid:]
  
  left = merge_sort(left)
  right = merge_sort(right)
  
  return merge(left, right)

def merge(left,right):
  sorted_list = []
  left_index = 0
  right_index = 0
  
  while left_index < len(left) and right_index < len(right):
    if left[left_index] >= right[right_index]:
      sorted_list.append(left[left_index])
      left_index += 1
    else:
      sorted_list.append(right[right_index])
      right_index += 1
      
  if left:
    sorted_list.extend(left[left_index:])
    
  if right:
    sorted_list.extend(right[right_index:])
    
    return sorted_list

trees = merge_sort(trees)

ans=sys.maxsize
flag=0
temp = []

for i in range(len(trees)-k+1):
  diff = trees[i]-trees[i+k-1]
  if(diff==0):
    ans=0
    break
  if(ans>diff):
    ans=diff
  temp.clear()

print(ans)

Fixed submission:
Date = int(input())

if Date==25:
  print("Christmas")
elif Date==24:
  print("Christmas Eve")
elif Date==23:
  print("Christmas Eve Eve")
elif Date==22:
  print("Christmas Eve Eve Eve")