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

Fixed submission:
from operator import itemgetter

N, K = [int(x) for x in input().split()]
Array = list()
A = list()
count = 0
ans = 0
for i in range(N):
	A.append([int(x) for x in input().split()])

A.sort(key=itemgetter(0))
for i in range(N):
	count += A[i][1]
	if count >= K:
		ans = A[i][0]
		break
		
print(ans)

Buggy submission (verdict: Runtime Error):
N, K = [int(x) for x in input().split()]
Array = list()
A = list()
count = 0
ans = 0
for i in range(N):
	A.append[int(x) for x in input().split()]

A.sort(key=itemgetter(0), reverse=True)
for i in range(N):
	count += A[1, i]
	if count >= K:
		ans = A[0, i]
		break
		
print(ans)
Problem p02953 (python)

Fixed submission:
N = int(input())
H = list(map(int, input().split()))
ans = "Yes"
for i in range(N - 1):
  diff = H[i + 1] - H[i]
  if diff >= 1:
    H[i + 1] -= 1
  elif diff < 0:
    ans = "No"
print(ans)

Buggy submission (verdict: Runtime Error):
N = int (input())
H = list(map(int,input().split()))
ans = 'Yes'
for  i in range(N-1):
    diff = H[i+1] - H[i]
    if diff >= 1:
        H[i+1] -= 1
    else diff < 0:
        ans ='No'
print(ans)

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

for x in range(n-1):
    if h[x] <= h[x+1]:
        pass
    else:
        h[x] = h[x]-1

if n == 1:
    ans ='Yes'
for x in range(n-1):
    if h[x] <= h[x+1]:
        ans = 'Yes'
    else:
        ans = 'No'
        break
if h[n-1] <= h[n] and ans ='Yes':
    ans ='Yes'
if h[n-1] <= h[n] and ans ='No':
    ans ='No'

print(ans)

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

for x in range(n-1):
    if h[x] <= h[x+1]:
        pass
    else:
        h[x] = h[x]-1

if n == 1:
    ans ='Yes'
for x in range(n-1):
    if h[x] <= h[x+1]:
        ans = 'Yes'
    else:
        ans = 'No'
        break
if h[n-1] <= h[n] and ans ='Yes':
    ans ='Yes'
if h[n-1] <= h[n] and ans ='No'
    ans ='No'

print(ans)

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

for x in range(n-1):
    if h[x] <= h[x+1]:
        pass
    else:
        h[x] = h[x]-1

if n == 1:
    ans ='Yes'
for x in range(n-1):
    if h[x] <= h[x+1]:
        ans = 'Yes'
    else:
        ans = 'No'
        break
if h[n-1] <= h[n] and ans ='Yes':
    ans ='Yes'
if h[n-1] <= h[n] and ans ='No'
    ans ='No'

print(ans)
Problem p02952 (python)

Fixed submission:
num = int(input())
num_digit = len(str(num))

if num_digit == 1:
    print(num)
elif num_digit == 2:
    print(9)
elif num_digit == 3:
    print(9 + (num - 100 + 1))
elif num_digit == 4:
    print(909)
elif num_digit == 5:
    print(909 + (num - 10000 + 1))
elif num_digit == 6:
    print(90909)

Buggy submission (verdict: Runtime Error):
n = int(input())
num = int(input())
num_digit = len(str(num))

if num_digit == 1:
    print(0)
elif num_digit == 2:
    print(9)
elif num_digit == 3:
    print(9 + (num - 100 + 1))
elif num_digit == 4:
    print(909)
elif num_digit == 5:
    print(909 + (num - 10000 + 1))
Problem p02958 (python)

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

check = 0
for i, p in enumerate(P):
    if i + 1 != p:
        check += 1

if (check == 0 or check == 2):
    print('YES')
else:
    print('NO')

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

check = 0
for i, p in enumerate(P):
    if i + 1 != p[i]:
        check += 1

if (check == 0 or check == 2):
    print('YES')
