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

Fixed submission:
#!/usr/bin/python
# -*- coding:utf-8 -*-

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

print(max([a + b, a - b, a * b]))

Buggy submission (verdict: Runtime Error):
#!/usr/bin/python
# -*- coding:utf-8 -*-

n = int(input())
s = input()

m = n
for i in range(0, n):
    left = s[:i].count('W')
    right = s[i:].count('E')
    if left + right < m:
        m = left + right
print(m)
Problem p03826 (python)

Fixed submission:
# -*- coding: utf-8 -*-

def main():
    a, b, c, d = map(int, input().split())

    print(a * b) if a * b > c * d else print(c * d)

if __name__ == '__main__':
    main()

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import math

def main():
    T = 1000000007

    print(math.factorial(int(input())))

if __name__ == '__main__':
    main()
Problem p03860 (python)

Fixed submission:
a, b, c = input().split()
print("A" + b[0] + "C")

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

d = 0
if a == 0:
    d = 1

print(int((b - a) / c + d))
Problem p03337 (python)

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

Buggy submission (verdict: Runtime Error):
N=int(input())
S=input()
result=0
for i in range(a,N):
  tmp = len(set(S[:i] & set(S[i:]))
  if result<tmp:
     result = tmp
print(result)
Problem p03352 (python)

Fixed submission:
a=int(input())

res=0

for i in range(1,1000):
    for j in range(2,10):
        if res<i**j and i**j<=a:
            res=i**j

print(res)

Buggy submission (verdict: Runtime Error):
a=int(input())
int res = 0
for i in range(1,1000):
  for j in range(2,10):
    if res<i**j and i**j<=a:
        res=i**j
print(res)

Buggy submission (verdict: Runtime Error):
int a=input()
res = 0
for i in range(1,1000):
  for j in range(2,10):
    if res<i**j and i**j<=a:
      res=i**j
print(res)

Buggy submission (verdict: Runtime Error):
int a=input()
res = 0
for i in range(1,1000):
  for j in range(2,10):
    if res<i**j and i**j<=a:
      res=i**j
print(res)

Buggy submission (verdict: Runtime Error):
int a=input()
res = 0
for i in range(1,1000):
  for j in range(2,10):
    if res>i**j and i**j<=a;
      res=i**j
print(res)
Problem p03338 (python)

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

ans=0
for i in range(2,n):
	x=set(list(s[:i]))
	y=set(list(s[i:]))
	sum=x&y
	ans=max(ans,len(sum))

print(ans)

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

ans=0
for i in range(2,n)
	x=set(list(s[:i]))
	y=set(list(s[i:]))
	sum=x&y
	ans=max(ans,len(sum))

print(ans)
Problem p03337 (python)

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

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

Buggy submission (verdict: Runtime Error):
a,b = map(int,raw_input().split())
print(max(a+b,a-b,a*b))
Problem p03351 (python)

Fixed submission:
a,b,c,d = map(int,input().split())
if abs(a-b)<=d:
        if abs(b-c)<=d:
                print("Yes")
        else:
                print("No")
elif abs(a-c)<=d:
        print("Yes")
else:
        print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
if abs(a-b)<=d:
        if abs(b-c)<=d:
                print("Yes")
        elif:
                print('No')
elif abs(a-c)<=d:
        print("Yes")
else:
        print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
if abs(a-b)<=d:
        if abs(b-c)<=d:
                print("Yes")
        elif:
                print('No')
elif abs(a-c)<=d:
        print("Yes")
else:
        print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
if abs(a-b)<=d:
        if abs(b-c)<=d:
                print("Yes")
        elif:
                print('No')
elif abs(a-c)<=d:
        print("Yes")
else:
        print("No")

Buggy submission (verdict: Runtime Error):
,b,c,d = map(int,input().split())
if abs(a-b)<=d:
        if abs(b-c)<=d:
                print("Yes")
if abs(a-c)<=d:
        print('Yes')
else:
        print("No")

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,raw_input().split())
if abs(a-b)<=d:
        if abs(b-c)<=d:
                print'Yes'
