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

Fixed submission:
n,h,w = input().split()
a = [0] * int(n)
b = [0] * int(n)
i = 0
while i < int(n):
    a[i],b[i] = input().split()
    i = i + 1

i = 0
flag = 0

while i < int(n):
    if int(a[i]) >= int(h) and int(b[i]) >= int(w):
        flag = flag + 1
    i = i + 1
print(flag)

Buggy submission (verdict: Runtime Error):
n = int(input())
h = int(input())
w = int(input())
a = []
b = []
i = 1
while i <= n:
    a.append(int(input))
    b.append(int(input))

i = 0
flag = 0

while i < n:
    if a[i] >= h and b[i] >=w:
        flag = flag + 1
    i = i + 1
print(flag)
Problem p03206 (python)

Fixed submission:
D = int(input())
a = abs(D-25)
C = list('Christmas')
for i in range(a):
  C.append(' ')
  C.append('E')
  C.append('v')
  C.append('e')
  
print(''.join(C))

Buggy submission (verdict: Runtime Error):
n,k = map(int,input().split())
list = []
for i in range(n):
  list.append(int(input()))
list.sort()
min = list[n-1]
for j in range(n-k+1):
  if list[j+k-1]-list[j] < min:
    min = list[j+k-1]-list[j]
print(min)
Problem p03238 (python)

Fixed submission:
if int(input()) == 2:
  print(int(input())+int(input()))
else:
  print('Hello World')