else:
    print('NO')
Problem p02969 (python)

Fixed submission:
print(int(input())**2*3)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]
for i, num in enumerate(A):
    AA = [x for j, x in enumerate(A) if i != j]
    print(max(AA))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(input()) for i in range(N)]
print("---")
for i, num in enumerate(A):
    AA = [x for j, x in enumerate(A) if i != j]
    print(max(AA))
Problem p03494 (python)

Fixed submission:
input()
A = list(map(int,input().split()))
ans = 0
 
while all(a%2 == 0 for a in A):
  A = [a/2 for a in A]
  ans += 1

print(ans)

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

while all(a% == 0 for a in A):
  A = [a/2 for a in A]
  ans += 1
print(ans)
Problem p03759 (python)

Fixed submission:
a,b,c = map(int,input().split())
print("YES" if b-a==c-b else "NO")

Buggy submission (verdict: Runtime Error):
x = list(input())
y = list(input())+[""]

for o,p in zip(x,y):print(o+p,end="")

Buggy submission (verdict: Runtime Error):
x = list(input())
y = list(input())+[""]

for o,p in zip(x,y):print(o+p,end="")

Buggy submission (verdict: Runtime Error):
x = list(input())
y = list(input())+[""]

print(y)
for o,p in zip(x,y):print(o+p,end="")
Problem p03814 (python)

Fixed submission:
s = input()
a = s.find("A")
b = s.rfind("Z")
print(b - a + 1)

Buggy submission (verdict: Runtime Error):
first = s.find("A")
last = s.rfind("Z")
print(last - first+1)
Problem p02969 (python)

Fixed submission:
print(3*(int(input())**2))

Buggy submission (verdict: Runtime Error):
print(3*input()**2)
Problem p02952 (python)

Fixed submission:
N = int(input())
total = 0
for i in range(1,N+1):
    if len(str(i))%2 != 0:
        total += 1
print(total)

Buggy submission (verdict: Runtime Error):
N = int(input())
total = 0
for i in range(1,N+1):
    if digits%2 != 0:
        total += 1
print(total)
Problem p02969 (python)

Fixed submission:
r=int(input())
print(3*(r**2))

Buggy submission (verdict: Runtime Error):
int r
int t
t = 3*r*r
print(t)
Problem p02957 (python)

Fixed submission:
tmp = input()
fi = int(tmp.split(" ")[0])
se = int(tmp.split(" ")[1])
k = int(abs(fi + se)/2)
mod = abs(fi + se) % 2
if mod == 1:
  print("IMPOSSIBLE")
else:
  print(k)

Buggy submission (verdict: Runtime Error):
cn = int(input())
enm = input().split(" ")
brv = input().split(" ")
taoshita = int(0)

for i in range(0,cn):
    taoshita = taoshita + min(abs(int(brv[i])),abs(int(enm[i])))  
    enm[i] = int(enm[i]) - int(brv[i])
    if int(enm[i]) < 0:
        brv[i] = abs(int(enm[i]))
        enm[i] = 0
        if (int(enm[i+1]) - int(brv[i])) < 0:
            taoshita = taoshita + int(enm[i+1])
            enm[i+1] = 0
        if (int(enm[i+1]) - int(brv[i])) >= 0:
            enm[i+1] = int(enm[i+1]) - int(brv[i])
            taoshita = taoshita + int(brv[i])
print(taoshita)

Buggy submission (verdict: Runtime Error):
tmp = input()
fi = int(tmp.split(" ")[0])
se = int(tmp.split(" ")[1])
k = abs(fi + se)/2
mod = abs(fi + se) % 2
if mod == 1:
  print("IMPOSSIBLE")
  else:
  print(k)
Problem p02952 (python)

Fixed submission:
N=int(input())
dig=len(str(N))
digr=dig-(dig%2)-2
intr=sum([10**i for i in range(0, digr+1,2)])*9
if (dig % 2):
    intr=intr+N-10**(dig-1)+1

