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

Fixed submission:
import numpy as np
n = int(input())
if n == 1:
    print(1)
else:
    points = np.zeros((n, 2), dtype=np.int)
    for i in range(n):
        x, y = [int(x) for x in input().split()]
        points[i, 0] = x
        points[i, 1] = y

    diffs = {}
    for i in range(n):
        for j in range(n):
            if i != j:
                diff = (points[i, 0] - points[j, 0], points[i, 1] - points[j, 1])
                if diff in diffs:
                    diffs[diff] += 1
                else:
                    diffs[diff] = 1

    count = sorted(diffs.items(), key=lambda kv: kv[1])[-1][1]
    print(n-count)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
if n == 1:
    print(1)

points = np.zeros((n, 2), dtype=np.int)
for i in range(n):
    x, y = [int(x) for x in input().split()]
    points[i, 0] = x
    points[i, 1] = y

diffs = {}
for i in range(n):
    for j in range(n):
        if i != j:
            diff = (points[i, 0] - points[j, 0], points[i, 1] - points[j, 1])
            if diff in diffs:
                diffs[diff] += 1
            else:
                diffs[diff] = 1

count = sorted(diffs.items(), key=lambda kv: kv[1])[-1][1]
print(n-count)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
points = np.zeros((n, 2), dtype=np.int)
for i in range(n):
    x, y = [int(x) for x in input().split()]
    points[i, 0] = x
    points[i, 1] = y

diffs = {}
for i in range(n):
    for j in range(n):
        if i != j:
            diff = (points[i, 0] - points[j, 0], points[i, 1] - points[j, 1])
            if diff in diffs:
                diffs[diff] += 1
            else:
                diffs[diff] = 1

count = sorted(diffs.items(), key=lambda kv: kv[1])[-1][1]
print(n-count)

Buggy submission (verdict: Runtime Error):
import numpy as np
n = int(input())
points = np.zeros((n, 2), dtype=np.int)
for i in range(n):
    x, y = [int(x) for x in input().split()]
    points[i, 0] = x
    points[i, 1] = y

diffs = {}
for i in range(n):
    for j in range(n):
        if i != j:
            diff = (points[i, 0] - points[j, 0], points[i, 1] - points[j, 1])
            if diff in diffs:
                diffs[diff] += 1
            else:
                diffs[diff] = 1

count = sorted(diffs.items(), key=lambda kv: kv[1])[-1][1]
print(n-count)
Problem p02952 (python)

Fixed submission:
N = int(input())

count = 0
for i in range(1,N+1):
  a = [_ for _ in str(i)]
  if len(a)%2==1:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())

count = 0
for i in range(1,N+1):
  a = [_ for _ in str(i)]
  if len(a)%2=1:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())

count = 0
for i in range(1,N+1):
  if len(str(i))%2=1:
    count += 1

print(count)
Problem p02982 (python)

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

row = list()
count = 0
for i in range(N):
  x = [int(_) for _ in input().split()]
  if i == 0:
    row.append(x)
  else:
    for j in range(len(row)):
      dist = 0
      for k in range(D):
        dist += (row[j][k]-x[k])**2
      if (dist**0.5)-int(dist**0.5)==0:
      	count += 1
    row.append(x)
      
print(count)

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

row = list()
count = 0
for i in range(N):
  x = [int(_) for _ in input().split()]
  if i == 0:
    row.append(x)
  else:
    for j in len(row):
      dist = 0
      for k in range(D):
        dist += (row[j][k]-x[k])^2
      if (dist**1/2) == int:
      	count += 1
    row.append(x)
      
print(count)
Problem p02988 (python)

Fixed submission:
n = int(input())

p = [int(_) for _ in input().split()]

count = 0

for i in range(1,n-1):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)

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

p = map(int, input().split())

count = 0

for i in range(1,n-1):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)

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

p = map(int, input().split())

count = 0

for i in range(1,n-1):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)

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

p = map(int, input().split())

count = 0

for i in range(1,n):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)

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

p = map(int, input().split())

