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

Fixed submission:
X, Y, Z = map(int, input().split())

"""
temp = Y
Y = X
X = temp

temp = Z
Z = X
X = temp
"""

print(Z, X, Y)

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
sum_A =0
for i in range(N):
    sum_A += A[i]

ans = 0
for i in range(N):
    if (4*M*A[i] < sum_A):
        ans+=1
    else:
    	ans+=0
    	
if (ans >= M):
    print('Yes')
else:
    print('No')
Problem p02718 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
sum_A =0
for i in range(N):
    sum_A += A[i]

ans = 0
for i in range(N):
    if (4*M*A[i] >= sum_A):
        ans+=1
    else:
    	ans+=0
    	
if (ans >= M):
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
    N, M = map(int, input().split())
    A = list(map(int, input().split()))
     
    sum_A =0
    for i in range(N):
        sum_A += A[i]
     
    ans = 1
    for i in range(M):
        if (4*M*A[i] > sum_A):
            ans= ans*1
        else:
        	ans =ans*0
     
    if (ans == 1):
        print('Yes')
    else:
        print('No')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
sum_A =0
for i in range(N):
    sum_A += A[i]

for i in range(N):
    if (4*M*A[M] < sum_A):
        print('No')
    else:
        print('Yes')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
sum_A =0
for i in range(N):
    sum_A += A[i]
 
if (4*M*A[M] < sum_A):
    print('No')
else:
    print('Yes')

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

sum_A =0
for i in range(N):
    sum_A += A[i]

if (4*M*A[M] < sum_A):
    print('No')
else:
    print('Yes')

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = [0 for i in range(N)]

sum_A =0
for i in range(N):
    sum_A += A[i]

if (4*M*A[M] < sum_A):
    print('No')
else:
    print('Yes')
Problem p03126 (python)

Fixed submission:
N,M = map(int, input().split())
el = {}
for i in range(N):
    P = list(map(int, input().split()))
    K = P.pop(0)
    if i == 0: el = set(P)
    el = el & set(P)
print(len(el))

Buggy submission (verdict: Runtime Error):
N,M = map(int, input().split())
el = {}
for i in range(N):
    P = list(map(int, input().split())).pop(0)
    if i == 0: el = set(P)
    el = el & set(P)
print(len(el))
Problem p02640 (python)

Fixed submission:
X, Y = map(int, input().split()) 
ans = 'No'
for a in range(X + 1):
	b=X-a
	if 2 * a + 4 * b == Y:
		ans = 'Yes' 
print(ans)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split()) 
ans = 'No'
for a in range(X + 1):
	b=X-a
	if 2 * a + 4 * b == Y:
		ans = 'Yes' print(ans)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split()) ans = 'No'
for a in range(X + 1):
	b=X-a
	if 2 * a + 4 * b == Y:
ans = 'Yes' print(ans)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split()) ans = 'No'
for a in range(X + 1):
b=X-a
if 2 * a + 4 * b == Y:
ans = 'Yes' print(ans)

Buggy submission (verdict: Runtime Error):
A=list(map(int,input().split()))
a=[]
for n in range(0,a[0]+1):
    m=A[0]-n
    if 2*n+4*m=A[1]:
      a.append(1)
    