else:
        print'No'
Problem p03623 (python)

Fixed submission:
x,a,b = map(int,raw_input().split())
if abs(x-a) > abs(x-b):
    print "B"
else:
    print "A"

Buggy submission (verdict: Runtime Error):
x,a,b = map(int,raw_input.split())
if abs(x-a) > abs(x-b):
    print "B"
else:
    print "A"
Problem p03624 (python)

Fixed submission:
s2 = "abcdefghijklmnopqrstuvwxyz"
s2 = set(s2)
s = set(raw_input())
if len(s) == 26:
    print "None"
a = list(s2 -s)
if len(a) >0:
  a.sort()
  print a[0]

Buggy submission (verdict: Runtime Error):
s2 = "abcdefghijklmnopqrstuvwxyz"
s2 = set(s2)
s = set(raw_input())
if len(s) == 26:
    print "None"
a = list(s2 -s)
print a[0]
Problem p03814 (python)

Fixed submission:
s = raw_input()
memo1 = []
memo2 = 0
cnt = 0
for x in s:
    if x == "A":
        memo1.append(cnt)
    elif x == "Z":
        memo2 = cnt
    cnt += 1

print memo2 - memo1[0] + 1

Buggy submission (verdict: Runtime Error):
s = raw_input()
memo1 = 0
memo2 = 0
cnt = 0
for x in s:
    if x = "A":
        memo1 = cnt
    elif x = "Z":
        memo2 = cnt
    cnt += 1

print memo2 - memo1 + 1
Problem p03826 (python)

Fixed submission:
a,b,c,d = map(int,raw_input().split())
if a*b >= c*d:
    print a*b
else:
    print c*d

Buggy submission (verdict: Runtime Error):
a,b,c,d = map(int,raw_input().split())
if a*b >= c*d:
    print a*b
else:
    print c*d
Problem p03827 (python)

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

cnt =0
x =[0]
for i in xrange(n):
    if s[i] == 'I':
        cnt += 1
        x.append(cnt)
    elif s[i]  == 'D':
        cnt -= 1
        x.append(cnt)

print max(x)

Buggy submission (verdict: Runtime Error):
n = int(raw_input())
s = raw_input()
x = []
cnt = 0
for i in s:
    if s[i] == 'I':
        cnt += 1
        x.append(cnt)
    elif s[i] == 'D':
        cnt -= 1
        x.append(cnt)
    else:
        x.append(cnt)
print max(x)

Buggy submission (verdict: Runtime Error):
n = int(raw_input())
s = raw_input()
x = []
cnt = 0
for i in s:
if s[i] == 'I':
cnt += 1
x.append(cnt)
elif s[i] == 'D':
cnt -= 1
x.append(cnt)
else:
x.append(cnt)
print max(x)

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

x = []
cnt = 0
for i in s:
    if s[i] == 'I':
        cnt += 1
        x.append(cnt)
    elif s[i] == 'D':
        cnt -= 1
        x.append(cnt)
    else:
       x.append(cnt)

print max(x)
Problem p03828 (python)

Fixed submission:
import math

def factorization(n):
    def factor_sub(n, m):
        c = 0
        while n % m == 0:
            c += 1
            n /= m
        return c, n
    #
    buff = []
    c, m = factor_sub(n, 2)
    if c > 0: buff.append((2, c))
    c, m = factor_sub(m, 3)
    if c > 0: buff.append((3, c))
    x = 5
    while m >= x * x:
        c, m = factor_sub(m, x)
        if c > 0: buff.append((x, c))
        if x % 6 == 5:
            x += 2
        else:
            x += 4
    if m > 1: buff.append((m, 1))
    return buff

def divisor_num(n):
    a = 1
    for _ , x in factorization(n):
        a *= x + 1
    return a