print(intr)

Buggy submission (verdict: Runtime Error):
N=int(input())
dig=len(str(N))
digr=dig-(dig%2)-2
intr=sum([10**i for i in range(0, digr+1,2)])*9
if (dig % 2):
    intr=intr+N-10**(dig-1)+1

print(intr+ad)
Problem p03062 (python)

Fixed submission:
N=int(input())
A= [int(a) for a in input().split()]
minusnum=sum(a<0 for a in A)
ablist=[abs(a) for a in A]
ans=sum(ablist)
if minusnum%2:
    ans=ans-2*min(ablist)

print(ans)

Buggy submission (verdict: Runtime Error):
N=int(input())
A= [int(a) for a in input().split()]
minusnum=sum(a<0 for a in A)
pluslist=[a for a in A if a>=0]
minuslist=[-a for a in A if a<0]
ans=sum(pluslist + minuslist)
if minusnum%2:
    plusmin=min(pluslist)
    minusmin=min(minuslist)
    if minusmin>plusmin:
        ans=ans-2*plusmin
    else:
        ans=ans-2*minusmin
print(ans)

Buggy submission (verdict: Runtime Error):

N=int(input())
A= [int(a) for a in input().split()]
minusnum=sum(a<0 for a in A)
ans=sum(abs(a) for a in A)
if minusnum%2:
    plusmin=min(a for a in A if a>=0)
    minusmin=min(-a for a in A if a<0)
    if minusmin>plusmin:
        ans=ans-2*plusmin
    else:
        ans=ans-2*minusmin
print(ans)
Problem p02969 (python)

Fixed submission:
r = int(input())
print(3*r*r)

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
b = [0] * n
l = []

for i in range(n, 0, -1):
    if a[i-1] == 1:
        if n//i < 2:
            b[i-1] = 1
        else:
            c = n//i
            asums = 0
            for j in range(1, c+1):
                asums += a[j*i-1]
            if asums%2 == 1:
                b[i-1] = 1
    else:
        if n//i < 2:
            b[i-1] = 0
        else:
            c = n//i
            asums = 0
            for j in range(1, c+1):
                asums += a[j*i-1]
            if asums%2 == 1:
                b[i-1] = 1

for k in range(0, n):
    if b[k] == 1:
        l.append(k+1)

print(len(l))
print(" ".join(map(str, l)))
Problem p02952 (python)

Fixed submission:
n = int(input())

#整数をばらけさせてリスト化
list_n = list(range(1,n+1))
#print(list_n)

#桁の長さが奇数なら数え上げる
cnt = 0
for i in list_n:
     if (len(str(i)))%2 == 1:
            cnt += 1
     else: pass
print(cnt)

Buggy submission (verdict: Runtime Error):
n = int(raw_input())

#整数をばらけさせてリスト化
list_n = list(range(1,n+1))
print(list_n)

#桁の長さが奇数なら数え上げる
cnt = 0
for i in list_n:
     if (len(str(i)))%2 == 1:
            cnt += 1
     else: pass
print(cnt)
Problem p03455 (python)

Fixed submission:
a =input()
s =a.split()
if (int(s[0])*int(s[1]))%2==0:
    print("Even")
else:
    print("Odd")

Buggy submission (verdict: Runtime Error):
a = input().split()
if (a[0]*a[1])%2==0:
    print("Even")
else:
    print("Odd")
Problem p03493 (python)

Fixed submission:
a = str(input())
s = a.count("1")
print(s)

Buggy submission (verdict: Runtime Error):
import math
a = input()
s = list(map(int,input().split()))
ans =float("inf")
for i in s:
  ans = min(ans,len(bin(i))-bin(i).rfind("1")-1)
print(round(ans))
Problem p02953 (python)

Fixed submission:
N = int(input())
H = list(map(int,input().split()))
H.reverse()
cnt = 0
for i in range(N-1):
  if H[i+1]-H[i]==1:
    H[i+1] = H[i+1]-1
  elif H[i+1]-H[i]>1:
    cnt = 1
    break