if 1 in a:
  print('yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A=list(map(int,input().split()))
a=[]
for n in range(0,101):
  for m in range(0,101):
    if n+m=A[0] & 2*n+4*m=A[1]:
      a.append(1)
    else:
      a.append(0)
      
if 1 in a:
  print('yes')
else:
  print('No')
Problem p03369 (python)

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

Buggy submission (verdict: Runtime Error):
S = input()
print(700 + int(S.count() * 100))

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

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

Buggy submission (verdict: Runtime Error):
import pandas as pd
a, b = map(int, input().split() )
c = a * b
if c % 2 == 0:
  print('Even')
else:
  print('Odd')
Problem p03636 (python)

Fixed submission:
s = input()
N = len(s)
print(s[0] + str(N - 2) + s[N - 1])

Buggy submission (verdict: Runtime Error):
s = input()
N = len(s)
print(s[0] + len(N - 2) + s[N - 1])
Problem p02687 (python)

Fixed submission:
S = input()

if S == "ABC":
    print("ARC")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
if S == "ABC":
    print("ARC")
else:
    print("ABC")

Buggy submission (verdict: Runtime Error):
if S == "ABC":
    print("ARC")
else S == "ARC":
    print("ABC")

Buggy submission (verdict: Runtime Error):
#OutPut
if S == "ABC":
    print("ARC")
else S == "ARC":
    print("ABC")
Problem p03434 (python)

Fixed submission:
n = int(input())
x = sorted([int(i) for i in input().split(" ")],reverse=True)
print(sum(x[::2]) - sum(x[1::2]))

Buggy submission (verdict: Runtime Error):
n = int(raw_input())
x = sorted([int(i) for i in raw_input().split(" ")],reverse=True)
print(sum(x[::2]) - sum(x[1::2]))
Problem p02639 (python)

Fixed submission:
x = list(map(int, input().split()))
if x[0] == 0:
    print(1)
elif x[1] == 0:
    print(2)
elif x[2] == 0:
    print(3)
elif x[3] == 0:
    print(4)
else:
    print(5)

Buggy submission (verdict: Runtime Error):
x = list(map(int, input().split))
for i in x:
    if i == 0:
        print(i)
Problem p02640 (python)

Fixed submission:
X, Y = map(int, input().split())
ans = 'No'
for a in range(X + 1):
	b = X - a
	if 2 * a + 4 * b == Y:
		ans = 'Yes'
print(ans)

Buggy submission (verdict: Runtime Error):
X, Y = map(int, input().split())
ans = 'No'
for a in range(X + 1):
	b = X - a
	if 2 * a + 4 * b == Y:
		ans = 'Yes'
7 print(ans)
Problem p02639 (python)

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

if arr[0]==0:
  print(1)
elif arr[1]==0:
  print(2)
elif arr[2]==0:
  print(3)
elif arr[3]==0:
  print(4)
else:
  print(5)

Buggy submission (verdict: Runtime Error):
arr = [int(x) for x in input()]
c=1
for i in arr:
 if i==0:
  print(c)
 else:
  c+=1

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

for i,j in enumerate(len(arr)):
    if j==0:
        print(i)
Problem p02641 (python)

Fixed submission:
x,n = list(map(int,input().split()))
p= list(map(int,input().split()))
 
for i in range(x+1):
 for s in [-1,+1]:
   a=x+s*i
   if a not in p:
     print(a)
     exit(0)

Buggy submission (verdict: Runtime Error):
x,n = list(map(int,input().split()))
p= list(map(int,input().split()))
 
for i in range(x+1):
 for s in [-1,+1]:
   a=x+s*d
   if a not in p:
     print(a)

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

for i in range(x+1):
 for s in [-1,+1]:
   a=X+s*d
   if a not in p:
     print(a)
Problem p03448 (python)

Fixed submission:
A,B,C,X = [int(input()) for i in range(4)]
count = 0

for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      x = 500*a + 100*b + 50*c
      if X == x:
        count += 1
 
print(count)

Buggy submission (verdict: Runtime Error):
A,B,C,X = [int(input() for i in range(4))]
count = 0

for a in range(A+1):
  for b in range(B+1):
    for c in range(C+1):
      x = 500*a + 100*b + 50*c
      if X == x:
        count += 1
 
print(count)

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
C = input()
X = input()
count = 0

for a in range(0,A):
  for b in range(0,B):
    for c in range(0,C):
      x = 500*a + 200*b + 50*c
      if X == x:
        count += 1
print(count)
Problem p03455 (python)

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

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

Fixed submission:
N = int(input())
e = set()
for i in range(N):
  e.add(int(input()))

print(len(e))

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

ans = 1
e = sorted(d,reverse = True)
for i in range(0,N):
	if i != 0:
		if e[i]<e[i-1]:
			ans += 1

print(ans)
Problem p03478 (python)

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

for n in range(1,N+1):
  d = str(n)
  x = list(map(int, d))
  y = sum(x)
  
  if A <= y <= B:
    count += n

print(count)

Buggy submission (verdict: Runtime Error):
N, A, B = [int(input()) for i in range(3)]
count = 0

for n in range(1,N+1):
  d = str(n)
  x = list(map(int, d))
  y = sum(x)
  
  if A <= y <= B:
    count += n

print(count)

Buggy submission (verdict: Runtime Error):
N, A, B = [int(input()) for i in range(3)]
count = 0

for n in range(1,N+1):
  d = str(n)
  x = list(map(int, d))
  y = sum(x)
  
  if A <= y <= B:
    count += n

print(count)

Buggy submission (verdict: Runtime Error):
N, A, B = [int(input()) for i in range(3)]
count = 0

for n in range(1,N+1):
  d = str(n)
  x = list(map(int, d))
  y = sum(x)
  
  if A <= y <= B:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N, A, B = [int(input()) for i in range(3)]
count = 0

for n in range(1:N+1):
  d = str(n)
  x = list(map(int, d))
  y = sum(x)
  
  if A <= y <= B:
    count += 1

print(count)
Problem p03494 (python)

Fixed submission:
n = input()
s = list(map(int, input().split()))
ans = 0

while all(a%2==0 for a in s):
  ans +=1
  s = [a/2 for a in s]

print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
s = list(map(int, input.split()))
ans = 0

while all(a%2==0 for a in s):
  ans +=1
  s = [a/2 for a in s]

print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
s = list(map(int, input.split()))
ans = 0

while all(a%2==0 for a in s):
  ans +=1
  for a in s:
    s = a/2

print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
s = list(map(int, input.split()))
ans = 0

while all(a%2==0, for a in s):
  ans +=1
  for a in s:
    s = a/2

print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
s = list(map(int, input.split()))
ans = 0

while all(a%2==0, for a in s):
  ans +=1
  for a in s:
    s = s/2

print(ans)

Buggy submission (verdict: Runtime Error):
n = input()
s = list(map(int, input.split()))
ans = 0

while all(a%2==0, for a in s):
  ans +=1
  
  for a in s:
    a = a/2

print(ans)

Buggy submission (verdict: Runtime Error):
n = imput()
s = list(map(int, inpit.split()))
ans = 0

while all(a%2==0, for a in s):
  ans +=1
  
  for a in s:
    a = a/2

print(ans)
Problem p02657 (python)

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

Buggy submission (verdict: Runtime Error):
a, b=map(input.split())
print(a*b)
Problem p03139 (python)

Fixed submission:
import bisect
import sys

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    N, a, b = il()
    return "{} {}".format(min(a, b), max(0, a - (N - b)))


if __name__ == "__main__":
    print(solve())

Buggy submission (verdict: Runtime Error):
import sys

import numpy as np

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


def solve():
    N = ii()
    AB = iml(N)
    ll = []
    for a, b in AB:
        ll.append(a + b)
    ind = np.argsort(ll)
    t = [AB[i][0] for i in ind[::2]]
    a = [AB[i][1] for i in ind[1::2]]
    return sum(t) - sum(a)


if __name__ == "__main__":
    print(solve())
Problem p03605 (python)

Fixed submission:
#-*- coding: utf-8 -*-
print(['No', 'Yes']['9' in input()])

Buggy submission (verdict: Runtime Error):
#-*- coding: utf-8 -*-
print(['No', 'Yes'][input().count('9')])
Problem p02641 (python)

Fixed submission:
def serch_1(b,x):
    i=1
    an=0
    while 1:
        if b.count(x+i)==0:
            an=x+i
            break
        else:
            i=i+1
    return an

def serch_2(b,x):
    i=1
    an=0
    while 1:
	    if b.count(x-i)==0:
		    an=x-i
		    break
	    else:
		    i=i+1
    return an
def hikaku(a,b,x):
    if abs(a-x)>=abs(b-x):
    	return b
    else:
        return a
s = list(map(int,input().split()))
# n = int(input())
a = list(map(int,input().split()))
# print(serch_1(a,x),serch_2(a,x))
x=s[0]
n=s[1]
if a.count(x)==0:
	print(x)
else:
	print(hikaku(serch_1(a,x),serch_2(a,x),x))

Buggy submission (verdict: Runtime Error):
def serch_1(b,x):
    i=1
    an=0
    while 1:
        if b.count(x+i)==0:
            an=x+i
            break
        else:
            i=i+1
    return an

def serch_2(b,x):
    i=1
    an=0
    while 1:
	    if b.count(x-i)==0:
		    an=x-i
		    break
	    else:
		    i=i+1
    return an
def hikaku(a,b,x):
    if abs(a-x)>=abs(b-x):
    	return b
    else:
        return a
x = int(input())
n = int(input())
a = list(map(int,input().split()))
print(serch_1(a,x),serch_2(a,x))
if a.count(x)==0:
	print(x)
else:
	print(hikaku(serch_1(a,x),serch_2(a,x),x))
Problem p02783 (python)

Fixed submission:
H, A = map(int, input().split(" "))

print(-(-H//A))

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

H.sorted(reverse=True)

if K >= N:
    print(0)
else:
    for i in range(K):
        del H[i]
    print(sum(H))
Problem p02817 (python)

Fixed submission:
S,T=input().split(" ")
print(T+S)

Buggy submission (verdict: Runtime Error):
S,T = input().split()
ptint(T+S)
Problem p03760 (python)

Fixed submission:
O = list(input())
E = list(input())

ans = []
for i in range(len(O)):
    ans.append(O[i])
    if len(E) > i:
        ans.append(E[i])
    else:
        break
print("".join(ans))

Buggy submission (verdict: Runtime Error):
O = list(input().split(" "))
E = list(input().split(" "))

ans = []
for i in range(O.len):
  ans.append(O[i])
  ans.append(E[i])

print("".join(ans))
Problem p02705 (python)

Fixed submission:
from math import acos
a=int(input())
k=2*a*2*acos(0.0)
print(k)

Buggy submission (verdict: Runtime Error):
a=int(input())
k=2*r*3.14
Problem p02706 (python)

Fixed submission:
n,m= map(int,input().split())
a=list(map(int, input().split()))
sum=0
for i in range(len(a)):
  sum+=a[i]
if sum>n: 
  print("-1")
else:
  print(n-sum)

Buggy submission (verdict: Runtime Error):
n,m= map(int,input().split())
a=list(map(int, intput().split()))
sum=0
for _ in range(len(a)):
  sum+=a[i]
if sum>n: 
  print("-1")
else:
  print(n-sum)
Problem p02716 (python)

Fixed submission:
import math
n=int(input())
a=list(map(int, input().split()))
dp=[0]*n
dp[0]=0
dp[1]=max(a[0],a[1])
curr=a[0]
for i in range(2,n):
  if i&1==1:
    curr+=a[i-1]
    dp[i]=max(curr,dp[i-2]+a[i])
  else: dp[i]=max(dp[i-2]+a[i],dp[i-1])
print(dp[n-1])

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
a=list(map(int, input().split()))
dp=[0]*n
dp[0]=0
dp[1]=math.max(a[0],a[1])
curr=a[0]
for i in range(2,n):
  if i&1==1:
    curr+=a[i-1]
    dp[i]=math.max(curr,dp[i-2]+a[i])
  else dp[i]=math.max(dp[i-2]+a[i],dp[i-1])
print(dp[n-1])
Problem p02717 (python)

Fixed submission:
a,b,c=map(int,input().split())
t=a
a=b
b=t
t=a
a=c
c=t
print(a,end=" ")
print(b,end=" ")
print(c)

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
n=n-(n//k)*k
print(min(n,k-n))
Problem p02741 (python)

Fixed submission:
a=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
n=int(input())
print(a[n-1])

Buggy submission (verdict: Runtime Error):
h,w=map(int,input().split())
print(-(-h*w//2) if h*w>=h+w else 1)
Problem p02742 (python)

Fixed submission:
import math
H,W = map(int, input().split())

if H == 1 or W == 1:
    print(1)
elif H * W % 2 == 0:
    print( math.floor((H * W) /2 ))
else:
    print(math.floor((H * W) / 2) + 1)

Buggy submission (verdict: Runtime Error):
import math
a,b=map(int,input().split())
if a==1|| b==1:
  k=1
elif:
	k=math.ceil((a*b)/2)
print(k)
Problem p02743 (python)

Fixed submission:
from math import sqrt
a,b,c=map(int,input().split())
k=c-a-b
if k>0 and k*k> 4*a*b:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
from math import sqrt
a,b,c=map(int,input().split())
k=c-a-b
if k>0 and k*k> 4*a*b:
  print("Yes")
else print("No")
Problem p04047 (python)

Fixed submission:
def pair(n,count):
    l=[];su=0
    for i in range(0,len(n),2):
        sub=list()
        sub.append(n[i:i+2])
        su=su+sub[0][0]
        l.append(sub)
    return(su)
        
def ip11(): return int(input())
def ip22(): return [int(_) for _ in input().split()]
        

def main():
    ip1=ip11()
    ip2=ip22()
    ip2.sort()
    print(pair(ip2,ip1))
    return
if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
def pair(n,count):
    l=[];su=0
    for i in range(0,len(n),2):
        sub=list()
        sub.append(n[i:i+2])
        su=su+sub[0][0]
        l.append(sub)
    return(su)
        

        
ip1=int(input())
ip2=[]
for i in range(ip1*2):
    ip2.append(int(input()))
ip2.sort()
print(pair(ip2,ip1))
Problem p03543 (python)

Fixed submission:
a=input()
for i in range(2):
  if a[i]==a[i+1]==a[i+2]:
    print('Yes')
    break
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a=input()
for i in range(3):
  if a[i]==a[i+1]==a[i+2]:
    print('Yes')
    break
else:
  print('No')
Problem p02983 (python)

Fixed submission:
l, r = [int(i) for i in input().split()]

if l//2019 == r//2019:
  min_mod = 2017*2018
  for i in range(l, r):
    for j in range(l+1, r+1):
      temp = (i*j)%2019
      if temp < min_mod:
        min_mod = temp
  print(min_mod)
  
else:
  print(0)

Buggy submission (verdict: Runtime Error):
l, r = [int(i) for i in input.split()]

if l//2019 == r//2019:
  print(l*(l+1)%2019)
  
else:
  print(0)
Problem p02993 (python)

Fixed submission:
import sys
s = str(input())

k = None
for i in s:
  if i==k:
    print("Bad")
    sys.exit()
  k = i

print("Good")

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

flavor = int(n*(l+(l+n-1))/2)

if (l<0):
  if l>=(-n+1):
  	print(flavor)
  elif l<(-n+1):
    print(flavor-(l+n-1))
    

else:
  print(flavor-l)
Problem p03062 (python)

Fixed submission:
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))

if 0 in a:
  b = list(map(abs, a))
  print(sum(b))
  
else:
  if (a[a<0].size % 2) == 0:
    b = list(map(abs, a))
    print(sum(b))
  else:
    b = list(map(abs, a))
    b = sorted(b)
    b.reverse()
    c = b.pop()
    print(sum(b)-c)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))

if 0 in a:
  b = list(map(abs, a))
  print(sum(b))
  
else:
  if (a[a<0].size % 2) == 0:
    b = list(map(abs, a))
    print(sum(b))
  else:
    b = list(map(abs, a))
    c = sorted(b).reverse()
    d = c.pop()
    print(sum(c))
Problem p03943 (python)

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

if c==b+a:
  print("Yes")
  
else:
  print("No")

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

init_w, init_h, init_w2, init_h2 = 0,0,w,h
for i in range(n):
  x, y, a = list(map(int,input().split()))
  
  if a ==1:
    init_w = x
  elif a==2:
    init_w2 = x
  elif a==3:
    init_h = y
  elif a==4:
    init_h2 = y

area = (init_w2-init_w)*(init_h2-init_h)
if area<=0:
  area = 0
print(area)
Problem p03693 (python)

Fixed submission:
number = input().split()
number = [int(i) for i in number]
if (number[1] * 10 + number [2]) % 4 == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
number = int(input().split())
if (number[1] * 10 + number [2]) % 4 == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
number = int(input().split())
if (number[1] * 10 + number [2]) % 4 == 0:
    print(YES)
else:
    print(NO)
Problem p03694 (python)

Fixed submission:
houseTime = int(input())
place = input().split() 
place = [int(i) for i in place]
place = sorted(place)
print(place[houseTime - 1] - place[0])

Buggy submission (verdict: Runtime Error):
houseTime = int(input())
place = input().split() 
place = int(i) for i in place
place = sorted(place)
print(place[houseTime - 1] - place[0])
Problem p03695 (python)

Fixed submission:
memTime = int(input())
memLate = input().split()
memLate = [int(i) for i in memLate]
colorList = []
memColor = 0
highLate = 0
for color in range(memTime):
    member = memLate[color]
    if member // 400 >= 8:
        highLate += 1
    elif ((member // 400) in colorList) == False:
        colorList.append(member // 400)
maxColor = len(colorList) + highLate
minColor = len(colorList)
if minColor == 0:
    minColor = 1
print(str(minColor) + " " + str(maxColor))

Buggy submission (verdict: Runtime Error):
memTime = int(input())
memLate = input().split()
memLate = [int(i) for i in memLate]
colorList = []
memColor = 0
highLate = 0
for color in memLate:
    if color // 400 >= 8:
        highLate += 1
    elif color // 400 in colorList == False
        colorList += color // 400
maxColor = len(colorList) + highLate
if maxColor > 7:
    maxColor = 7
print(str(len(colorList)) + " " + str(maxColor))
Problem p02708 (python)

Fixed submission:
n,k=map(int,input().split())
a=[0]*(n+1)
for i in range(k,n+2):
  a[i-k]=(n*i-i**2+i+1)%(10**9+7)

print(sum(a)%(10**9+7))

Buggy submission (verdict: Runtime Error):
n,k=map(int,input().split())
a=[0]*n
for i in range(k,n+2):
  a[i-k]=n*i-i**2+i+1

print(sum(a)%(10**9+7))
Problem p02713 (python)

Fixed submission:
import math

K = int(input())

ans = 0
for i in range(1, K+1):
    for j in range(1, K+1):
        x = math.gcd(i, j)
        for k in range(1, K+1):
            ans += math.gcd(x, k)

print(ans)

Buggy submission (verdict: Runtime Error):
import math
n=int(input())
ans=0
for i in range(1,k+1):
	
        for j in range(1,k+1):
		
                for l in range(1,k+1):
			
                        ans+=math.gcd(i,math.gcd(j,l))

print(ans)
Problem p02717 (python)

Fixed submission:
a,b,c = map(int,input().split())
a,b = b,a
a,c = c,a
print("{} {} {}".format(a,b,c))

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())

if a<b:
    a,b=b,a

if a%b == 0:
    print(0)
else:
    
    a=a%b
    
    while abs(a-b)<a:
        a=abs(a-b)
    print(a)
Problem p02719 (python)

Fixed submission:
n,k=map(int,input().split())
print(min(n%k,abs(n%k-k)))

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())

if a<b:
    a,b=b,a

if a%b == 0:
    print(0)
else:
    c=a//b
    d=a%b
    a=a-b*c
    while abs(a-b)<a:
        a=abs(a-b)
    print(a)

Buggy submission (verdict: Runtime Error):
a, b = map(int,input().split())

if a<b:
    a,b=b,a

if a%b == 0:
    print(0)

else:
    c=list(divmod(a,b))
    while a%b != 0 and abs(b-c[1])<c[1]:
        a=b
        b=c[1]
        c=list(divmod(a,b))

    print(c[1])
Problem p02724 (python)

Fixed submission:
n=int(input())
d=n//500
e=n%500
f=e//5
print(d*1000+f*5)

Buggy submission (verdict: Runtime Error):
n=int(input())
d=n//500
e=n%500
f=e//5
print('d*1000 + f*5)
Problem p02730 (python)

Fixed submission:
l=list(input())
def kaibun(c):
  d=c[::-1]
  if c == d:
    return 0
  else:
    return 1
a=kaibun(l)
m=l[:int((len(l)-1)/2)]
n=l[int((len(l)+1)/2):]

b=kaibun(m)
c=kaibun(n)

if a+b+c==0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
l=list(input())
def kaibun(c):
  d=c[::-1]
  if c = d:
    return 0
  else:
    return 1
a=kaibun(l)
m=l[:int((len(l)-1)/2)]
n=l[int((len(l)+1)/2):]

b=kaibun(m)
c=kaibun(n)

if a+b+c==0:
  print('Yes')
else:
  print('No')