n = int(raw_input())
nx = math.factorial(n)
print divisor_num(nx) % (10**9 + 7)

Buggy submission (verdict: Runtime Error):
import math

def num_divisors(n):
    return reduce(lambda x, y: x * (y[1] + 1), factorize(n), 1)

def factorize(n):
    f = ()
    for m in gen_prime_candidates():
        if m * m > n:
            break
        e, n = calc_exp(n, m)
        if e:
            f = f + ( (m, e), )
    if n != 1:
        f = f + ( (n, 1), )
    return f

n = int(raw_input())
nx = factorial(n)

print num_divisors(nx) % 10**9 + 7
Problem p03844 (python)

Fixed submission:
DATA = []
DATA = raw_input().split()
A = int(DATA[0])
op = str(DATA[1])
B = int(DATA[2])

if op == '+':
    print A + B

elif op == '-' :
    print A - B

Buggy submission (verdict: Runtime Error):
#input
T = []
N = int(raw_input())
T = raw_input().split()
M = int(raw_input())
PX = []
X = 0
T1 = []

#input matrix
for i in range(M):
    PX.append(map(int,raw_input().split()))


for j in range(M):
    #new time
    T1 = T[:]
    PJ = PX[j][0]
    XJ = PX[j][1]
    a = int(PJ)
    b = int(XJ)
    T1[a-1] = b

    #plus each time
    X = 0
    for k in range(N):
            X += int(T1[k])
    print X
Problem p03860 (python)

Fixed submission:
# -*- coding: utf-8 -*-

x = raw_input()
a = x.split()[0]
s = x.split()[1]
b = x.split()[2]

print a[0]+s[0]+b[0]

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

a, b, x = map(int,raw_input().split())
cnt = 0

for i in range(a,b+1):
    if i % x == 0:
        cnt = cnt + 1

print int(cnt)

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

a, b, x = map(int,raw_input().split())
cnt = 0

for i in range(a,b):
    if i % x == 0:
        cnt = cnt + 1

print int(cnt)

Buggy submission (verdict: Runtime Error):

a, b, x = map(int,raw_input().split())
cnt = 0

for i in range(a,b):
    if i % x = 0:
        cnt = cnt + 1

print int(cnt)
Problem p03943 (python)

Fixed submission:
#prepare
f = True
List = []
#input
List = map(int,raw_input().split())

#evaluate
List.sort()

if not List[0]+List[1] == List[2]:
    f = False

#output
if f:
    print 'Yes'
else:
    print 'No'

Buggy submission (verdict: Runtime Error):
#prepare
f = True
List = []
#input
List.append(map(int,raw_input().split()))

#evaluate
List.sort()
if not List[0]+List[1] == List[2]:
    f = False

#output
if f:
    print 'YES'
else:
    print 'NO'
Problem p03337 (python)

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

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

ans = n
for i in range(len(s)):
	ans = min(ans, s[:i][:-1].count("W") + s[i:].count("E"))
	
print(ans)
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
x,y = map(int, input().split())
if a*b %2 = 0: print("Even")
if a*b %2 = 1: print("Odd")
Problem p03337 (python)

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

# output
print(max(a+b,a-b,a*b))

Buggy submission (verdict: Runtime Error):
# input
a, b = (int(i) for i in input().split())

def calc(a, b):
    r1 = a + b
    r2 = a - b
    r3 = a * b

    if r1 >= r2 and r1 >= r3:
        return r1
    elif r1 =< r2 and r2 >= r3:
        return r2
    elif r1 =< r3 and r2 =< r3:
        return r3

# output
print(calc(a, b))
Problem p03479 (python)

Fixed submission:
# coding: utf-8

# input
x, y = map(int, input().split())

# main
li = []
while x <= y:
    li.append(x)
    x *= 2

print(len(li))

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

# main
c = 0
while x <= y:
    x *= 2
    c += 1

print(count)
Problem p03337 (python)

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

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

