Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
xyd = [input().split() for _ in range(n)]
def reg(a):
    a.sort()
    if len(a) > 2:
        a = [a[0], a[-1]]
    return a
xr = reg([int(v[0]) for v in xyd if v[2] == 'R'])
xl = reg([int(v[0]) for v in xyd if v[2] == 'L'])
xs = reg([int(v[0]) for v in xyd if v[2] == 'U' or v[2] == 'D'])
yu = reg([int(v[1]) for v in xyd if v[2] == 'U'])
yd = reg([int(v[1]) for v in xyd if v[2] == 'D'])
ys = reg([int(v[1]) for v in xyd if v[2] == 'R' or v[2] == 'L'])
xd = [(x, 1) for x in xr] + [(x, -1) for x in xl] + [(x, 0) for x in xs]
yd = [(y, 1) for y in yu] + [(y, -1) for y in yd] + [(y, 0) for y in ys]
def calc(mid):
    xmin = min(x + mid * d for x, d in xd)
    xmax = max(x + mid * d for x, d in xd)
    ymin = min(y + mid * d for y, d in yd)
    ymax = max(y + mid * d for y, d in yd)
    return (xmax - xmin) * (ymax - ymin)
lo = 0.0
hi = 1e200
while hi - lo > 1e-15 and hi - lo > lo * 1e-19:
    mid1 = (lo * 2 + hi) / 3
    mid2 = (lo + hi * 2) / 3
    if calc(mid1) > calc(mid2):
        lo = mid1
    else:
        hi = mid2
print(calc((lo + hi) / 2))

Fixed submission:
n = int(input())
m = {}
for _ in range(n):
    x, y, d = input().split()
    x, y = int(x) * 2, int(y) * 2
    if d not in m:
        m[d] = [1000000000, -1000000000, 1000000000, -1000000000]
    m[d][0] = min(m[d][0], x)
    m[d][1] = max(m[d][1], x)
    m[d][2] = min(m[d][2], y)
    m[d][3] = max(m[d][3], y)

dx = {'L': -1, 'R': 1, 'U': 0, 'D': 0}
dy = {'L': 0, 'R': 0, 'U': 1, 'D': -1}

px = []
py = []
for d in 'LRUD':
    if d in m:
        px.append((m[d][0], dx[d]))
        px.append((m[d][1], dx[d]))
        py.append((m[d][2], dy[d]))
        py.append((m[d][3], dy[d]))

times = [0]
def append(pa, pb):
    (a, da) = pa
    (b, db) = pb
    if db != da:
        t = (a - b) // (db - da)
        if t >= 0:
            times.append(t)

for i in range(len(px)):
    for j in range(i + 1, len(px)):
        append(px[i], px[j])

for i in range(len(py)):
    for j in range(i + 1, len(py)):
        append(py[i], py[j])

ret = 1000000000000000000
for t in times:
    bb = [1000000000, -1000000000, 1000000000, -1000000000]
    for d in 'LRUD':
        if d in m:
            bb[0] = min(bb[0], m[d][0] + dx[d] * t)
            bb[1] = max(bb[1], m[d][1] + dx[d] * t)
            bb[2] = min(bb[2], m[d][2] + dy[d] * t)
            bb[3] = max(bb[3], m[d][3] + dy[d] * t)
    ret = min(ret, (bb[1] - bb[0]) * (bb[3] - bb[2]))

print(ret / 4.0)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
xyd = [input().split() for _ in range(n)]
xd = [(int(v[0]), 1 if v[2] == 'R' else -1 if v[2] == 'L' else 0) for v in xyd]
yd = [(int(v[1]), 1 if v[2] == 'U' else -1 if v[2] == 'D' else 0) for v in xyd]
def calc(mid):
    xmin = min(x + mid * d for x, d in xd)
    xmax = max(x + mid * d for x, d in xd)
    ymin = min(y + mid * d for y, d in yd)
    ymax = max(y + mid * d for y, d in yd)
    return (xmax - xmin) * (ymax - ymin)
lo = 0.0
hi = 1e100
while hi - lo > 1e-10:
    mid1 = (lo * 2 + hi) / 3
    mid2 = (lo + hi * 2) / 3
    if calc(mid1) > calc(mid2):
        lo = mid1
    else:
        hi = mid2
print(calc((lo + hi) / 2))


Fixed submission:
n = int(input())
m = {}
for _ in range(n):
    x, y, d = input().split()
    x, y = int(x) * 2, int(y) * 2
    if d not in m:
        m[d] = [1000000000, -1000000000, 1000000000, -1000000000]
    m[d][0] = min(m[d][0], x)
    m[d][1] = max(m[d][1], x)
    m[d][2] = min(m[d][2], y)
    m[d][3] = max(m[d][3], y)

dx = {'L': -1, 'R': 1, 'U': 0, 'D': 0}
dy = {'L': 0, 'R': 0, 'U': 1, 'D': -1}

px = []
py = []
for d in 'LRUD':
    if d in m:
        px.append((m[d][0], dx[d]))
        px.append((m[d][1], dx[d]))
        py.append((m[d][2], dy[d]))
        py.append((m[d][3], dy[d]))

times = [0]
def append(pa, pb):
    (a, da) = pa
    (b, db) = pb
    if db != da:
        t = (a - b) // (db - da)
        if t >= 0:
            times.append(t)

for i in range(len(px)):
    for j in range(i + 1, len(px)):
        append(px[i], px[j])

for i in range(len(py)):
    for j in range(i + 1, len(py)):
        append(py[i], py[j])

ret = 1000000000000000000
for t in times:
    bb = [1000000000, -1000000000, 1000000000, -1000000000]
    for d in 'LRUD':
        if d in m:
            bb[0] = min(bb[0], m[d][0] + dx[d] * t)
            bb[1] = max(bb[1], m[d][1] + dx[d] * t)
            bb[2] = min(bb[2], m[d][2] + dy[d] * t)
            bb[3] = max(bb[3], m[d][3] + dy[d] * t)
    ret = min(ret, (bb[1] - bb[0]) * (bb[3] - bb[2]))

print(ret / 4.0)