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

Fixed submission:


a,b = list(map(str, input().split()))


ab = int(a + b)
import math
res = int(math.sqrt(ab))
if res*res == ab:
    print('Yes')
else:
    print('No')

Buggy submission (verdict: Runtime Error):


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

ab = a*10 + b
import math
res = math.sqrt(ab)

if res*res == ab:
    print('Yes')
else:
    print('No')
Problem p02767 (python)

Fixed submission:
N = input()
zyunin_list = [int(i) for i in input().split()]

cost_list = []

for p in range(min(zyunin_list), max(zyunin_list) + 1):
    cost = 0
    for zahyo in zyunin_list:
        cost += (zahyo - p) ** 2
    cost_list.append(cost)

print(min(cost_list))

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

cost_list = []

for p in range(min(zyunin_list), max(zyunin_list)):
    cost = 0
    for zahyo in zyunin_list:
        cost += (zahyo - p) ** 2
    cost_list.append(cost)

print(min(cost_list))
Problem p02999 (python)

Fixed submission:
x,a=map(int, input().split())
if x<a:
	print(0)
else:
	print(10)

Buggy submission (verdict: Runtime Error):
x,a=map(int, input().split())
if x<a:
	return 0
else:
	return 10
Problem p03035 (python)

Fixed submission:
a,b=map(int, input().split())
if a>=13:
	print(b)
elif a>=6:
	print(int(b/2))
else:
	print(0)

Buggy submission (verdict: Runtime Error):
a,b=map(int, input().split())
if a>=13:
	print(b)
elif a>=6:
	print int(b/2)
else:
	print(0)
Problem p03059 (python)

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

Buggy submission (verdict: Runtime Error):
a,b,t=map(int, input().split())
print int((t+0.5)/a*b)
Problem p03062 (python)

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

count = 0
for i in range(N):
    if A[i] < 0:
        count += 1
        
Aabs = [abs(i) for i in A]

if count % 2 == 0:
    print(sum(Aabs))
else:
    mini = min(Aabs)
    print(sum(Aabs) - 2*mini)

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

count = 0
for i in range(N):
    if A[i] < 0:
        count += 1
        
Aabs = [abs(i) for i in A]
print(sum(Aabs))

if count % 2 == 0:
    print(sum(Aabs))
else:
    mini = min(Aabs)
    print(Asum - 2*mini)
Problem p03110 (python)

Fixed submission:
N = int(input())
x = [list(input().split()) for i in range(N)]
print(sum([float(i[0])*380000.0 if i[1] == 'BTC' else float(i[0]) for i in x]))

Buggy submission (verdict: Runtime Error):
N = map(int, input().split())
ans = 0
for i in range(N):
    x, u = input().split()
    if u == 'BTC':
        ans += float(x)*380000.0
    else:
        ans += float(x)
print(ans)
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)

Buggy submission (verdict: Runtime Error):
x = [int(input()) for i in range(3)]
print('Hello World' if x[0]==1 else x[1]+x[2])
Problem p03251 (python)

Fixed submission:
n,m,x,y = map(int,input().split())
xs = max(list(map(int,input().split())))
ys = min(list(map(int,input().split())))
ans = 'War'
if xs+1 <= ys:
    for i in range(xs+1,ys+1):
        if x < i <= y:
            ans = 'No War'
            break
print(ans)

Buggy submission (verdict: Runtime Error):
n, m, x, y = map(int, input().split())
xs = max(list(map(int, input().split())).append(x))
ys = min(list(map(int, input().split())).append(y))
print('No War' if xs < ys else 'War')

Buggy submission (verdict: Runtime Error):
n, m, x, y = map(int, input().split())
xs = max(list(map(int, input().split())).append(x))
ys = max(list(map(int, input().split())).append(y))
print('No War' if xs < ys else 'War')
Problem p03285 (python)