ans = 0
r=0
xor_temp = 0
sum_temp = 0
for l in range(N):
	while r<N and (xor_temp^A[r] == sum_temp+A[r]):
		xor_temp = xor_temp^A[r]
		sum_temp = sum_temp+A[r]
		r += 1
	xor_temp = xor_temp^A[l]
	sum_temp = sum_temp-A[l]
	ans += r-l
print (ans)
Problem p03340 (python)

Fixed submission:
N = int(input())
A = [int(x) for x in input().split()]

ans = 0
r=0
xor_temp = 0
sum_temp = 0
for l in range(N):
	while r<N and (xor_temp^A[r] == sum_temp+A[r]):
		xor_temp = xor_temp^A[r]
		sum_temp = sum_temp+A[r]
		r += 1
	xor_temp = xor_temp^A[l]
	sum_temp = sum_temp-A[l]
	ans += r-l
print (ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split())

ans = 0
r=0
xor_temp = 0
sum_temp = 0
for l in range(N):
	while r<N and (xor_temp^A[r] == sum_temp+A[r]):
		xor_temp = xor_temp^A[r]
		sum_temp = sum_temp+A[r]
		r += 1
	xor_temp = xor_temp^A[l]
	sum_temp = sum_temp-A[l]
	ans += r-l
print (ans)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split())

ans = 0
for l in range(N):
	xor_temp = A[l]
	sum_temp = A[l]
	ans += 1
	r=l+1
	while r<N and (xor_temp^A[r] == sum_temp+A[r]):
		xor_temp = xor_temp^A[r]
		sum_temp = sum_temp+A[r]
		ans += 1
		r += 1
print (ans)
Problem p03355 (python)

Fixed submission:
S = str(input())
K = int(input())
 
sub = set()
for i in range(1,min(K, len(S))+1):
    for j in range(len(S)-i+1):
        sub.add(S[j:j+i])
m=list(sub)
m.sort()
print(m[K-1])

Buggy submission (verdict: Runtime Error):
S = str(input())
K = int(input())

sub = set()
for i in range(1,min(K, len(S))+1):
    for j in range(len(S)-K+1):
        sub.add(S[j:j+i])
m=list(sub)
m.sort()
print(m[K-1])
Problem p03351 (python)

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

if abs(c-a) <= d:
	print('Yes')
elif abs(b-a) <= d and abs(c-b) <= d:
	print('Yes')
else:
	print('No')

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

if abs(c-a) <= d:
	print(“Yes”)
elif abs(b-a) + abs(c-b) <= 2*d:
	print(“Yes”)
else:
	print(“No”)

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

if abs(c-a) <= d:
	print(“Yes”)
elif abs(b-a) + abs(c-b) <= 2*d:
	print(“Yes”)
else:
	print(“No”)

Buggy submission (verdict: Runtime Error):
a,b,c,d = (int(i) for i in input().split())

if abs(c-a) <= d:
	print(“Yes”)
elif abs(b-a) + abs(c-b) <= 2*d:
	print(“Yes”)
else:
	print(“No”)

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

if abs(N[2]-N[0]) <= N[3]:
	print(“Yes”)
elif abs(N[1]-N[0])+abs(N[2]-N[1]) <= 2*N[3]:
	print(“Yes”)
else:
	print(“No”)

Buggy submission (verdict: Runtime Error):
N = [int(i) for i in input().split()]
     
if abs(N[2]-N[0]) <= N[3]:
	print(“Yes”)
elif abs(N[1]-N[0])+abs(N[2]-N[1]) <= 2*N[3]:
	print(“Yes”)
else:
	print(“No”)

Buggy submission (verdict: Runtime Error):
N = [int(i) for i in input().split()]
     
if abs(N[2]-N[0]) <= N[3]:
  print(“Yes”)
elif abs(N[1]-N[0])+abs(N[2]-N[1]) <= 2*N[3]:
  print(“Yes”)
else:
  print(“No”)

