Problem p03943 (python)

Fixed submission:
[a,b,c]=list(map(int,input().split()))
if a+b==c or a+c==b or b+c==a :
    print("Yes")
else:
    print("No")

Buggy submission (verdict: Runtime Error):
, H, N = map(int, input().split())
P = [list(map(int, input().split())) for _ in range(N)]
# X1, X2, Y1, Y2 = 0, W, 0, H
X1 = 0
X2 = W
Y1 = 0
Y2 = H

for x, y, a in P:
    if a == 1:
        X1 = max(X1, x)
    elif a == 2:
        X2 = min(X2, x)
    elif a == 3:
        Y1 = max(Y1, y)
    elif a == 4:
        Y2 = min(Y2, y)
else:
    if X2 <= X1 or Y2 <= Y1:
        print(0)
    else:
        print((X2 - X1) * (Y2 - Y1))

Buggy submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
P = [list(map(int, input().split())) for _ in range(N)]
X1, X2, Y1, Y2 = 0, W, 0, H

for x, y, a in P:
    if a == 1:
        X1 = max(X1, x)
    elif a == 2:
        X2 = min(X2, x)
    elif a == 3:
        Y1 = max(Y1, y)
    elif a == 4:
        Y2 = min(Y2, y)
else:

    if X2 <= X1 or Y2 <= Y1:
        print(0)
    else:
        print((X2 - X1) * (Y2 - Y1))

Buggy submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
P = [list(map(int, input().split())) for _ in range(N)]
X1, X2, Y1, Y2 = 0, W, 0, H

for x, y, a in P:
    if a == 1:
        X1 = max(X1, x)
    elif a == 2:
        X2 = min(X2, x)
    elif a == 3:
        Y1 = max(Y1, y)
    elif a == 4:
        Y2 = min(Y2, y)

if X2 <= X1 or Y2 <= Y1:
    print(0)
else:
    print((X2 - X1) * (Y2 - Y1))

Buggy submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
P = [list(map(int, input().split())) for _ in range(N)]
X1, X2, Y1, Y2 = 0, W, 0, H

for x, y, a in P:
    if a == 1:
        X1 = max(X1, x)
    elif a == 2:
        X2 = min(X2, x)
    elif a == 3:
        Y1 = max(Y1, y)
    elif a == 4:
        Y2 = min(Y2, y)

if X2 <= X1 or Y2 <= Y1:
    S = 0
else:
    S = (X2 - X1) * (Y2 - Y1)

print(S)

Buggy submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
P = [list(map(int, input().split())) for _ in range(N)]
X1, X2, Y1, Y2 = 0, W, 0, H

for x, y, a in P:
    if a == 1:  # ai=1
        X1 = max(X1, x)
    elif a == 2:  # ai=2
        X2 = min(X2, x)
    elif a == 3:  # ai=3
        Y1 = max(Y1, y)
    elif a == 4:  # ai=4
        Y2 = min(Y2, y)

if X2 <= X1 or Y2 <= Y1:
    S = 0
else:
    S = (X2 - X1) * (Y2 - Y1)

print(S)

Buggy submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
P = [list(map(int, input().split())) for _ in range(N)]
X1, X2, Y1, Y2 = 0, W, 0, H

for x, y, a in P:
    if a == 1:  # ai=1
        X1 = max(X1, x)
    elif a == 2:  # ai=2
        X2 = min(X2, x)
    elif a == 3:  # ai=3
        Y1 = max(Y1, y)
    elif a == 4:  # ai=4
        Y2 = min(Y2, y)

if X1 < X2 and Y1 < Y2:
    S = (X2 - X1) * (Y2 - Y1)
else:
    S = 0
print(S)

Buggy submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
P = [list(map(int, input().split())) for _ in range(N)]
X1, X2, Y1, Y2 = 0, W, 0, H

for i in P:
    if i[2] == 1:  # ai=1
        X1 = max(X1, i[0])
    elif i[2] == 2:  # ai=2
        X2 = min(X2, i[0])
    elif i[2] == 3:  # ai=3
        Y1 = max(Y1, i[1])
    elif i[2] == 4:  # ai=4
        Y2 = min(Y2, i[1])

if X1 < X2 and Y1 < Y2:
    S = (X2 - X1) * (Y2 - Y1)
else:
    S = 0
print(S)

Buggy submission (verdict: Runtime Error):
W, H, N = map(int, input().split())
P = [list(map(int, input().split())) for i in range(N)]
X1, X2, Y1, Y2 = 0, W, 0, H

for i in range(N):
    if P[i][2] == 1:  # ai=1
        X1 = max(X1, P[i][0])
    elif P[i][2] == 2:  # ai=2
        X2 = min(X2, P[i][0])
    elif P[i][2] == 3:  # ai=3
        Y1 = max(Y1, P[i][1])
    elif P[i][2] == 4:  # ai=4
        Y2 = min(Y2, P[i][1])

if X1 < X2 and Y1 < Y2:
    S = (X2 - X1) * (Y2 - Y1)
else:
    S = 0
print(S)

Buggy submission (verdict: Runtime Error):
f = True

a, b, c = map(int, input().split())
candy = [a, b, c]
if not max(candy) == sum(candy) - max(candy):
    f = False

if f:
    print("YES")
else:

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

a, b, c = map(int, input().split())
candy = [a, b, c]
candy.sort()
if candy[0] + candy[1] == candy[2]:
    print("YES")
else:
    Print("NO")

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

a, b, c = map(int, input().split())
candy = [a, b, c]
if max(candy) == sum(candy) - max(candy):
    print("YES")
else:
    Print("NO")

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

a, b, c = map(int, input().split())
candy = [a, b, c]
if max(candy) == sum(candy) - max(candy):
    print("YES")
else: