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

CoordinateList = []
for i in range(N):
    x,y,a = map(int, input().split())
    CoordinateList.append([x,y,a])

# raw White & Black
AllArea = []
for numline in range(H):
    rawWhite = []
    rawBlack = []
    for numraw in range(W):
        rawWhite.append("W")
        rawBlack.append("B")
    AllArea.append(rawWhite)

# coloring from white to Black
for n in range(N):
    if CoordinateList[n][2] == 1:
        if CoordinateList[n][0] == 0:
            pass
        else:
            for i in range(H):
                del AllArea[i][:(CoordinateList[n][0])]
                for numX in range(CoordinateList[n][0]):
                    AllArea[i].insert(0,"B")

    elif CoordinateList[n][2] == 2:
        if CoordinateList[n][0] == 0:
            print(0)
            exit()
        else:
            for i in range(H):
                del AllArea[i][(CoordinateList[n][0]):]
                for numX in range(CoordinateList[n][0]):
                    AllArea[i].append("B")

    elif CoordinateList[n][2] == 3:
        changeY = H - int(CoordinateList[n][1])
        if changeY == 0:
            print(0)
            exit()
        else:
            del AllArea[changeY:]
            for changeRaw in range(changeY):
                AllArea.append(rawBlack)

    elif CoordinateList[n][2] == 4:
        changeY = H - int(CoordinateList[n][1]) 
        if changeY == 0:
            pass
        else:
            del AllArea[:changeY]
            for changeRaw in range(changeY):
                AllArea.insert(0,rawBlack)
            
            
# counting 
AreaWhite = 0
for i in range(H):
    AreaWhite += AllArea[i].count("W")

print(AreaWhite)

Fixed submission:
w, h, n = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
x = [x_i for x_i in range(w + 1)]
y = [y_i for y_i in range(h + 1)]
for l_e in l:
    if l_e[2] == 1:
        x = [i for i in x if i > l_e[0] - 1]
    elif l_e[2] == 2:
        x = [i for i in x if i < l_e[0] + 1]
    elif l_e[2] == 3:
        y = [i for i in y if i > l_e[1] - 1]
    else:
        y = [i for i in y if i < l_e[1] + 1]
print(0 if len(x) == 0 or len(y) == 0 else (x[-1] - x[0]) * (y[-1] - y[0]))

Buggy python submission (verdict: Runtime Error):
w, h, n = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
x = [x_i for x_i in range(w + 1)]
y = [y_i for y_i in range(h + 1)]
for l_e in l:
    if l_e[2] == 1:
        x = x[l_e[0]:]
    elif l_e[2] == 2:
        x = x[:l_e[0]]
    elif l_e[2] == 3:
        y = y[l_e[1]:]
    else:
        y = y[:l_e[1]]
print((x[-1] - x[0]) * (x[-1] - x[0]))

Fixed submission:
w, h, n = map(int, input().split())
l = [list(map(int, input().split())) for i in range(n)]
x = [x_i for x_i in range(w + 1)]
y = [y_i for y_i in range(h + 1)]
for l_e in l:
    if l_e[2] == 1:
        x = [i for i in x if i > l_e[0] - 1]
    elif l_e[2] == 2:
        x = [i for i in x if i < l_e[0] + 1]
    elif l_e[2] == 3:
        y = [i for i in y if i > l_e[1] - 1]
    else:
        y = [i for i in y if i < l_e[1] + 1]
print(0 if len(x) == 0 or len(y) == 0 else (x[-1] - x[0]) * (y[-1] - y[0]))