Buggy submission (verdict: Runtime Error):
if int(input()) == 2:
  print(int(input())+int(int(input())
else:
  print('Hello World')
Problem p04029 (python)

Fixed submission:
n = int(input())
sum = 0
for i in range(n):
  sum += i+1
print(sum)

Buggy submission (verdict: Runtime Error):
r = int(input())
sum = 0
for i in range(n):
  sum += i+1
print(sum)
Problem p04043 (python)

Fixed submission:
list1 = list(map(int,input().split()))
list1.sort()
if list1[0]==5 and list1[1]==5 and list1[2]==7:
  print("YES")
else:
  print("NO")

Buggy submission (verdict: Runtime Error):
list1 = list(map(int,input().split()))
list1.sort()
if list1[0] == 5 and list[1] ==7 and list[2]==7:
  print("YES")
else:
  print("NO")
Problem p03597 (python)

Fixed submission:
N=int(input())
A=int(input())
print(N*N-A)

Buggy submission (verdict: Runtime Error):
N=input()
A=input()
print(N*N-A)
Problem p03693 (python)

Fixed submission:
s=input().split()
s=int(''.join(s))
if s%4==0:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
s=int(input().replace(' ',''))
print(['YES','NO'][s%4])

Buggy submission (verdict: Runtime Error):
s=input()
print(['YES','NO'][int(s.replace(' ',''))%4])

Buggy submission (verdict: Runtime Error):
print(['YES','NO'][int(input().replace(' ',''))%4])

Buggy submission (verdict: Runtime Error):
print(['YES','NO'][int(input().replace(' ',''))%4])
Problem p03943 (python)

Fixed submission:
a,b,c=sorted(map(int,input().split()))
if a+b==c:
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
d=[]
d.append(a)
d.append(b)
d.append(c)
d.sort()
if a[0]+a[1]==a[2]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a=list(map(int,input().split())).sort()
if a[0]+a[1]==a[2]:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
a=list(map(int,input())).sort()
if a[0]+a[1]==a[2]:
  print('YES')
else:
  print('NO')
Problem p04043 (python)

Fixed submission:
s=input()
if s.count('5')==2 and s.count('7')==1:
  print('YES')
else:
  print('NO')

Buggy submission (verdict: Runtime Error):
n,l = map(int, input().split())
s = sorted([input() for i in range(n)])
print(*s, sep="")

Buggy submission (verdict: Runtime Error):
n,m=map(int,input().split())
s=[input() for i in range(n)]
s=sorted(s)
print(''.join(s))

Buggy submission (verdict: Runtime Error):
s=input()
cnt=int(s[0])
l=[]
for i in range(cnt):
  l.append(input())
l=sorted(l)
print(''.join(l))

Buggy submission (verdict: Runtime Error):
cnt=int(input()[0])
l=[]
for i in range(cnt):
  l.append(input())
l=sorted(l)
print(''.join(l))
Problem p02784 (python)

Fixed submission:
enemy,skill=map(int,input().split())
damage=map(int,input().split())
if(enemy-sum(damage)<=0):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
enemy=int(input())
skill=int(input())
for i in range(skill):
    damage=int(input())
    enemy=enemy-damage
if(enemy<=0):
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
enemy,skill=map(int,input().split())
for i in range(skill):
    damage=int(input())
    enemy=enemy-damage
if(enemy<=0):
    print("Yes")
else:
    print("No")
Problem p02945 (python)

Fixed submission:
a,b=map(int,input().split())
c=a+b
if a-b>c:
    c=a-b
if a*b>c:
    c=a*b
print(c)

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

c=a+b
if a-b>c:
    c=a-b
if a*b>c:
    c=a*b
print(c)

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

c=a+b
if a-b>c:
    c=a-b
if a*b>c:
    c=a*b
print(c)
Problem p03101 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print (a*b-(b*c+a*d-c*d))

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
d=int(input())
print (a*b-(b*c+a*d-c*d))

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
d=input()

aa=int(a)
bb=int(b)
cc=int(c)
dd=int(d)
print (aa*bb-(bb*cc+aa*dd-cc*dd))

Buggy submission (verdict: Runtime Error):
a=input()
b=input()
c=input()
d=input()

aa=int(a)
bb=int(b)
cc=int(c)
dd=int(d)
print (aa*bb-(bb*cc+aa*dd-cc*dd))
Problem p03105 (python)

Fixed submission:
a,b,c = map(int,input().split())
if a*c<b:
    print(c)
else:
    print(b//a)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
if a*c<b:
    print(c)
else:
    print(b/a)

Buggy submission (verdict: Runtime Error):
a=int(input())
b=int(input())
c=int(input())
if a*b<c:
    print(c)
else:
    print(b/a)

Buggy submission (verdict: Runtime Error):
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        int b=sc.nextInt();
        int c=sc.nextInt();
        if(a*c<b){
            System.out.println(c);
        }else{
            System.out.println(b/a);
        }
    }   
}
Problem p03238 (python)

Fixed submission:
a=int(input())
if a==1:
    print("Hello World")
if a==2:
    b=int(input())
    c=int(input())
    print(b+c)

Buggy submission (verdict: Runtime Error):
a=int(input())
if a==1:
    print("Hello World")
if a==2:
    b,c = map(int, input().split())
    print(b+c)
Problem p02801 (python)

Fixed submission:
small_alpha = str(input())
alpha_list = [chr(ord('a') + i) for i in range(26)]
for num, alpha in enumerate(alpha_list):
    if alpha == small_alpha:
        print(alpha_list[num + 1])

Buggy submission (verdict: Runtime Error):
total_subjects, max_points, target_points = map(int, input().split())
subject_points = list(map(int, input().split()))

calc_result = (total_subjects * target_points) - sum(subject_points)

if calc_result > max_points:
    print(-1)
elif calc_result < 0:
    print(0)
else:
    print(calc_result)

Buggy submission (verdict: Runtime Error):
total_subjects, max_points, target_points = map(int, input().split())
subject_points = list(map(int, input().split()))

calc_result = total_subjects * target_points - sum(subject_points)

if calc_result > max_points:
    print(-1)
elif calc_result < 0:
    print(0)
else:
    print(calc_result)

Buggy submission (verdict: Runtime Error):
total_subjects, max_points, target_points = map(int, input().split())
subject_points = input().split()
total_points = 0

for subject_point in subject_points:
    total_points += int(subject_point)

calc_result = total_subjects * target_points - total_points

if calc_result > max_points:
    print(-1)
elif calc_result < 0:
    print(0)
else:
    print(calc_result)
Problem p03434 (python)

Fixed submission:
n = int(input())
a = [int(i) for i in input().split()]
a.sort(reverse=True)
print(sum(a[0::2]) - sum(a[1::2]))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = list(input().split())
a.sort(reverse=True)
print(sum(a[0::2]) - sum(a[1::2]))
Problem p03470 (python)

Fixed submission:
n = int(input())
print(len(set(map(int, [input() for _ in range(n)]))))

Buggy submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(n + 1):
    for j in range(n - i + 1):
        if i * 10000 + j * 5000 + (n - i - j) * 1000 == y:
            print("{0} {1} {2}".format(i, j, (n - i - j)))
            exit(0)
Problem p03493 (python)

Fixed submission:
print(input().count("1"))

Buggy submission (verdict: Runtime Error):
n = int(input())
a = []
counter = 0
a = input().split()
success_result = [0] * n
while True:
    for index, item in enumerate(a):
        if int(item) % 2 == 0:
            a[index] = int(item) / 2
            success_result[index] = True
        else:
            continue
    if all(success_result):
        counter += 1
        success_result = [None for _ in range(n)]
    else:
        break
print(counter)

Buggy submission (verdict: Runtime Error):
    n = int(input())
    a = []
    count = 0
    for i in range(n):
        a.append(input())
    while True:
        for index, item in enumerate(a):
            if item % 2 == 0:
                a[index] = item / 2
                count += 1
            else:
                break
    print(count)
Problem p02900 (python)

Fixed submission:
import math as m
import fractions as fr

def is_prime(n): #素数かどうか判定
    if n == 1: return False
    for k in range(2, int(m.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True

def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table   

a, b = map(int, input().split())
g = fr.gcd(a,b)
tb = divisor(g)

count = 1
for i in tb:
    if is_prime(i):
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import math as m
import fractions as fr

def is_prime(n): #素数かどうか判定
    if n == 1: return False
    for k in range(2, int(m.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True

def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table   

a, b = map(int, input().split())
g = fr.gcd(a,b)
tb = divisor(g)

count = 1
for i in tb:
    if is_prime(i):
        count += 1

print(count)

def is_prime(n): #素数かどうか判定
    if n == 1: return False
    for k in range(2, int(m.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True

def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table   

a, b = map(int, input().split())
g = m.gcd(a,b)
tb = divisor(g)

count = 1
for i in tb:
    if is_prime(i):
        count += 1

print(count)

Buggy submission (verdict: Runtime Error):
import math as m

def is_prime(n): #素数かどうか判定
    if n == 1: return False
    for k in range(2, int(m.sqrt(n)) + 1):
        if n % k == 0:
            return False
    return True

def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table   

a, b = map(int, input().split())
g = m.gcd(a,b)

tb = divisor(g)

count = 1
for i in tb:
    if is_prime(i):
        count += 1

print(count)
Problem p02922 (python)

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

if b > 1:
    c = 1
    for i in range(1,21):
        c = c + (a - 1)
        if c >= b:
            print(i)
            break
else:
    print(0)

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

if b > 1:
    c = 1
    for i in range(1,21):
        c = c + (a - 1)
        if c >= b:
            print(i)
            break
else:
    print(0)

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

if b > 1:
    c = 1
    for i in range(1,21):
        c = c + (a - 1)
        if c >= b:
            print(i)
            break
else:
    print(0)

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

if b > 1:
    c = 1
    for i in range(1,21):
        c = c + (a - 1)
        if c >= b:
            print(i)
            break
else:
    print(0)
Problem p03000 (python)

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

cd = 0
ans = n + 1 # xに到達しない場合

for i in range(n):
    cd += l[i]
    if cd > x:
        ans = i + 1
        break

print(ans)

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

cd = 0
for i in range(n):
    cd += l[i]
    if cd > x:
        ans = i + 1
        break

print(ans)
Problem p03220 (python)

Fixed submission:
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))

res = abs(a - (t - h[0] * 0.006))
ans = 1
for i in range(len(h)):
    x = h[i]
    res_n = abs(a - (t - x * 0.006))
    # print(res_n)
    if res > res_n:
        res = res_n
        ans = i + 1

print(ans)

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

res = 200
for i in range(len(h)):
    x = h[i]
    res_n = abs(a - (t - x * 0.006))
    # print(res_n)
    if res > res_n:
        res = res_n
        ans = i

print(ans + 1)
Problem p03262 (python)

Fixed submission:
from fractions import gcd

N, X = map(int, input().split())
x = list(map(int, input().split()))

g = abs(max(x) - X)
for i in range(N):
    g = gcd(abs(x[i] - X), g)

print(g)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
x = list(map(int, input().split()))
x.append(X)
x.sort()
d = 10 ** 9

for i in range(N+1):
    d = min(d, x[i+1] - x[i])

print(d)
Problem p03281 (python)

Fixed submission:
def fact(n):
    num = n
    cnt = [0]*(n+1)
    ans = 1
    for i in range(2, n+1):
        while num % i == 0:
            cnt[i] += 1
            num /= i
    for i in range(2, n+1):
        ans *= cnt[i] + 1
    return ans

n = int(input())

res = 0
for i in range(1, n+1):
    if i % 2 == 1 and fact(i) == 8:
        res += 1
print(res)

Buggy submission (verdict: Runtime Error):
n = int(input())
// 3*5*7, 3*5*11, 3*5*13
if n < 3*5*7:
    print(0)
elif n < 3*5*11:
    print(1)
elif n < 3*5*13:
    print(2)
else:
    print(3)
Problem p03282 (python)

Fixed submission:
s = input()
k = int(input())

if len(s) == 1:
    print(s[0])
    exit()

if k == 1:
    print(s[0])
else:
    i = 1
    while i <= k:
        if s[i-1] != '1':
            print(s[i-1])
            break
        elif i == k:
            print(s[i-1])
            break
        i += 1

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

if len(s) == 1:
    print(s[0])
    exit()

if k == 1:
    print(s[0])
else:
    i = 0
    while i <= k:
        if s[i] != '1':
            print(s[i])
            break
        elif i == k:
            print(s[i])
            break
        i += 1

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

if len(s) == 1:
    print(s[0])
    exit()

if k == 1:
    print(s[0])
else:
    i == 0
    while i <= k:
        if s[i] != '1':
            print(s[i])
            break
        elif i == k:
            print(s[i])
            break
        i += 1

Buggy submission (verdict: Runtime Error):
s = input()
k = int(input())

if k == 1:
    print(s[0])
else:
    print(s[1])
Problem p03341 (python)

Fixed submission:
n = int(input())
s = input()

min_n = s[1:].count('E')
tmp_n = min_n
for i in range(1, n):
    tmp_n += s[i-1].count('W') - s[i].count('E')
    min_n = min(tmp_n, min_n)

print(min_n)

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

min_n = s[1:].count('E')
for i in range(1, n):
    tmp_n += s[i-1].count('W') - s[i].count('E')
    min_n = min(tmp_n, min_n)

print(min_n)
Problem p03359 (python)

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

Buggy submission (verdict: Runtime Error):
a, b = map(int, input().split)
if a <= b:
    print(a)
else:
    print(a-1)
Problem p03361 (python)

Fixed submission:
h, w = map(int, input().split())
s = []
for i in range(h):
    s_ = input()
    s.append(s_)

for i in range(w):
    for j in range(h):
        if s[j][i] == '#':
            if j + 1 < h and s[j+1][i] == '#':
                continue
            if j - 1 >= 0 and s[j-1][i] == '#':
                continue
            if i + 1 < w and s[j][i+1] == '#':
                continue
            if i - 1 >= 0 and s[j][i-1] == '#':
                continue
            print('No')
            exit()

print('Yes')

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = []
for i in range(h):
    s_ = input()
    s.append(s_)

for i in range(h):
    for j in range(w):
        if s[j][i] == '#':
            if j + 1 < w and s[i][j+1] == '#':
                continue
            if j - 1 >= 0 and s[i][j-1] == '#':
                continue
            if i + 1 < h and s[i+1][j] == '#':
                continue
            if i - 1 >= 0 and s[i-1][j] == '#':
                continue
            print('No')
            exit()

print('Yes')

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = []
for i in range(h):
    s_ = input()
    s.append(s_)

for i in range(w):
    for j in range(h):
        if s[j][i] == '#':
            if j + 1 < w and s[j+1][i] == '#':
                continue
            if j - 1 >= 0 and s[j-1][i] == '#':
                continue
            if i + 1 < h and s[j][i+1] == '#':
                continue
            if i - 1 >= 0 and s[j][i-1] == '#':
                continue
            print('No')
            exit()

print('Yes')

Buggy submission (verdict: Runtime Error):
h, w = map(int, input().split())
s = []
for i in range(h):
    s_ = input()
    s.append(s_)

b = [[False]*w]*h

for i in range(h):
    for j in range(w):
        if s[j][i] == '#':
            if j + 1 < w and s[j+1][i] == '#':
                continue
            if j - 1 >= 0 and s[j-1][i] == '#':
                continue
            if i + 1 < h and s[j][i+1] == '#':
                continue
            if i - 1 >= 0 and s[j][i-1] == '#':
                continue
            print('No')
            exit()

print('Yes')
Problem p03393 (python)

Fixed submission:
s = input()
a = 'abcdefghijklmnopqrstuvwxyz'

if len(s) < 26:
    for w in a:
        if not w in s:
            print(s + w)
            exit()

if len(s) == 26:
    for i in range(len(s)-2, -1, -1):
        for j in range(len(s)-1, i, -1):
            if s[i] < s[j]:
                print(s[:i]+s[j])
                exit()

print('-1')

Buggy submission (verdict: Runtime Error):
s = input()
a = 'abcdefghijklmnopqrstuvwxyz'
ans = ''

if len(s) < 26:
    for w in a:
        if not w in s:
            ans = s + w
            break

r = ''.join(sorted(a, reverse=True))
if len(s) == 26:
    for i in range(len(s), -1, -1):
        if i == len(s) and r[:i] == s[-i:]:
            print('-1')
            exit()
        if r[:i] == s[-i:]:
            ele = i
            break
    ans = s[:-(ele+1)] + sorted(r[:ele])[0]

print(ans)

Buggy submission (verdict: Runtime Error):
s = input()
a = 'abcdefghijklmnopqrstuvwxyz'
ans = ''
if len(s) < 26:
    for w in a:
        if not w in s:
            ans = s + w
            break
elif s == 'zyxwvutsrqponmlkjihgfedcba':
    ans = '-1'
else:
    l = list(a)
    l.sort(reverse=True)
    l = ''.join(l)
    ele = 0
    for i in range(len(s)):
        if l[:i] == s[-i:]:
            ele = i
    if ele < 25:
        t = s[:-(ele+1)]
        u = l[:ele]+s[-(ele+1):-(ele)]
        u2 = sorted(u)
        ans = t + u2[1]
'''
        for w in a:
            if not w in t and t + w != s[:-ele]:
                ans = t + w
                break
'''
print(ans)
Problem p03417 (python)

Fixed submission:
n, m = map(int, input().split())
# c = [[0]*n for _ in range(m)]

ans = 0
if n == 1 and m == 1:
    ans = 1
elif n == 1:
    ans = m - 2
elif m == 1:
    ans = n - 2
else:
    ans = (n-2)*(m-2)

print(ans)

Buggy submission (verdict: Runtime Error):
n, m = map(int, input().split())
c = [[0]*n for _ in range(m)]

ans = 0
if n == 1 and m == 1:
    ans = 1
elif n == 1:
    ans = m - 2
elif m == 1:
    ans = n - 2
else:
    ans = (n-2)*(m-2)

print(ans)
Problem p03543 (python)

Fixed submission:
n = input()

if (n[0] == n[1] and n[1] == n[2]) or (n[2] == n[3] and n[1] == n[2]):
    print("Yes")
else:
    print("No")

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

if (n[0] == n[1] and n[1] == n[2]) or (n[2] == n[3] and n[1] == n[2]):
    print("Yes")
else
    print("No")
Problem p03699 (python)

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

s.sort()
s_max = sum(s)

if s_max % 10 != 0:
    print(s_max)
    exit()
else:
    for i in s:
        if i % 10 != 0:
            print(s_max - i)
            exit()

print(0)

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

s.sort()
s_max = sum(s)

if s_max % 10 != 0:
    print(s_max)
else:
    for i in s if i % 10 != 0:
        print(s_max - i)
        exit()

print(0)
Problem p03838 (python)

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

b = abs(abs(x)-abs(y))
if x * y < 0:
    print(b+1)
elif 0 < y < x or y < x < 0:
    print(b+2)
elif (y == 0 and x > 0) or (x == 0 and y < 0):
    print(b+1)
else:
    print(b)

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

b = abs(abs(x)-abs(y))
if x * y < 0:
    print(b+1)
elif 0 =< y < x or y < x <= 0:
    print(b+2)
else:
    print(b)
Problem p04025 (python)

Fixed submission:
from statistics import mean
n = int(input())
a = list(map(int, input().split()))
t = round(mean(a))

sum = 0
for i in a:
    sum += (i - t)**2

print(sum)

Buggy submission (verdict: Runtime Error):
from statistics import mean
n = int(input())
a = list(map(int, input().split()))
t = round(mean(a))

sum = 0
for t in a:
    sum += (i - t)**2

print(sum)
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
A = int(input("a = "))
B = int(input("b = "))
C = A*B
print(C)
print(C/2)
if 1 <= A <= 10000 and 1 <= B <= 10000 and C%2 == 0:
    print("Even")
else:
    print("Odd")
Problem p02719 (python)

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

print(ans)

Buggy submission (verdict: Runtime Error):
n, k = map(int,input().split())
ans = 0
if n < k:
    ans = n
else:
    ans = min(n%k,k-n%k))

print(ans)
Problem p03448 (python)

Fixed submission:
def tyoudo(a,b,c,x):
  ans=0
  for i in range(a+1):
    for ii in range(b+1):
      for iii in range(c+1):
        if x==500*i+100*ii+50*iii:
          ans+=1
  return ans
a=int(input())
b=int(input())
c=int(input())
x=int(input())
print(tyoudo(a,b,c,x))

Buggy submission (verdict: Runtime Error):
def tyoudo(a,b,c,x):
  ans=0
  for i in range(a):
    for ii in range(b):
      for iii in range(c):
        if x==500*i+100*ii+50*iii:
          ans+=1
          
  return ans
a=input()
b=input()
c=input()
x=input()
print(tyoudo(a,b,c,x))
Problem p03455 (python)

Fixed submission:
# -*- coding: utf-8 -*-
def seki(a,b):
    if a*b%2==1:
        return "Odd"
    else:
        return "Even"

a,b=map(int,input().split())
print(seki(a,b))

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
def seki(a,b):
    if a*b%2==1:
        return "Even"
    else:
        return "Odd"

a,b=input()
print(seki(a,b))