Buggy submission (verdict: Runtime Error):
N = list(int(i) for i in input().split())

if abs(N[2]-N[0]) <= N[3]:
	print(“Yes”)
elif abs(N[1]-N[0])+abs(N[2]-N[1]) <= 2*N[3]:
	print(“Yes”)
else:
	print(“No”)

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

if abs(N[2]-N[0]) <= N[3]:
	print(“Yes”)
elif abs(N[1]-N[0])+abs(N[2]-N[1]) <= 2*N[3]:
	print(“Yes”)
else:
	print(“No”)

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

if abs(N[2]-N[0]) <= N[3]:
	print(“Yes”)
elif abs(N[1]-N[0])+abs(N[2]-N[1]) <= 2*N[3]:
	print(“Yes”)
else:
	print(“No”)

Buggy submission (verdict: Runtime Error):
N = raw_input().split()

if abs(N[2]-N[0]) <= N[3]:
	print(“Yes”)
elif abs(N[1]-N[0])+abs(N[2]-N[1]) <= 2*N[3]:
	print(“Yes”)
else:
	print(“No”)

Buggy submission (verdict: Runtime Error):
N = raw_input().split()

if N[2]-N[0] <= N[3]:
	print(“Yes”)
elif N[1]-N[0]+N[2]-N[1] <= 2*N[3]:
	print(“Yes”)
else:
	print(“No”)
Problem p03363 (python)

Fixed submission:
N = int(input())
A = list(int(i) for i in input().split())
B = []
B.append(0)
n = 1
cnt = 0

for i in A:
    B[0] += i
    B.append(B[0])
B[0] = 0
B.sort()

for i in range(1,N+1):
    if B[i] == B[i-1]:
        n += 1
    else:
        cnt += int(n*(n-1)/2)
        n = 1

cnt += int(n*(n-1)/2)

print(cnt)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(int(i) for i in input().split())
B = []
B.append(0)
n = 1
cnt = 0

for i in A:
    B[0] += i
    B.append(B[0])
B[0] = 0
B.sort()

for i in range(1,N+1):
    if B[i] == B[i-1]:
        n += 1
    else:
        cnt += int(n*(n-1)/2)
        n = 1

cnt += int(n*(n-1)/2)6

print(cnt)
Problem p03399 (python)

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
D = int(input())

if A > B:
    if C > D:
        print("%d" % (B+D))
    else:
        print("%d" % (B+C))
else:
    if C > D:
        print("%d" % (A+D))
    else:
        print("%d" % (A+C))

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(int(i) for i in input().split())
A.insert(0, 0)
A.append(0)
Q = 0
j=0

for i in range(N):
    while j < N + 1:
        if j == i:
            Q += abs(A[j] - A[j+2])
            j += 1
        else:
            Q += abs(A[j] - A[j+1])
        j += 1
    print("%d" % (Q))
    Q = 0
    j = 0

Buggy submission (verdict: Runtime Error):
import copy

N = int(input())
A = list(int(i) for i in input().split())
A.insert(0, 0)
A.append(0)
B = copy.deepcopy(A)
Q = 0

for i in range(N):
    A.pop(i+1)
    for j in range(N):            
        Q += abs(A[j] - A[j+1])
    print("%d" % (Q))
    Q = 0
    A = copy.deepcopy(B)
Problem p03337 (python)

Fixed submission:
a, b = map(int, input().split())
c=a+b
d=a-b
e=a*b
print(max([c,d,e]))

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

Buggy submission (verdict: Runtime Error):
C = A+B
D = A-B
E = A*B
print (max([C,D,E]))
Problem p03337 (python)

Fixed submission:
a = input().rstrip().split()
A = int(a[0])
B = int(a[1])

print(max(A+B, A-B,A*B))

Buggy submission (verdict: Runtime Error):
N = int(input())
S = list(input().rstrip())

