Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import sys
input = sys.stdin.readline
def main():
    H,W = map(int,input().split())
    S = [list(input().rstrip()) for _ in range(H)]
    L = np.zeros((H,W))
    R = np.zeros((H,W))
    U = np.zeros((H,W))
    D = np.zeros((H,W))
    for i in range(H):
        for j in range(W):
            if j == 0:
                if S[i][j] == "#":
                    L[i,j] = -1
                continue
            if S[i][j] == ".":
                L[i,j] = L[i,j-1]+1
            else:
                L[i,j] = -1
        for j in reversed(range(W)):
            if j == W-1:
                if S[i][j] == "#":
                    R[i,j] = -1
                continue
            if S[i][j] == ".":
                R[i,j] = R[i,j+1]+1
            else:
                R[i,j] = -1
    for j in range(W):
        for i in range(H):
            if i == 0:
                if S[i][j] == "#":
                    U[i,j] = -1
                continue
            if S[i][j] == ".":
                U[i,j] = U[i-1,j]+1
            else:
                U[i,j] = -1
        for i in reversed(range(H)):
            if i == H-1:
                if S[i][j] == "#":
                    D[i,j] = -1
                continue
            if S[i][j] == ".":
                D[i,j] = D[i+1,j]+1
            else:
                D[i,j] = -1
    su = L+R+U+D
    #print(L,R,U,D,sep="\n")
    print(int(np.amax(su)+1))
if __name__ == '__main__':
    main()


Fixed submission:
import numpy as np
import sys
input = sys.stdin.readline
def main():
    H,W = map(int,input().split())
    S = np.array([list(input().rstrip()) for _ in range(H)]) == "."
    L = np.zeros((H,W),dtype=int)
    R = np.zeros((H,W),dtype=int)
    U = np.zeros((H,W),dtype=int)
    D = np.zeros((H,W),dtype=int)
    #[-1]はインデックス内(all 0)なのでエラーを吐かない！
    for i in range(H):
        U[i] = (U[i-1]+1)*S[i]
        D[-i-1] = (D[-i]+1)*S[-i-1]  
    for j in range(W):
        L[:,j] = (L[:,j-1]+1)*S[:,j]
        R[:,-j-1] = (R[:,-j]+1)*S[:,-j-1]

    su = L+R+U+D
    #print(L,R,U,D,sep="\n")
    print(np.amax(su)-3)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import sys
input = sys.stdin.readline
def main():
    H,W = map(int,input().split())
    S = [list(input().rstrip()) for _ in range(H)]
    L = np.zeros((H,W))
    R = np.zeros((H,W))
    U = np.zeros((H,W))
    D = np.zeros((H,W))
    for i in range(H):
        for j in range(W):
            if j == 0:
                if S[i][j] == "#":
                    L[i,j] = -1
                continue
            if S[i][j] == ".":
                L[i,j] += L[i,j-1]+1
            else:
                L[i,j] = -1
        for j in reversed(range(W)):
            if j == W-1:
                if S[i][j] == "#":
                    R[i,j] = -1
                continue
            if S[i][j] == ".":
                R[i,j] += R[i,j+1]+1
            else:
                R[i,j] = -1
    for j in range(W):
        for i in range(H):
            if i == 0:
                if S[i][j] == "#":
                    U[i,j] = -1
                continue
            if S[i][j] == ".":
                U[i,j] += U[i-1,j]+1
            else:
                U[i,j] = -1
        for i in reversed(range(H)):
            if i == H-1:
                if S[i][j] == "#":
                    D[i,j] = -1
                continue
            if S[i][j] == ".":
                D[i,j] += D[i+1,j]+1
            else:
                D[i,j] = -1
    su = L+R+U+D
    #print(L,R,U,D,sep="\n")
    print(int(np.amax(su)+1))
if __name__ == '__main__':
    main()

Fixed submission:
import numpy as np
import sys
input = sys.stdin.readline
def main():
    H,W = map(int,input().split())
    S = np.array([list(input().rstrip()) for _ in range(H)]) == "."
    L = np.zeros((H,W),dtype=int)
    R = np.zeros((H,W),dtype=int)
    U = np.zeros((H,W),dtype=int)
    D = np.zeros((H,W),dtype=int)
    #[-1]はインデックス内(all 0)なのでエラーを吐かない！
    for i in range(H):
        U[i] = (U[i-1]+1)*S[i]
        D[-i-1] = (D[-i]+1)*S[-i-1]  
    for j in range(W):
        L[:,j] = (L[:,j-1]+1)*S[:,j]
        R[:,-j-1] = (R[:,-j]+1)*S[:,-j-1]

    su = L+R+U+D
    #print(L,R,U,D,sep="\n")
    print(np.amax(su)-3)
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
H,W = map(int,input().split())
S = [list(input()) for _ in range(H)]
L = np.zeros((H,W))
R = np.zeros((H,W))
U = np.zeros((H,W))
D = np.zeros((H,W))
for i in range(H):
    for j in range(W):
        if j == 0:
            if S[i][j] == "#":
                L[i,j] = -1
            continue
        if S[i][j] == ".":
            L[i,j] += L[i,j-1]+1
        else:
            L[i,j] = -1
    for j in reversed(range(W)):
        if j == W-1:
            if S[i][j] == "#":
                R[i,j] = -1
            continue
        if S[i][j] == ".":
            R[i,j] += R[i,j+1]+1
        else:
            R[i,j] = -1
for j in range(W):
    for i in range(H):
        if i == 0:
            if S[i][j] == "#":
                U[i,j] = -1
            continue
        if S[i][j] == ".":
            U[i,j] += U[i-1,j]+1
        else:
            U[i,j] = -1
    for i in reversed(range(H)):
        if i == H-1:
            if S[i][j] == "#":
                D[i,j] = -1
            continue
        if S[i][j] == ".":
            D[i,j] += D[i+1,j]+1
        else:
            D[i,j] = -1
su = L+R+U+D
#print(L,R,U,D,sep="\n")
print(int(np.amax(su)+1))


Fixed submission:
import numpy as np
import sys
input = sys.stdin.readline
def main():
    H,W = map(int,input().split())
    S = np.array([list(input().rstrip()) for _ in range(H)]) == "."
    L = np.zeros((H,W),dtype=int)
    R = np.zeros((H,W),dtype=int)
    U = np.zeros((H,W),dtype=int)
    D = np.zeros((H,W),dtype=int)
    #[-1]はインデックス内(all 0)なのでエラーを吐かない！
    for i in range(H):
        U[i] = (U[i-1]+1)*S[i]
        D[-i-1] = (D[-i]+1)*S[-i-1]  
    for j in range(W):
        L[:,j] = (L[:,j-1]+1)*S[:,j]
        R[:,-j-1] = (R[:,-j]+1)*S[:,-j-1]

    su = L+R+U+D
    #print(L,R,U,D,sep="\n")
    print(np.amax(su)-3)
if __name__ == '__main__':
    main()