if cnt == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
cnt = 0
for i in range(N):
  if H[i]-H[i+1]=1:
    H[i] = H[i]-1
  elif H[i]-H[i+2]>1:
    cnt = 1
    break
if cnt == 0:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
cnt = 0
for i in range(N-2):
    if H[i+1]-H[i]<0 and H[i+2]-H[i+1]<0:
        cnt = 1
        break
    elif H[i+1]-H[i]<-1:
        cnt = 1
        break
for j in range(N-3):
    if H[i+1]-H[i]<0 and H[i+2]-H[i+1] == 0 and H[i+3]-H[i+2]<0:
        cnt = 1
        break
if cnt >0:
  print('No')
else:
  print('Yes')
N = int(input())
H = list(map(int,input().split()))
cnt = 0
for i in range(N-2):
    if H[i+1]-H[i]<=0 and H[i+2]-H[i+1]<0:
        cnt = 1
        break
    elif H[i+1]-H[i]<-1:
        cnt = 1
        break
if cnt >0:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
cnt = 0
for i in range(N-2):
    if H[i+1]-H[i]<0 and H[i+2]-H[i+1]<0:
        cnt = 1
        break
    elif H[i+1]-H[i]<-1:
        cnt = 1
        break
for j in range(N-3):
    if H[i+1]-H[i]<0 and H[i+2]-H[i+1] == 0 and H[i+3]-H[i+2]<0:
        cnt = 1
        break
if cnt >0:
  print('No')
else:
  print('Yes')

Buggy submission (verdict: Runtime Error):
N = int(input())
H = list(map(int,input().split()))
cnt = 0
for i in range(N-2):
  if H[i+1]-H[i]<0 and H[i+2]-H[i+1]<0:
      cnt = 1
      break
  elif H[i+1]-H[i]<-1:
      cnt = 1
      break
  elif H[i+1]-H[i]<0 and H[i+2]-H[i+1] == 0 and H[i+3]-H[i+2]<0:
      cnt = 1
      break
if cnt >0:
  print('No')
else:
  print('Yes')
Problem p02981 (python)

Fixed submission:
N,A,B = map(int,input().split())
if N*A>=B:
  print(B)
else:
  print(N*A)

Buggy submission (verdict: Runtime Error):
import numpy as np
N,D = map(int,input().split())
X =[]
cnt = 0
for i in range(N):
  X = np.vstack(X,list(map(int,input().split())))

for i in range(N-1):
    c = X[i]
    for j in range(i+1,N):
        d = X[j]
        e = c-d
        f = np.square(e)
        g = sum(f)
        h = np.sqrt(g)
        l = int(h**.5)
        if abs(l*l-h) <1e-6:
            cnt +=1
Problem p02993 (python)

Fixed submission:
S = input()
if S[0] == S[1] or S[1] == S[2] or S[2] == S[3]:
    print("Bad")
else:
    print("Good")

Buggy submission (verdict: Runtime Error):
import math

def lcm(x, y):
    return (x * y)//math.gcd(x, y)