Fixed submission:
def cakes_and_donuts(arg1):
    four = range(( arg1 // 4 ) + 1)
    seven = range(( arg1 // 7 ) + 1)
    for i in seven:
        for p in four:
            if (i*7 + p*4) == arg1:
                return 'Yes'
    return 'No'

N = int(input())
print(cakes_and_donuts(N))

Buggy submission (verdict: Runtime Error):
def det(n):
    seven = range((n // 7) + 1)
    four = range((n // 4) + 1)
    for i in seven:
        for p in four:
            if (i*7 + p*4) == n:
                return 'Yes'
    return 'No'
x = int(input)
print(det(x))

Buggy submission (verdict: Runtime Error):
def det(n)
    if n % 4 == 0:
        return 'Yes'
    elif n % 7 == 0:
        return 'Yes'
    elif n < 4 or (5 <= n and n <= 6):
        return 'No'
    seven = range(n//7 + 1)
    for i in seven:
        if (n - seven*7) % 4 == 0:
            return 'Yes'
    return 'No'
n = int(input())
print(det(n))
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(int, input().split()))
print(max([a+b,a-b,a*b]))

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

Fixed submission:
import numpy as np
def repaint(h,w,s):
    for i in range(1,h+1):
        for p in range(1,w+1):
            if s[i][p] == '#':
                if (s[i-1][p] != '#') and (s[i][p-1] != '#') and (s[i+1][p] != '#') and (s[i][p+1] != '#'):
                    return 'No'
    return 'Yes'
H, W = map(int, input().split())
S = np.array([['0']*(W+2)] + [list('0' + input() + '0') for i in range(H)] +[['0']*(W+2)])
print(repaint(H,W,S))

Buggy submission (verdict: Runtime Error):
def repaint(h, w ,s):
    for i in (1, h+1):
        for p in (1, w+1):
            if s[i][p] == '#':
                if (s[i-1][p] != '#') and (s[i][p+1] != '#') and (s[i+1][p] != '#') and (s[i][p-1] != '#'):
                    return 'No'
    return 'Yes'
H, W = map(int, input().split())
S = [['.']*(w+2)]+[list('.'+input()+'.') for i in range(h)]+[['.']*(w+2)]
print(repaint(H, W, S))

Buggy submission (verdict: Runtime Error):
def repaint(h, w):
    s = [[['.']*(w+2)]+[list('.'+input()+'.') for i in range(h)]+[['.']*(w+2)]]
    for i in (1, h+1):
        for p in (1, w+1):
            if s[i][p] == '#':
                if s[i-1][p] == s[i][p-1] == s[i+1][p] == s[i][p+1] == '.':
                    return 'No'
    return 'Yes'
H, W = map(int, input().split())
print(repaint(H, W))
Problem p03370 (python)

Fixed submission:
N, X = map(int, input().split())
donut = [0]*N
for i in range(N):
    donut[i] = int(input())
min_gram = min(donut)
gram = sum(donut)
dif = X - gram
number = dif // min_gram
print(N + number)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
m = [0]*N
for i in ragne(N):
    m[i] = int(input())
min_donut = min(m)
sum_gram = sum(m)
dif = X - sum_gram
number = dif // min_donut
print(N + number)

Buggy submission (verdict: Runtime Error):
N, X = map(int, input().split())
m = [0]*N
for i in ragne(N):
    m[i] = int(input())
min_donut = min(m)
sum_gram = sum(m)
print(N + ( (X - sum_gram) // min_donut) )
Problem p03373 (python)

Fixed submission:
A, B, C, X, Y = map(int, input().split())
if X < Y:
    cn = range(Y+1)
    p = X
else:
    cn = range(X+1)
    p = Y
min_price = A*X + B*Y
for i in cn:
    if i <= p:
        price = (A*(X-i)+C*i)+(B*(Y-i)+C*i)
        if min_price > price:
            min_price = price
    else:
        if p == X:
            price = C*i+(B*(Y-i)+C*i)
            if min_price > price:
                min_price = price
        else:
            price = (A*(X-i)+C*i) + C*i
            if min_price > price:
                min_price = price
print(min_price)

Buggy submission (verdict: Runtime Error):
A, B, C, X, Y = map(int, input().split())
if X < Y:
    ab = range(Y + 1)
    p = X
else:
    ab = range(X + 1)
    p = Y
min_price = A*X+B*Y
for i in ab:
    if i <= p
        price = A*(X-i)+B*(Y-i)+(2*C*i)
        if min_price > price:
            min_price = price
    else:
        if p == X:
            price = B*(Y-i)+(2*C*i)
            if min_price > price:
                min_price = price
        else:
            price = A*(X-i)+(2*C*i)
            if min_price > price:
                min_price = price
print(min_price)
Problem p03434 (python)

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
Alice = []
Bob = []
while a != []:
    get = max(a)
    Alice.append(get)
    a.remove(get)
    if a != []:
        get = max(a)
        Bob.append(get)
        a.remove(get)
print(sum(Alice) - sum(Bob))

Buggy submission (verdict: Runtime Error):
N = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
print(a[0::2] - a[1::2])
Problem p03436 (python)

Fixed submission:
from collections import deque

def main():
    h, w = map(int, input().split())
    G = [list(input()) for i in range(h)]
    dy, dx = [-1, 1, 0, 0], [0, 0, -1, 1]
    
    dist = [[-1 for j in range(w)] for i in range(h)]
    que = deque()
    px = [[-1 for j in range(w)] for i in range(h)]
    py = [[-1 for j in range(w)] for i in range(h)]
    dist[0][0] = 0
    que.append((0, 0))
    while (len(que) != 0):
        y, x = que[0][0], que[0][1]
        que.popleft()

        for i in range(4):
            ny, nx = y+dy[i], x+dx[i]
            if (ny < 0) or (h <= ny) or (nx < 0) or (w <= nx):
                continue
            if G[ny][nx] == "#":
                continue
            if dist[ny][nx] == -1:
                dist[ny][nx] = dist[y][x] + 1
                py[ny][nx], px[ny][nx] = y, x
                que.append((ny, nx))

    if dist[h-1][w-1] == -1:
        print(dist[h-1][w-1])
    else:
        y, x = h - 1, w - 1
        while y != -1 and x != -1:
            G[y][x] = "o"
            y, x = py[y][x], px[y][x]
        ans = 0
        for i in G:
            for j in i:
                if j == ".":
                    ans += 1
        print(ans)

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
def main():
    h, w = map(int, input().split())
    G = [list(input()) for i in range(h)]
    dy, dx = [-1, 1, 0, 0], [0, 0, -1, 1]
    
    dist = [[-1 for j in range(w)] for i in range(h)]
    que = deque()
    px = [[-1 for j in range(w)] for i in range(h)]
    py = [[-1 for j in range(w)] for i in range(h)]
    dist[0][0] = 0
    que.append((0, 0))
    while (len(que) != 0):
        y, x = que[0][0], que[0][1]
        que.popleft()

        for i in range(4):
            ny, nx = y+dy[i], x+dx[i]
            if (ny < 0) or (h <= ny) or (nx < 0) or (w <= nx):
                continue
            if G[ny][nx] == "#":
                continue
            if dist[ny][nx] == -1:
                dist[ny][nx] = dist[y][x] + 1
                py[ny][nx], px[ny][nx] = y, x
                que.append((ny, nx))

    if dist[h-1][w-1] == -1:
        print(dist[h-1][w-1])
    else:
        y, x = h - 1, w - 1
        while y != -1 and x != -1:
            G[y][x] = "o"
            y, x = py[y][x], px[y][x]
        ans = 0
        for i in G:
            for j in i:
                if j == ".":
                    ans += 1
        print(ans)

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

Fixed submission:
A = int(input())
B = int(input())
C = int(input())
X = int(input())
a = list(map(lambda x: x * 500, range(A + 1)))
b = list(map(lambda x: x * 100, range(B + 1)))
c = list(map(lambda x: x * 50, range(C + 1)))

counter = 0

for i in a:
    for p in b:
        for o in c:
            if (i + p + o) == X:
                counter += 1

print(counter)

Buggy submission (verdict: Runtime Error):
a = int(input())
b = int(input())
c = int(input())
x = int(input())
count = 0
al = range(a+1)
bl = range(b+1)
for i in al:
    for p in bl:
        if (((x-al*500-bl*100) % 50) == 0) and (0 <= (x-al*500-bl*100)):
            count += 1
        else:
            break
print(count)
Problem p03449 (python)

Fixed submission:
N = int(input())
A = [list(map(int, input().split())) for i in range(2)]
max_candies = 0
for i in range(N):
    candies = sum(A[0][:i+1] + A[1][i:])
    if max_candies < candies:
        max_candies = candies
print(max_candies)

Buggy submission (verdict: Runtime Error):
N = map(int, input().split())
A = [list(map(int, input().split())) for i in range(2)]
max_candies = 0
for i in range(N):
    candies = sum(A[0][:i+1] + A[1][i:])
    if max_candies < candies:
        max_candies = candies
print(max_candies)
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, b = map(int, input().split())
if (a * b) == 0:
    print(Even)
else:
    print(Odd)

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

Fixed submission:
S = input()
print(S.replace('2017','2018'))

Buggy submission (verdict: Runtime Error):
S = input()
print(S.replace("018"), ("017"))
Problem p03493 (python)

Fixed submission:
s1s2s3 = input()
counter = 0
for i in s1s2s3:
    if i == '1':
        counter += 1
print(counter)

Buggy submission (verdict: Runtime Error):
s1,s2,s3 = map(str, input().split())
x = [s1,s2,s3]
counter = 0
for i in x:
    if i == '1':
        counter += 1
print(counter)

Buggy submission (verdict: Runtime Error):
s1,s2,s3 = map(int, input().split())
x = [s1,s2,s3]
counter = 0
for i in x:
    if i == 1:
        counter += 1
print(counter)
Problem p03494 (python)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
count = 0
det = True
while det:
    for i in range(N):
        if A[i] % 2 == 0:
            A[i] = A[i] // 2
        else:
            det = False
            break
    if det != False:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
index = len(A)
det =True
count = 0
while det:
    for i in index:
        if (A[i] % 2) != 0:
            det = False
            break
        A[i] = A[i] // 2
    if det != False:
        count += 1
print(count)

Buggy submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
index = len(A)
det =True
count = 0
while det:
    for i in index:
        if (A[i] % 2) != 0:
            det = False
            break
    if det != False:
        count += 1
print(count)
Problem p03495 (python)

Fixed submission:
from collections import Counter
N, K = map(int, input().split())
a = Counter(list(map(int, input().split())))
if N == K:
    print(0)
else:
    num = list(a.values())
    if len(num) <= K:
        print(0)
    else:
        print(sum(sorted(num)[:-K]))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
a = list(map(int, input().split()))
if N == K:
    print(0)
else: 
    print(sum(sorted([a.count(i) for i in set(a)])[0:len(bucket) - K:]))
Problem p03636 (python)

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

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

Fixed submission:
r, g, b = map(str, input().split())
if (int(r+g+b) % 4) == 0:
    print("YES")
else:
    print("NO")

Buggy submission (verdict: Runtime Error):
r, g, b = map(str, input().split())
if int(a+g+b) % 4 == 0:
    print("YES")
else:
    print("NO")
Problem p03944 (python)

Fixed submission:
W,H,N = map(int, input().split())
p = [list(map(int, input().split())) for i in range(N)]
x, y = 0, 0
for i in p:
    if (i[2] == 1) and (x < i[0]):
        x = i[0]
    elif (i[2] == 2) and (W > i[0]):
        W = i[0]
    elif (i[2] == 3) and (y < i[1]):
        y = i[1]
    elif (i[2] == 4) and (H > i[1]):
        H = i[1]
area = (W-x)*(H-y)
if ((W-x) <= 0) or ((H-y) <= 0):
    print(0)
else:
    print(area)

Buggy submission (verdict: Runtime Error):
W, H, N = map(int, input().spllit())
a = [list(map(int, input().split())) for i in range(N)]
x, y = 0, 0
for i in a:
    if (i[2]==1) and (x < i[0]):
        x = i[0]
    elif (i[2]==2) and (W > i[0]):
        W = i[0]
    elif (i[2]==3) and (y < i[1]):
        y = i[1]
    elif (i[2]==4) and (H > i[1]):
        H = i[1]
if ((W-x)<=0) or ((H-y)<=0):
    print(0)
else:
    print((W-x)*(H-y))
Problem p04001 (python)

Fixed submission:
s = input()
op_cnt = len(s) - 1
ans = []
for i in range(2**op_cnt):
    op = ['']*op_cnt
    for j in range(op_cnt):
        if ((i >> j) & 1):
            op[op_cnt - 1 - j] = '+'
    f = s[0]
    for p, q in zip(op, s[1:]):
        f += p + q
    ans.append(f)
sums = 0
for i in ans:
    sums += eval(i)
print(sums)

Buggy submission (verdict: Runtime Error):
s = input()
op = ['','+']
if len(s) == 1:
    print(s)
else:
    s = s + 'X'*(10 -len(s))
    ans = []
    for a in op:
        for b in op:
            for c in op:
                for d in op:
                    for e in op:
                        for f in op:
                            for g in op:
                                for h in op:
                                    for i in op:
                                        　　　ans.append(s[0]+a+s[1]+b+s[2]+c+s[3]+d+s[4]+e+s[5]+f+s[6]+g+s[7]+h+s[8]+i+s[9])
    for i in range(len(ans)):
        for j in range(len(ans[i])):
            if ans[i][j] == 'X':
                if ans[i][j-1] == '+':
                    ans[i] = ans[i][:j-1]
                else:
                    ans[i] = ans[i][:j]
                break
    sums = 0
    for i in set(ans):
        sums += eval(i)
    print(sums)
Problem p04043 (python)

Fixed submission:
x = sorted(list(map(int, input().split())))
if (x[0]==x[1]==5) and x[2]==7:
    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(''.join(S))
Problem p04044 (python)

Fixed submission:
N, L = map(int,input().split())
S = sorted([input() for i in range(N)])
print(''.join(S))

Buggy submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = sorted([input() for i in range(N)])
print(sum(S))
Problem p02719 (python)

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

def dif(n, k):
    if abs(n - k) <= n:
        return dif(abs(n-k), k)
    else:
        return n

if N % K == 0:
    print(0)
else:
    N = N % K
    print(dif(N,K))

Buggy submission (verdict: Runtime Error):
N, K = map(int, input().split())
def dif(n, k):
    if abs(n - k) <= n:
        return dif(abs(n-k), k)
    else:
        return n

print(dif(N,K))
Problem p02922 (python)

Fixed submission:
import math
A,B = input().split()
A = int(A)
B= int(B)
print(str(math.ceil((B-1)/(A-1))))

Buggy submission (verdict: Runtime Error):
import math

A,B = input().split()

print(math.ceil((B-1)/(A-1)))
Problem p03379 (python)

Fixed submission:
import copy
N = int(input())
Listx = list(map(int,input().split()))
Listxs = sorted(Listx)
A = Listxs[N//2]
B = Listxs[N//2-1]

for i in range(N):
    print(A if  B>= Listx[i] else B)

Buggy submission (verdict: Runtime Error):
import copy
N = int(input())
Listx = list(map(int,input().split()))
Listxs = sorted(Listx)
A = Listxs[N//2]
B = Listxs[N//2-1]

for i in range(N):
    print(A if  B>= Listx[i] and else B)

Buggy submission (verdict: Runtime Error):
import copy
N = int(input())
Listx = list(map(int,input().split()))
Listxs = sorted(Listx)
A = Listxs[N//2]
B = Listxs[N//2-1]

for i in range(N):
    print(A if  B>= Listx[i] and else B)
Problem p03545 (python)

Fixed submission:
ABCD = int(input())
a = int(ABCD//10e2)
b = int((ABCD-a*10e2)//10e1)
c = int((ABCD-a*10e2-b*10e1)//10)
d = int(ABCD-a*10e2-b*10e1-c*10)
if a+b+c+d == 7:
    print(str(a)+"+"+str(b)+"+"+str(c)+"+"+str(d)+"=7")
elif a-b+c+d == 7:
    print(str(a)+"-"+str(b)+"+"+str(c)+"+"+str(d)+"=7")
elif a+b-c+d == 7:
    print(str(a)+"+"+str(b)+"-"+str(c)+"+"+str(d)+"=7")
elif a+b+c-d == 7:
    print(str(a)+"+"+str(b)+"+"+str(c)+"-"+str(d)+"=7")
elif a-b-c+d == 7:
    print(str(a)+"-"+str(b)+"-"+str(c)+"+"+str(d)+"=7")
elif a-b+c-d == 7:
    print(str(a)+"-"+str(b)+"+"+str(c)+"-"+str(d)+"=7")
elif a+b-c-d == 7:
    print(str(a)+"+"+str(b)+"-"+str(c)+"-"+str(d)+"=7")
elif a-b-c-d == 7:
    print(str(a)+"-"+str(b)+"-"+str(c)+"-"+str(d)+"=7")

Buggy submission (verdict: Runtime Error):
ABCD = int(input())
a = int(ABCD//10e2)
b = int((ABCD-a*10e2)//10e1)
c = int((ABCD-a*10e2-b*10e1)//10)
d = int(ABCD-a*10e2-b*10e1-c*10)
if a+b+c+d == 7:
    print(str(a)+"+"+str(b)+"+"+str(c)+"+"+str(d)+"=7")
elif a-b+c+d == 7:
    print(str(a)+"-"+str(b)+"+"+str(c)+"+"+str(d)+"=7")
elif a+b-c+d == 7:
    print(str(a)+"+"+str(b)+"-"+str(c)+"+"+str(d)+"=7")
elif a+b+c-d == 7:
    print(str(a)+"+"+str(b)+"+"+str(c)+"-"+str(d)+"=7")
elif a-b-c+d == 7:
    print(str(a)+"-"+str(b)+"-"+str(c)+"+"+str(d)+"=7")
elif a-b+c-d == 7:
    print(str(a)+"-"+str(b)+"+"+str(c)+"-"+str(d)+"=7")
elif a+b-c-d == 7:
    print(str(a)+"+"+str(b)+"-"+str(c)+"-"+str(d)+"=7")
elif a-b-c-d == 7:
    print(str(a)+"-"+str(b)+"-"+str(c)+"-
    "+str(d)+"=7")
Problem p03260 (python)

Fixed submission:
list1 = list(map(int,input().split()))
a = list1[0]
b = list1[1]
if a % 2 != 0:
    if b % 2 != 0:
        print('Yes')
    else:
        print('No')
else:
    print('No')

Buggy submission (verdict: Runtime Error):
list1 = list(map(int,input().split()))
h = list1[0]
w = list1[1]
a = list()
i = 0
n = 0
ans = list()
while i <= h-1:
    a.append(list(map(int,input().split())))
    i += 1
for i in range(h):
    for j in range(w-1):
        if a[i][j] % 2 != 0:
            a[i][j] -= 1
            a[i][j+1] += 1
            n+=1
            ans.append([i+1,j+1,i+1,j+2])
for i in range(h-1):
    if a[i][w-1] % 2 != 0:
        a[i][w-1] -= 1
        a[i+1][w-1] += 1
        ans.append([i+1, w, i+2, w])
        n+=1
print(n)
for i in range(n):
    print(ans[i][0],ans[i][1],ans[i][2],ans[i][3])
Problem p03263 (python)

Fixed submission:
list1 = list(map(int,input().split()))
h = list1[0]
w = list1[1]
a = list()
i = 0
n = 0
ans = list()
while i <= h-1:
    a.append(list(map(int,input().split())))
    i += 1
for i in range(h):
    for j in range(w-1):
        if a[i][j] % 2 != 0:
            a[i][j] -= 1
            a[i][j+1] += 1
            n+=1
            ans.append([i+1,j+1,i+1,j+2])
for i in range(h-1):
    if a[i][w-1] % 2 != 0:
        a[i][w-1] -= 1
        a[i+1][w-1] += 1
        ans.append([i+1, w, i+2, w])
        n+=1
print(n)
for i in range(n):
    print(ans[i][0],ans[i][1],ans[i][2],ans[i][3])

Buggy submission (verdict: Runtime Error):
list1 = list(map(int,input().split()))
h = list1[0]
w = list1[1]
a = list()
i = 0
n = 0
ans = list()
while i <= h-1:
    a.append(list(map(int,input().split())))
    i += 1
for i in range(h):
    for j in range(w-1):
        if a[i][j] % 2 != 0:
            a[i][j] -= 1
            a[i][j+1] += 1
            n+=1
            ans.append(list(i+1,j+1,i+1,j+2))
for i in range(h-1):
    if a[i][w-1] % 2 != 0:
        a[i][w-1] -= 1
        a[i+1][w-1] += 1
        ans.append(list(i+1, w, i+2, w))
        n+=1
print(n)
for i in range(n):
    print(ans[i][0],ans[i][1],ans[i][2],ans[i][3])
Problem p03359 (python)

Fixed submission:
x = list(map(int,input().split()))
a = x[0]
b = x[1]
y = a - 1
if b >= a:
    y += 1
print(y)

Buggy submission (verdict: Runtime Error):
x = list(map(int,input().split()))
h = x[0]
w = x[1]
can = list()
for i in range(h):
    y = input()
    can.append(y)
z = 0
for i in range(h):
    for j in range(w):
        if can[i][j] == "#":
            if i > 0:
                if can[i - 1][j] == "#":
                    break
            if i < h - 1:
                if can[i + 1][j] == "#":
                    break
            if j > 0:
                if can[i][j - 1] == "#":
                    break
            if j < w - 1:
                if can[i][j + 1] == "#":
                    break
            z += 1
if z == 0:
    print("Yes")
else:
    print("No")