count = 0
for i in range(n):
  if p[i+1]>p[i] and p[i]>=p[i-1]:
    count += 1
  elif p[i-1]>p[i] and p[i]>=p[i+1]:
    count += 1
    
print (count)

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

p = map(int, input().split())

count = 0
for i in range(n):
  if (p[i+1]>p[i] and p[i]>=p[i-1]) or (p[i-1]>p[i] and p[i]>=p[i+1]):
    count += 1
    
print (count)
Problem p03000 (python)

Fixed submission:
N, X = map(int, input().split())
L = [int(_) for _ in input().split()]

count = 1
ball = 0
for i in range(N):
  ball += L[i]
  if X >= ball:
    count += 1
  else:
    break
print(count)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = [int(_) for _ in input().split()]

count = 1
Ball = 0
for i in range(N):
  ball += L[i]
  if X >= ball:
    count += 1
  else:
    break
print(count)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = [int(_) for _ in input().split()]

count = 1
Ball = 0
for i in range(N):
  ball += L[i]
  if X >= ball:
    count += 1
  else:
    break
print(count)
Problem p03067 (python)

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

if a<c<b or b<c<a:
  print('Yes')
else:
  print('No')

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

if a<c<b or b<c<a:
  print('Yes)
else:
  print('No)

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

if a<c<b or b<c<a:
 print('Yes)
else:
 print('No)
Problem p03071 (python)

Fixed submission:
a,b = map(int,input().split())
if abs(a-b)<=1:
  print(a+b)
else:
  if a>b:
    print((a*2)-1)
  else:
    print((b*2)-1)

Buggy submission (verdict: Runtime Error):
A,B = map(int,input().split())
if abs(a-b)<=1:
  print(a+b)
else:
  if a>b:
    print(a*2-1)
  else:
    print(b*2-1)
Problem p03076 (python)

Fixed submission:
order = [int(input()) for _ in range(5)]
min_digit = 9
time = 0
for i in range(len(order)):
  if order[i]%10!=0:
    time+=(order[i]//10+1)*10
  else:
    time+=order[i]

for i in range(len(order)):
  digit = order[i]%10
  if min_digit>=digit and digit!=0:
    min_digit=digit
    
order_digit = [i%10 for i in order]
if order_digit == [0,0,0,0,0]:
  print (time)
else:
  print (time-10+min_digit)

Buggy submission (verdict: Runtime Error):
order = [int(input()) for _ in range(5)]
min_digit = 0
time = 0
for i in range(len(order)):
  if order[i]%10!=0:
    time+=(order[i]//10+1)*10
  else:
    time+=order[i]

order_digit = [i%10 for i in order]
if order_digit == [0,0,0,0,0]:
  print (time-10+min_digit)
else:
  for i in range(len(order)):
    digit = order[i]%10
    if min_digit>=digit and digit!=0:
    min_digit=digit

Buggy submission (verdict: Runtime Error):
order = [int(input()) for _ in range(5)]

for i in range(len(order)):
  time = 0
  for j in range(len(order)-i):
    if order[j+i]%10 == 0:
    	time += order[j]
  	else:
    	time += (order[j]//10+1)*10
Problem p03079 (python)

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

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

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

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

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

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

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

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

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

if a=b=c:
  print('Yes')
else:
  print('No')
Problem p03080 (python)

Fixed submission:
n = int(input())
s = [i for i in input()]

red = s.count('R')
blue = s.count('B')

if red > blue:
  print('Yes')
else:
  print ('No')

Buggy submission (verdict: Runtime Error):
n = int(input())
s = [i for i in input().split()]

red = count('R')
blue = count('B')

if red > blue:
  print('Yes')
else:
  print ('No')
Problem p03085 (python)

Fixed submission:
b = input()

if b=='A':
  print ('T')
if b=='C':
  print ('G')
if b=='G':
  print ('C')
if b=='T':
  print ('A')

Buggy submission (verdict: Runtime Error):
b = input()

if b=='A':
  print "T"
if b=='c':
  print "G"
if b=='G':
  print "C"
if b=='T':
  print "A"
Problem p03086 (python)

Fixed submission:
s = input()

ans=0
base = set(['A','C','G','T'])
i = 1
while i <= len(s):
    j = 0
    while j+i <= len(s):
        word = set(s[j:j+i])
        if word <= base:
            ans = len(s[j:j+i])
        j += 1
    i += 1
print (ans)

Buggy submission (verdict: Runtime Error):
S = input()

ans = 0
ACGT = set('A','C','G','T')
for i in range(1,len(S+1)):
  j = 1
  while j*i <= len(S):
    if set(S[j:j*i]) <= ACGT:
      ans = len(S[j:j*i])
    j += 1
print (ans)

Buggy submission (verdict: Runtime Error):
S = input()

ans = 0
ACGT = set('A','C','G','T')
for i in range(1,len(S+1)):
  j = 1
  while j*i <= S:
    if set(S[j:j*i]) <= ACGT:
      ans = len(S[j:j*i])
    j += 1
print (ans)

Buggy submission (verdict: Runtime Error):
S = input()

ans = 0
ACGT = set('A','C','G','T')
for i in len(1,S+1):
  j = 1
  while j*i <= S:
    if set(S[j:j*i]) <= ACGT:
      ans = len(S[j:j*i])
    j += 1
print (ans)
Problem p03102 (python)

Fixed submission:
N,M,C = map(int, input().split())
B = [int(_) for _ in input().split()]

count = 0
for i in range(N):
  A = [int(_) for _ in input().split()] 
  sum = 0
  for j in range(M):
    sum += B[j]*A[j]
  if sum+C > 0:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N,M,C = map(int, input().split())
B = [int(_) for _ in input().split()]

count = 0
for i in range(len(N)):
  A = [int(_) for _ in input().split()] 
  sum = 0
  for j in range(M):
    sum = B[j]*A[j]
  if sum-C > 0:
    count += 1

print(count)

Buggy submission (verdict: Runtime Error):
N,M,C = map(int, input().split())
B = [int(_) for _ in input().split()]

count = 0
for i in range(len(N)):
  A = [_ for _ in input().split()] 
  sum = 0
  for j in range(M):
    sum = B[j]*A[j]
  if sum-C > 0:
    count += 1

print(count)
Problem p02953 (python)

Fixed submission:
N=int(input())

l=list(map(int,input().split()))
l[0]-=1
Switch=True

for i in range(N-1):

    if l[i+1]==l[i]:
        pass
    elif l[i+1]>l[i]:
        l[i+1]-=1
    else:
        print("No")
        Switch=False
        break
    if i==N-2:
        print("Yes")
        Switch=False
    
if Switch:
    print("Yes")

Buggy submission (verdict: Runtime Error):
N=int(input())

l=list(map(int,input().split()))
l[0]-=1
switch=True

for i in range(N-1):

    if l[i+1]==l[i]:
        pass
    elif l[i+1]>l[i]:
        l[i+1]-=1
    else:
        print("No")
        Switch=False
        break
    if i==N-2:
        print("Yes")
        Switch=False
    
if Switch:
    print("No")
Problem p02975 (python)

Fixed submission:
def resolve():
    n = int(input())
    a = list(map(int,input().split()))
    sa = list(set(a))
    num = {}

    if sum(sa)==0:
        print("Yes")
        exit(0)
    if (n%3)!=0:
        print("No")
        exit(0)
    for i in a:
        num[i] = num.get(i,0) + 1
    
    OK = False
    if len(num)==3:
        i,j,k = num.values()
        if i==j and j==k and sa[0]==(sa[1]^sa[2]):
            OK = True
    elif len(num)==2:
        i,k = num.keys()
        j,l = num.values()
        if i==0 and j*2==l:
            OK = True
        elif k==0 and l*2==j:
            OK = True
    if(OK):
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
def resolve():
    n = int(input())
    a = list(map(int,input().split()))
    sa = list(set(a))
    num = {}

    if sum(sa)==0:
        print("Yes")
        exit(0)
    if (n%3)!=0:
        print("No")
        exit(0)
    for i in a:
        num[i] = num.get(i,0) + 1
    
    OK = False
    if len(num)>=3 and len(num)%3==0:
        i,j,k = num.values()
        if i==j and j==k and sa[0]==sa[1]^sa[2]:
            OK = True
    if(OK):
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    resolve()
Problem p02993 (python)

Fixed submission:
s=input()
ans = 'Good'
last = s[0]
for i in s[1:]:
    if last==i:
        ans = 'Bad'
        break
    last = i
print(ans)

Buggy submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(10**5)
m = 100005
visited = [False]*(m*2)
cnt = [0,0]
def dfs(i):
    visited[i] = True
    cnt[i//m] = cnt[i//m]+1
    for j in to[i]:
        if not visited[j]:
            dfs(j)
 
input = sys.stdin.readline
n = int(input())
to = [[] for _ in range(m*2)]
for _ in range(n):
    x,y = map(int,input().split())
    y = y+m
    to[x].append(y)
    to[y].append(x)
 
ans = 0
for i in range(m):
    if not visited[i]:
        cnt = [0,0]
        dfs(i)
        ans = ans + cnt[0]*cnt[1]
 
print(ans-n)

Buggy submission (verdict: Runtime Error):
s=input()
ans = 'Good'
last = s[0]
for i in s[1:]:
    if last==i:
        ans = 'Bad'
        reak
    last = i
print(ans)
Problem p03044 (python)

Fixed submission:
import sys
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
MAX=10**5+5
tree=[[] for _ in range(MAX)]
ans = [-1]*(MAX)
def dfs(x,weight):
    if(ans[x]>=0):
        return
    ans[x]=weight&1
    for i,w in tree[x]:
        dfs(i,weight+w)

def resolve():
    n =int(input())
    for i in range(n-1):
        u,v,w = map(int,input().split())
        tree[u].append((v,w))
        tree[v].append((u,w))
    dfs(1,0)
    
    for i in range(1,n+1):
        print(ans[i])


if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
MAX=10**5+5
tree=[[] for _ in range(MAX)]
ans = [-1]*(MAX)
def dfs(x,weight):
    if(ans[x]>=0):
        return
    ans[x]=weight&1
    for i,w in tree[x]:
        dfs(i,weight+w)

def resolve():
    n =int(input())
    for i in range(n-1):
        u,v,w = map(int,input().split())
        tree[u].append((v,w))
        tree[v].append((u,w))
    dfs(1,0)
    
    for i in range(1,n+1):
        print(ans[i])


if __name__ == "__main__":
    resolve()
Problem p03060 (python)

Fixed submission:
def resolve():
    n = int(input())
    v = map(int,input().split())
    c = map(int,input().split())
    s = [x-y for x,y in zip(v,c) if (x-y)>0]
    ans = 0
    if s:
        ans = sum(s)
    print(ans)

if __name__ == "__main__":
    resolve()

Buggy submission (verdict: Runtime Error):
ef resolve():
    n = int(input())
    v = map(int,input().split())
    c = map(int,input().split())
    s = [x-y for x,y in zip(v,c) if (x-y)>0]
    ans = 0
    if s:
        ans = sum(s)
    print(ans)

if __name__ == "__main__":
    resolve()
Problem p02972 (python)

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

def sumN(n,N,f):
	total = 0
	i = n
	while i < N:
		total += f[i]
		i += n+1

	if total % 2:
		return 1
	else:
		return 0

def main():
	N = int(input())
	a = list(map(int,input().split()))
	ball = []
	ballNum = 0
	f = [0]*N

	for i in reversed(range(1,N)):
		if sumN(i,N,f) != (a[i] % 2):
			f[i] = 1
			ball.append(i+1)
			ballNum +=1

	if (sum(f) % 2) != (a[0] % 2):
		f[0] = 1
		ball.append(1)
		ballNum +=1

	print(ballNum)
	print(*ball)

if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
	N = int(input())
	a = list(map(int,input().split()))
	ball = []
	ballNum = 0
	f = [0]*N

	for i in reversed(range(1,N)):
		if (sum(f[0::i+1]) % 2) != (a[i] % 2):
			f[i] = 1
			ball.append(i+1)
			ballNum +=1

	if (sum(f) % 2) != (a[0] % 2):
		f[i] = 1
		ball.append(1)
		ballNum +=1

	print(ballNum)
	print(*ball)

if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
	N = int(input())
	a = list(map(int,input().split()))
	ball = []
	ballNum = 0
	f = [0]*N

	for i in reversed(range(1,N)):
		if (sum(f[0::i]) % 2) != (a[i] % 2):
			f[i] = 1
			ball.append(i+1)
			ballNum +=1

	if (sum(f) % 2) != (a[0] % 2):
		f[i] = 1
		ball.append(1)
		ballNum +=1

	print(ballNum)
	print(*ball)

if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
	N = int(input())
	a = list(map(int,input().split()))
	ball = []
	ballNum = 0
	f = [0]*N

	for i in reversed(range(1,N)):
		if (sum(f[0::i]) % 2) != (a[i] % 2):
			f[i] = 1
			ball.append(i+1)
			ballNum +=1

	if (sum(f) % 2) != (a[i] % 2):
		f[i] = 1
		ball.append(i+1)
		ballNum +=1

	print(ballNum)
	print(*ball)

if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
	N = int(input())
	a = list(map(int,input().split()))
	ball = []
	ballNum = 0
	f = [0]*N

	for i in reversed(range(N)):
		if (sum(f[0::i]) % 2) != (a[i] % 2):
			f[i] = 1
			ball.append(i+1)
			ballNum +=1

	print(ballNum)
	print(*ball)

if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

def main():
	N = int(input())
	a = list(map(int,input().split()))
	ball = []
	ballNum = 0
	f = [0*N]

	for i in reversed(range(N)):

		if (sum(filter(lambda x: x % (i+1) == 0, f)) % 2) != (a[i] % 2):
			f[i] = 1
			ball.append(i+1)
			ballNum +=1

	print(ballNum)
	print(*ball)

if __name__ == "__main__":
	main()
Problem p02957 (python)

Fixed submission:
a, b = map(int, input().split())
if (a+b)%2 == 0:
    print(abs(a+b)//2)
else:
    print("IMPOSSIBLE")

Buggy submission (verdict: Runtime Error):
a, b = int(input())
if (a+b)%2 == 0:
    print(abs(a+b)//2)
else:
    print("IMPOSSIBLE")
Problem p03106 (python)

Fixed submission:
a, b, k = map(int, input().split())
ans = []
for i in range(1, min(a, b)+1):
    if a % i == 0 and b % i == 0:
        ans.append(i)
print(ans[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
ans = []
for i in range(1, min(a, b)):
    if a % i == 0 and b % i == 0:
        ans.append(i)
print(ans[-k])

Buggy submission (verdict: Runtime Error):
a, b, k = map(int, input().split())
ans = []
for i in range(1, max(a, b)):
    if a % i == 0 and b % i == 0:
        ans.append(i)
print(ans[-k])
Problem p03145 (python)

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

print(x[0] * x[1] // 2)

Buggy submission (verdict: Runtime Error):
def judge(n):
    if n % 2 == 0:
        return n / 2
    else:
        return 3*n + 1

s = int(input())
ans = 1

while s != 4 and s != 2 and s != 1:
    s = judge(s)
    ans += 1

print(ans+3)
Problem p03325 (python)

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

for i in range(n):
    while a[i]%2 == 0:
        a[i] = a[i]//2
        ans += 1
print(ans)

Buggy submission (verdict: Runtime Error):
n=int(input())
a=[n]
count=0

for i in range(n):
    i = int(input())
    a.append(i)

for i in a:
    x = i%2
    if x != 0:
        count += 1
    else:
        continue

if count==n:
    print(0)
else:
    print(n)
Problem p03827 (python)

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

for i in range(len(s)):
    if s[i] == "I":
        count += 1
        count_list.append(count)
    else:
        count -= 1
        count_list.append(count)

print(max(count_list))

Buggy submission (verdict: Runtime Error):
n = int(input())
s = input()
count = 0
count_list = []

for i in range(len(s)):
    if s[i] == "I":
        count += 1
        count_list.append(count)
    else:
        count -= 1
        count_list.append(count)

print(max(count_list,0))
Problem p03845 (python)

Fixed submission:
n = int(input())

time_list = list(map(int,input().split()))

m = int(input())

drink_num_time = []
drink_time = []

for i in range(m):
    drink_num_time.append(list(map(int,input().split())))

normal_time = sum(time_list)


for i in range(m):
    drink_time.append(normal_time+drink_num_time[i][1]-time_list[(drink_num_time[i][0])-1])

for i in range(m):
    print(drink_time[i])

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

time_list = list(map(int,input().split()))

m = int(input())

drink_num_time = []
drink_time = []

for i in range(m):
    drink_num_time.append(list(map(int,input().split())))

normal_time = sum(time_list)


for i in range(m):
    drink_time.append(normal_time+drink_num_time[i][1]-time_list[i])

for i in range(m):
    print(drink_time[i])
Problem p03943 (python)

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

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

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

if a+b = c or a+c = b or b+c = a:
    print("Yes")
else:
    print("No")
Problem p03997 (python)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())

def area():
    return (a+b)*h/2

print(int(area()))

Buggy submission (verdict: Runtime Error):
list = []

for i in range(3):
    list.append(int(input()))

area = (list[0]+list[1])*list[2]/2)


print(int(area))
Problem p03998 (python)

Fixed submission:
sa = list(reversed(input()))
sb = list(reversed(input()))
sc = list(reversed(input()))

turn = sa.pop()

while True:
    if (turn == "a" and not sa) or (turn == "b" and not sb) or (turn == "c" and not sc):
        break
    elif turn == "a":
        turn = sa.pop()
    elif turn == "b":
        turn = sb.pop()
    else:
        turn = sc.pop()

print(turn.upper())

Buggy submission (verdict: Runtime Error):
sa = list(reversed(input()))
sb = list(reversed(input()))
sc = list(reversed(input()))

turn = sa.pop()

while True:
    if (turn == "a" and not sa) or (turn == "b" and not sb) or (turn == "c" and not sc):
        break
    elif turn == "a":
        turn = sa.pop()
    elif turn == "b":
        turn = sb.pop()
    else turn == "c":
        turn = sc.pop()

print(turn.upper())
Problem p04011 (python)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())

price = 0

for i in range(1,n+1):
    if i < k+1:
        price += x
    else:
        price += y

print(price)

Buggy submission (verdict: Runtime Error):
n = int(input())
k = int(input())
x = int(input())
y = int(input())

price = 0

for i in range(1,n+1):
    if i < k+1:
        price += x
    elif:
        price += y

print(price)
Problem p04029 (python)

Fixed submission:
n = int(input())
counter = 1
number = 0
for i in range(1,n+1):
    number += counter
    counter += 1

print(number)

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

total = 0

for i in range(n+1):
    total += i

print(total)

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

total = 0

for i in range(n+1):
    total += i

print(total)

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

total = 0

for i in range(n+1):
    total += i

print(total)
Problem p04030 (python)

Fixed submission:
s = input()
s_list = []
input_list = []

for i in range(len(s)):
    s_list.append(s[i])

for i2 in range(len(s)):
    if s_list[i2] == "0":
        input_list.append("0")
    elif s_list[i2] == "1":
        input_list.append("1")
    elif input_list == []:
      pass
    else:
      input_list.pop(-1)
      

for i3 in range(len(input_list)):
    print(input_list[i3],end="")

Buggy submission (verdict: Runtime Error):
s = input()
s_list = []
input_list = []

for i in range(len(s)):
    s_list.append(s[i])

for i2 in range(len(s)):
    if s_list[i2] == "0":
        input_list.append("0")
    elif s_list[i2] == "1":
        input_list.append("1")
    elif s_list[i2] == "B" and input_list != 0:
        input_list.pop(-1)
    else:
        pass

for i3 in range(len(input_list)):
    print(input_list[i3],end="")