A,B,C,D = map(int,input().split())
E = lcm(C, D)
sample = B-A
ans = sample - ((B//C-A//C) + (B//D-A//D)-(B//E-A//E))
print(ans)
Problem p02995 (python)

Fixed submission:
import fractions as f
a,b,c,d = map(int,input().split())
i = abs((a-1)//c-b//c)
j = abs((a-1)//d-b//d)
 
def lcm(x,y):
  return (x*y)//f.gcd(x,y)
l = lcm(c,d)
k = abs((a-1)//l-b//l)
print(b-a+1-(i+j-k))

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
def lcm(x, y):
    return (x * y)/math.gcd(x, y)
E = lcm(C, D)
sample = B-A
ans = sample - ((B/C-A/C) + (B/D-A/D)-(B/E-A/E))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
def lcm(x, y):
    return (x * y)//math.gcd(x, y)
E = lcm(C, D)
sample = B-A
ans = sample - ((B//C-A//C) + (B//D-A//D)-(B//E-A//E))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
E = lcm(C, D)
sample = B-A
ans = sample - ((B//C-A//C) + (B//D-A//D)-(B//E-A//E))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
E = lcm(C, D)
sample = B-A+1
ans = sample - ((B//C-A//C) + (B//D-A//D)-(B//E-A//E))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
E = lcm(C, D)
sample = B-A+1
ans = sample - ((B//C-A//C) + (B//D-A//D)-(B//E-A//E))
print(ans)

Buggy submission (verdict: Runtime Error):
import math
A,B,C,D = map(int,input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
E = lcm(C, D)
sample = B-A+1
ans = sample - ((B//C-A//C) + (B//D-A//D)-(B//E-A//E))
print(ans)
Problem p03035 (python)

Fixed submission:
A,B = map(int,input().split())
if A<6:
  print(0)
elif A<13:
  print(B//2)
else:
  print(B)

Buggy submission (verdict: Runtime Error):
A,B = int(input())
if A<6:
  print(0)
elif A<13:
  print(B/2)
else:
  print(B)

Buggy submission (verdict: Runtime Error):
i = list(map(int,input().split()))
A = i[0]
B = i[1]
if A>=13:
  print(B)
elif A<=5:
    print(0)
else:
    print(B/2)
i = list(map(int,input().split()))
A = i[0]
B = i[1]
if A>=13:
  print(B)
elif A<=5:
    print(0)
elif A>=6 and A<=12:
    print(B/2)

Buggy submission (verdict: Runtime Error):
i = list(map(int,input().split()))
A = i[0]
B = i[1]
if A>12:
  print(B)
  elif A<6:
    print(0)
    else:
      print(B/2)

Buggy submission (verdict: Runtime Error):
i = list(map(int,input().split()))
A = i[0]
B = i[1]
if A>12:
  pritn(B)
  elif A<6:
    print(0)
    else:
      print(B/2)
Problem p03206 (python)

Fixed submission:
D = int(input())
if D == 25:
  print("Christmas")
elif D == 24:
  print("Christmas Eve")
elif D == 23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")

Buggy submission (verdict: Runtime Error):
D = int(input())
if D = 25:
  print("Christmas")
elif D = 24:
  print("Christmas Eve")
elif D = 23:
  print("Christmas Eve Eve")
else:
  print("Christmas Eve Eve Eve")
Problem p03219 (python)

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

Buggy submission (verdict: Runtime Error):
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
B = list(range(N))
def Temp(x):
  Temp = T-0.006*x
  return(Temp)
for i in range(N):
  B[i] = abs(Temp(H[i])-A)
ans = min(B)
print(B.index(ans)+1)
Problem p03220 (python)

Fixed submission:
N = int(input())
T,A = map(int,input().split())
H = list(map(int,input().split()))
B = list(range(N))
def Temp(x):
  Temp = T-0.006*x
  return(Temp)
for i in range(N):
  B[i] = abs(Temp(H[i])-A)
ans = min(B)
print(B.index(ans)+1)

Buggy submission (verdict: Runtime Error):
N = int(input)
T,A = map(int,input().split())
H = list(map(int,input().split()))
B = list(range(N))
def Temp(x):
  Temp = T-0.006*x
  return(Temp)
for i in range(N):
  B[i] = abs(Temp(H[i])-A)
ans = min(B)
print(B.index(ans)+1)

Buggy submission (verdict: Runtime Error):
N = int(input())
T,A = map(int,input())
H = list(map(int,input()))
B = list(range(N))
def Temp(x):
  Temp = T-0.006*x
  return(Temp)
for i in range(N):
  B[i] = abs(Temp(H[i])-A)
ans = min(B)
print(B.index(ans)+1)
Problem p03238 (python)

Fixed submission:
N = int(input())
if N ==1:
  print('Hello World')
else:
  A = int(input())
  B = int(input())
  print(A+B)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = int(input())
B = int(input())
if N ==1:
  print('Hello World')
else:
  print(A+B)
Problem p03281 (python)

Fixed submission:
N = int(input())
cnt=0
if N <105:
  cnt =0
else:
  if N%2==0:
    for i in range(105,N+1,2):
      temp=0
      for j in range(1,N+1,2):
        if i%j==0:
          temp+=1
      if temp==8:
        cnt+=1
  else:
    for i in range(105,N+1,2):
      temp=0
      for j in range(1,N+3,2):
        if i%j==0:
          temp+=1
      if temp==8:
        cnt+=1

print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
if N <105:
  print(0)
else:
  for i in range(105,N,2):
    temp=0
    for j in range(3,15,2):
        if i%j==0:
            temp+=1
    if temp==3:
        cnt+=1
print(cnt)
Problem p03292 (python)

Fixed submission:
A = list(map(int,input().split()))
ans = []
a = abs(A[0]-A[1])+abs(A[1]-A[2])##0→1→2
b = abs(A[0]-A[2])+abs(A[2]-A[1])##0→2→1
c = abs(A[1]-A[0])+abs(A[0]-A[2])##1→0→2
ans.append(a)
ans.append(b)
ans.append(c)
print(min(ans))

Buggy submission (verdict: Runtime Error):
A = list(map(int,input().split()))
ans = []
a = abs(A(0)-A(1))+abs(A(1)-A(2))##0→1→2
b = abs(A(0)-A(2))+abs(A(2)-A(1))##0→2→1
c = abs(A(1)-A(0))+abs(A(0)-A(2))##1→0→2
ans.append(a)
ans.append(b)
ans.append(c)
print(min(ans))
Problem p03369 (python)

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

Buggy submission (verdict: Runtime Error):
S = input().split(",")
topping = S.count("o")
print(700+topping＊１００)
Problem p03377 (python)

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

Buggy submission (verdict: Runtime Error):
A,B,X = map(int,input().split())
if A+B >=X and A<X:
  print('YES')
elif:
  print('NO')
Problem p03385 (python)

Fixed submission:
S = input()
if S[0] != S[1] and S[0] != S[2] and S[1] != S[2]:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
S = input()
if S[0] != S[1] and S[0] != S[2] and S[1] != S[2]:
  print('Yes')
else:
  print('No)
Problem p03415 (python)

Fixed submission:
A = input()
B = input()
C = input()
print(A[0]+B[1]+C[2])

Buggy submission (verdict: Runtime Error):
A = input()
B = input()
C = input()
print(A(0)+B(1)+C(2))
Problem p03433 (python)

Fixed submission:
N = int(input())
A = int(input())
sample = N%500
if A >= sample:
  print("Yes")
else:
  print("No")

Buggy submission (verdict: Runtime Error):
N = int(input())
D = list(map(int,input().split()))
D.sort(reverse = True)
A = []
B = []
for i in range(N):
    if i%2==0:
        A.append(D[i])
    else:
        B.append(D[i])
 
print(sum(A)-sum(B))
Problem p03434 (python)

Fixed submission:
N = int(input())
D = list(map(int,input().split()))
D.sort(reverse = True)
A = []
B = []
for i in range(N):
    if i%2==0:
        A.append(D[i])
    else:
        B.append(D[i])
 
print(sum(A)-sum(B))

Buggy submission (verdict: Runtime Error):
N = int(input())
D.sort(reverse = True)
A = []
B = []
for i in range(N):
    if i%2==0:
        A.append(D[i])
    else:
        B.append(D[i])
 
print(sum(A)-sum(B))

Buggy submission (verdict: Runtime Error):
N = int(input())
D.sort(reverse = True)
A = []
B = []
for i in range(N):
    if i%2==0:
        A.append(D[i])
    else:
        B.append(D[i])

print(sum(A)-sum(B))
Problem p03448 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for l in range(A+1):
    for m in range(B+1):
        for n in range(C+1):
            if 500*l+100*m+50*n ==X:
                ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
a = X//(500*A)
b = X//(100*B)
c = X//(50*C)
ans = 0
for l in range(a+1):
    for m in range(b+1):
        for n in range(c+1):
            if 500*l+100*m+50*n ==X:
                ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
a = X//(500*A)
b = X//(100*B)
c = X//(50*C)
ans = 0
for l in range(a+1):
    total=[]
    d = 500*l
    total.append(d)
    for m in range(b+1):
        e = 100*m
        total.append(e)
        for n in range(c+1):
            f = 50*n
            total.append(f)
            if sum(total) ==X:
                ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
A = int(input())
B = int(input())
C = int(input())
X = int(input())
a = X//(500*A)
b = X//(100*B)
c = X//(50*C)
total = []
ans = 0
for l in range(a+1):
  d = 500*l
  total.append(d)
  for m in range(b+1):
    e = 100*m
    total.append(e)
    for n in range(c+1):
      f = 50*n
      total.append(f)
      if sum(total) ==X:
        ans += 1
print(ans)
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
A = list(map(input().split()))
a = A[0]
b = A[1]
n = len(b)
a = int(a)
b = int(b)
jud = a*10**(n)+b
m = int(jud**.5)
if abs(m*m-jud)< 1e-6:
  print('Yes')
else:
  print('No')
Problem p03456 (python)

Fixed submission:
a = int(input().replace(" ", ""))
 
b = a**0.5
c = b - int(b)
 
if c == 0.0:
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
A = list(map(input().split()))
a = A[0]
b = A[1]
n = len(b)
a = int(a)
b = int(b)
print(n)
jud = a*10**(n)+b
m = int(jud**.5)
print(jud)
if abs(m*m-jud)< 1e-6:
  print('Yes')
else:
  print('No')
Problem p03547 (python)

Fixed submission:
x,y = map(str, input().split())
 
print(">" if x > y else "<" if x < y else "=")

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
if X==Y:
  print("=")
  elif X<Y:
  print("<")
  else:
  print(">")
  end

Buggy submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
if X==Y;
  print("=")
  elif X<Y;
  print("<")
  else;
  print(">")

Buggy submission (verdict: Runtime Error):
X =  int(input())
Y =  int(input())
if X < Y;
print("<")
elif X=Y;
print("=")
else;
print(">")

Buggy submission (verdict: Runtime Error):
X = 
Y = 
if X < Y;
print("<")
elif X=Y;
print("=")
else;
print(">")
Problem p03610 (python)

Fixed submission:
S = input()
print(S[::2])

Buggy submission (verdict: Runtime Error):
s = input()
N = len(s)
for i in range(N):
  if i%2 ==1:
    s.pop(i)
print(s)
Problem p03624 (python)

Fixed submission:
S = input()
str = "abcdefghijklmnopqrstuvwxyz"
l1 = list(str)
l2 = list(S)
l3 = list(set(l1)-set(l2))
l3.sort()
if len(l3)==0:
    print("None")
else:
    print(l3[0])

Buggy submission (verdict: Runtime Error):
S = input()
str = "abcdefghijklmnopqrstuvwxyz"
l1 = list(str)
l2 = list(S)
l3 = list(set(l1)-set(l2))
l3.sort()
print(l3[0])
Problem p03720 (python)

Fixed submission:
N,M = map(int,input().split())
R = []
for i in range(M):
  a = list(map(int,input().split()))
  b = a[0]
  c = a[1]
  R.append(b)
  R.append(c)
  
for l in range(1,N+1):
  ans = []
  ans = [i for i in R if i == l ]
  print(len(ans))

Buggy submission (verdict: Runtime Error):
N,M = map(int,input().split())
R = []
for i in range(M):
  r = list(map(int,input().split()))
  R.append(r)

for l in range(N):
  ans = []
  ans = [i for i in R if i = l ]
  print(len(ans))