Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
from numba import njit


@njit("i2(i2, i2, i2[:,:])")
def solve(H, W, field):
    u = field.copy()
    d = field.copy()
    l = field.copy()
    r = field.copy()

    for i in range(1, H):
        u[i] = (u[i - 1] + 1) * u[i]
        d[-i - 1] = (d[-i] + 1) * d[-i - 1]

    for j in range(1, W):
        l[:, j] = (l[:, j - 1] + 1) * l[:, j]
        r[:, -j - 1] = (r[:, -j] + 1) * r[:, -j - 1]

    return (u + d + l + r - 3).max()


H, W = map(int, input().split())
field = [[c == "." for c in input()] for _ in range(H)]
field = np.array(field, dtype=np.int16)

print(solve(H, W, field))


Fixed submission:
import numpy as np


H, W = map(int, input().split())
field = [[c == "." for c in input()] for _ in range(H)]
field = np.array(field, dtype=np.int16)

u = field.copy()
d = field.copy()
l = field.copy()
r = field.copy()

for i in range(1, H):
    u[i] = (u[i - 1] + 1) * u[i]
    d[-i - 1] = (d[-i] + 1) * d[-i - 1]

for j in range(1, W):
    l[:, j] = (l[:, j - 1] + 1) * l[:, j]
    r[:, -j - 1] = (r[:, -j] + 1) * r[:, -j - 1]

print((u + d + l + r - 3).max())

Buggy python submission (verdict: Runtime Error):
from copy import deepcopy

import numpy as np


H, W = map(int, input().split())
field = np.array([[c == "." for c in input()] for _ in range(H)], dtype=np.int16)

u = deepcopy(field)
d = deepcopy(field)
l = deepcopy(field)
r = deepcopy(field)

for i in range(H):
    for j in range(1, W):
        if field[i, j]:
            l[i, j] = l[i, j - 1] + 1
        if field[i, W - j - 1]:
            r[i, W - j - 1] = r[i, W - j] + 1

for j in range(W):
    for i in range(1, H):
        if field[i, j]:
            u[i, j] = u[i - 1, j] + 1
        if field[H - i - 1, j]:
            d[H - i - 1, j] = d[H - i, j] + 1

print((u + d + l + r - 3).max())



Fixed submission:
import numpy as np


H, W = map(int, input().split())
field = [[c == "." for c in input()] for _ in range(H)]
field = np.array(field, dtype=np.int16)

u = field.copy()
d = field.copy()
l = field.copy()
r = field.copy()

for i in range(1, H):
    u[i] = (u[i - 1] + 1) * u[i]
    d[-i - 1] = (d[-i] + 1) * d[-i - 1]

for j in range(1, W):
    l[:, j] = (l[:, j - 1] + 1) * l[:, j]
    r[:, -j - 1] = (r[:, -j] + 1) * r[:, -j - 1]

print((u + d + l + r - 3).max())

Buggy python submission (verdict: Runtime Error):
import sys


sys.setrecursionlimit(10 ** 6)


def f(n):
    if memo[n] > 0:
        return memo[n]
    memo[n] = f(n - 1) + f(n - 2)
    return memo[n]


N, M, *A = map(int, open(0).read().split())
memo = [1, 1] + [-1] * N
A = list(A) + [N + 1]
MOD = 10 ** 9 + 7
ans = 1
prev = 0
for a in A:
    if a == prev:
        ans = 0
        break
    ans *= f(a - 1 - prev)
    ans %= MOD
    prev = a + 1
print(ans)


Fixed submission:
import numpy as np


H, W = map(int, input().split())
field = [[c == "." for c in input()] for _ in range(H)]
field = np.array(field, dtype=np.int16)

u = field.copy()
d = field.copy()
l = field.copy()
r = field.copy()

for i in range(1, H):
    u[i] = (u[i - 1] + 1) * u[i]
    d[-i - 1] = (d[-i] + 1) * d[-i - 1]

for j in range(1, W):
    l[:, j] = (l[:, j - 1] + 1) * l[:, j]
    r[:, -j - 1] = (r[:, -j] + 1) * r[:, -j - 1]

print((u + d + l + r - 3).max())

Buggy python submission (verdict: Time Limit Exceeded):
from copy import deepcopy

import numpy as np


H, W = map(int, input().split())
field = np.array([[c == "." for c in input()] for _ in range(H)], dtype=np.int16)

u = deepcopy(field)
d = deepcopy(field)
l = deepcopy(field)
r = deepcopy(field)

for i in range(H):
    for j in range(1, W):
        if field[i, j]:
            l[i, j] = l[i, j - 1] + 1
        if field[i, W - j - 1]:
            r[i, W - j - 1] = r[i, W - j] + 1

for j in range(W):
    for i in range(1, H):
        if field[i, j]:
            u[i, j] = u[i - 1, j] + 1
        if field[H - i - 1, j]:
            d[H - i - 1, j] = d[H - i, j] + 1

print((u + d + l + r - 3).max())



Fixed submission:
import numpy as np


H, W = map(int, input().split())
field = [[c == "." for c in input()] for _ in range(H)]
field = np.array(field, dtype=np.int16)

u = field.copy()
d = field.copy()
l = field.copy()
r = field.copy()

for i in range(1, H):
    u[i] = (u[i - 1] + 1) * u[i]
    d[-i - 1] = (d[-i] + 1) * d[-i - 1]

for j in range(1, W):
    l[:, j] = (l[:, j - 1] + 1) * l[:, j]
    r[:, -j - 1] = (r[:, -j] + 1) * r[:, -j - 1]

print((u + d + l + r - 3).max())