count_list = []
for i in range(N):
    count = 0
    for j in range(i):
        if S[j] == 'W':
            count += 1
    for j in range(N-i-1):
        if S[i+j+1] == 'E':
            count += 1

    
    count_list.append(count)

print(min(count_list))
Problem p03359 (python)

Fixed submission:
numbers = input().split()
a = int(numbers[0])
b = int(numbers[1])
i = 1
while True:
    if a != i:
        i += 1
        continue
    else:
        if b < i:
            print(i - 1)
            break
        else:
            print(i)
            break

Buggy submission (verdict: Runtime Error):
numbers = map(int, raw_input().split())
a = numbers[0]
b = numbers[1]
i = 1
while True:
    if a != i:
        i += 1
        continue
    else:
        if b < i:
            print(i - 1)
            break
        else:
            print(i)
            break
Problem p03448 (python)

Fixed submission:
c500 = int(input())
c100 = int(input())
c50 = int(input())
t = int(input())
s = 0

for a in range(0, c500 + 1):
    for b in range(0, c100 + 1):
        for c in range(0, c50 + 1):
            if 500*a + 100*b + 50*c == t:
                s = s + 1
print(s)

Buggy submission (verdict: Runtime Error):
c500 = int(input())
c100 = int(input())
c500 = int(input())
t = int(input())
s = 0

for a in range(0, c500 + 1):
    for b in range(0, c100 + 1):
        for c in range(0, c50 + 1):
            if 500*a + 100*b + 50*c == t:
                s = s + 1
print(s)
Problem p03455 (python)

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

Buggy submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
# input separated integers
a, b = map(int, input().split())
if a*b % 2 == 1:
  print '0dd'
else:
  print 'Even'
Problem p03478 (python)

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

while a > 0:
    a1 = a
    l = []
    while a1 >= 1:
        l.append(int(a1 % 10))
        a1 = a1 / 10
    if sum(l) >= b and sum(l) <= c:
        a2 = a2 + a

    a = a - 1
print(a2)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
a2 = 0
l = []

while a > 0:
    a1 = a
    while a1 > 1:
        l.append(int(a1 % 10))
        a1 = a1 / 10
    if sum(l) >= b and sum(l) <= c:
        a2 = a2 + a
    l = []
    a = a - 1
print(a2)
Problem p03455 (python)

Fixed submission:

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

if (a * b) % 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):

a = int(input())
b = int(input())

if (a * b) % 2 == 0:
    print('Even')
else:
    print('Odd')

Buggy submission (verdict: Runtime Error):

a = int(input())
b = int(input())

if (a * b) % 2 == 0:
    print('even')
else:
    print('Odd')
Problem p03361 (python)

Fixed submission:
import sys

a = sys.stdin.readline().split(' ')
data = sys.stdin.readlines()

S = int(a[0])
H = int(a[1])

dx = [0,1,0,-1]
dy = [1,0,-1,0]

for i in range(S):
    for j in range(H):
        count = 0
        if data[i][j] == '#':
            for k in range(4):
                x = j + dx[k]
                y = i + dy[k]
                if x < 0 or y < 0 or x >= H or y >= S:
                    continue
                else:
                    if data[y][x] == "#":
                        count = count+1
            if count == 0:
                print('No')
                sys.exit()


print('Yes')

Buggy submission (verdict: Runtime Error):
import sys

a = sys.stdin.readline().split(' ')
data = sys.stdin.readlines()

S = int(a[0])
H = int(a[1])

dx = [0,1,0,-1]
dy = [1,0,-1,0]

ans = 'Yes'
if S == 1 and H == 1:
    continue
else:
    for i in range(S):
        for j in range(H):
            if data[i][j] == '.':
                continue
            else:
                for k in range(4):
                    x = j + dx[k]
                    y = i + dy[k]
                    if x < 0 or y < 0 or x >= H or y >= S:
                        continue
                    else:
                        if data[y][x] == "#":
                            ans = 'Yes'
                            break
                        else:
                            ans = 'No'
                            continue

print(ans)