Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
import sys
import numpy as np
MOD = 1000000007

buffer = sys.stdin.buffer
H, W = list(map(int,buffer.readline().split()))
S = np.empty((0, W), int)
for i in range(H):
	tmp = np.frombuffer(buffer.readline(), dtype='B')
	S = np.append(S,[(tmp == ord("."))[:W]], axis=0)
L = np.empty((H,W), dtype="i4")
R = np.empty((H,W), dtype="i4")
U = np.empty((H,W), dtype="i4")
D = np.empty((H,W), dtype="i4")
 
L[:,0] = S[:,0]
for i in range(1,W):
    L[:,i] = (L[:,i-1] + 1) * S[:,i]
 
R[:,-1] = S[:,-1]
for i in range(1,W):
    R[:,-1-i] = (R[:,-i] + 1) * S[:,-1-i]
 
U[0] = S[0]
for i in range(1,H):
    U[i] = (U[i-1] + 1) * S[i]
 
D[-1] = S[-1]
for i in range(1,H):
    D[-1-i] = (D[-i] + 1) * S[-1-i]
 
score = L + R + U + D - 3
print(int(score.max()))

Fixed submission:
from functools import reduce
import sys
import numpy as np
MOD = 1000000007

buffer = sys.stdin.buffer
H, W = list(map(int,buffer.readline().split()))
S = np.frombuffer(buffer.read(H*(W+1)), dtype="B") == ord(".")
S = S.reshape((H,W+1))[:,:-1]
L = np.empty((H,W), dtype="i4")
R = np.empty((H,W), dtype="i4")
U = np.empty((H,W), dtype="i4")
D = np.empty((H,W), dtype="i4")
 
L[:,0] = S[:,0]
for i in range(1,W):
    L[:,i] = (L[:,i-1] + 1) * S[:,i]
 
R[:,-1] = S[:,-1]
for i in range(1,W):
    R[:,-1-i] = (R[:,-i] + 1) * S[:,-1-i]
 
U[0] = S[0]
for i in range(1,H):
    U[i] = (U[i-1] + 1) * S[i]
 
D[-1] = S[-1]
for i in range(1,H):
    D[-1-i] = (D[-i] + 1) * S[-1-i]
 
score = L + R + U + D - 3
print(int(score.max()))

Buggy python submission (verdict: Runtime Error):
from functools import reduce
import sys
import numpy as np
MOD = 1000000007

buffer = sys.stdin.buffer
H, W = list(map(int,buffer.readline().split()))
S = np.frombuffer(buffer.read(H*(W+2)), dtype="B") == ord(".")
S = S.reshape((H,W+2))[:,:-2]
L = np.empty((H,W), dtype="i4")
R = np.empty((H,W), dtype="i4")
U = np.empty((H,W), dtype="i4")
D = np.empty((H,W), dtype="i4")
 
L[:,0] = S[:,0]
for i in range(1,W):
    L[:,i] = (L[:,i-1] + 1) * S[:,i]
 
R[:,-1] = S[:,-1]
for i in range(1,W):
    R[:,-1-i] = (R[:,-i] + 1) * S[:,-1-i]
 
U[0] = S[0]
for i in range(1,H):
    U[i] = (U[i-1] + 1) * S[i]
 
D[-1] = S[-1]
for i in range(1,H):
    D[-1-i] = (D[-i] + 1) * S[-1-i]
 
score = L + R + U + D - 3
print(int(score.max()))

Fixed submission:
from functools import reduce
import sys
import numpy as np
MOD = 1000000007

buffer = sys.stdin.buffer
H, W = list(map(int,buffer.readline().split()))
S = np.frombuffer(buffer.read(H*(W+1)), dtype="B") == ord(".")
S = S.reshape((H,W+1))[:,:-1]
L = np.empty((H,W), dtype="i4")
R = np.empty((H,W), dtype="i4")
U = np.empty((H,W), dtype="i4")
D = np.empty((H,W), dtype="i4")
 
L[:,0] = S[:,0]
for i in range(1,W):
    L[:,i] = (L[:,i-1] + 1) * S[:,i]
 
R[:,-1] = S[:,-1]
for i in range(1,W):
    R[:,-1-i] = (R[:,-i] + 1) * S[:,-1-i]
 
U[0] = S[0]
for i in range(1,H):
    U[i] = (U[i-1] + 1) * S[i]
 
D[-1] = S[-1]
for i in range(1,H):
    D[-1-i] = (D[-i] + 1) * S[-1-i]
 
score = L + R + U + D - 3
print(int(score.max()))

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
import sys
import numpy as np
MOD = 1000000007
def culc(s, h, w, x, y):
	count = 1
	return count

h, w = map(int, input().split())
s = np.zeros((h, w), int)
for i in range(h):
	s2 = input()
	for j in range(len(s2)):
		s[i][j] = (1 if s2[j] == "#" else 0)

max = 0
left = np.zeros((h, w), int)
right = np.zeros((h, w), int)
up = np.zeros((h, w), int)
down = np.zeros((h, w), int)
for i in range(h):
	for j in range(w):
		left[i][j] = 0 if s[i][j] == 1 else 1 if j <= 0 else left[i][j - 1] + 1
		right[i][w - j - 1] = 0 if s[i][w - j - 1] == 1 else 1 if j <= 0 else right[i][w - j] + 1
		up[i][j] = 0 if s[i][j] == 1 else 1 if i <= 0 else up[i - 1][j] + 1
		down[h - i - 1][j] = 0 if s[h - i - 1][j] == 1 else 1 if i <= 0 else down[h - i][j] + 1
			
for i in range(h):
	for j in range(w):
		tmp = left[i][j] + right[i][j] + up[i][j] + down[i][j] - 3
		if max < tmp:
			max = tmp

print(max)

Fixed submission:
from functools import reduce
import sys
import numpy as np
MOD = 1000000007

buffer = sys.stdin.buffer
H, W = list(map(int,buffer.readline().split()))
S = np.frombuffer(buffer.read(H*(W+1)), dtype="B") == ord(".")
S = S.reshape((H,W+1))[:,:-1]
L = np.empty((H,W), dtype="i4")
R = np.empty((H,W), dtype="i4")
U = np.empty((H,W), dtype="i4")
D = np.empty((H,W), dtype="i4")
 
L[:,0] = S[:,0]
for i in range(1,W):
    L[:,i] = (L[:,i-1] + 1) * S[:,i]
 
R[:,-1] = S[:,-1]
for i in range(1,W):
    R[:,-1-i] = (R[:,-i] + 1) * S[:,-1-i]
 
U[0] = S[0]
for i in range(1,H):
    U[i] = (U[i-1] + 1) * S[i]
 
D[-1] = S[-1]
for i in range(1,H):
    D[-1-i] = (D[-i] + 1) * S[-1-i]
 
score = L + R + U + D - 3
print(int(score.max()))

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
import sys
MOD = 1000000007
def culc(s, h, w, x, y):
	count = 1
	return count

h, w = map(int, input().split())
s = []
for i in range(h):
	s2 = input()
	s3 = []
	for j in range(len(s2)):
		s3.append(1 if s2[j] == "#" else 0)
	s.append(s3)

max = 0
left = [[0] * w for i in range(h)]
right = [[0] * w for i in range(h)]
up = [[0] * w for i in range(h)]
down = [[0] * w for i in range(h)]
for i in range(h):
	for j in range(w):
		left[i][j] = 0 if s[i][j] == 1 else 1 if j <= 0 else left[i][j - 1] + 1
		right[i][w - j - 1] = 0 if s[i][w - j - 1] == 1 else 1 if j <= 0 else right[i][w - j] + 1
		up[i][j] = 0 if s[i][j] == 1 else 1 if i <= 0 else up[i - 1][j] + 1
		down[h - i - 1][j] = 0 if s[h - i - 1][j] == 1 else 1 if i <= 0 else down[h - i][j] + 1
			
for i in range(h):
	for j in range(w):
		tmp = left[i][j] + right[i][j] + up[i][j] + down[i][j] - 3
		if max < tmp:
			max = tmp

print(max)


Fixed submission:
from functools import reduce
import sys
import numpy as np
MOD = 1000000007

buffer = sys.stdin.buffer
H, W = list(map(int,buffer.readline().split()))
S = np.frombuffer(buffer.read(H*(W+1)), dtype="B") == ord(".")
S = S.reshape((H,W+1))[:,:-1]
L = np.empty((H,W), dtype="i4")
R = np.empty((H,W), dtype="i4")
U = np.empty((H,W), dtype="i4")
D = np.empty((H,W), dtype="i4")
 
L[:,0] = S[:,0]
for i in range(1,W):
    L[:,i] = (L[:,i-1] + 1) * S[:,i]
 
R[:,-1] = S[:,-1]
for i in range(1,W):
    R[:,-1-i] = (R[:,-i] + 1) * S[:,-1-i]
 
U[0] = S[0]
for i in range(1,H):
    U[i] = (U[i-1] + 1) * S[i]
 
D[-1] = S[-1]
for i in range(1,H):
    D[-1-i] = (D[-i] + 1) * S[-1-i]
 
score = L + R + U + D - 3
print(int(score.max()))

Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
import sys
MOD = 1000000007
def culc(s, h, w, x, y):
	if s[y][x] == 1:
		return 0
	count = 1
	for i in range(x):
		if s[y][x - i - 1] == 1:
			break
		count+=1
	for i in range(w - x - 1):
		if s[y][x + i + 1] == 1:
			break
		count+=1
	for i in range(y):
		if s[y - i - 1][x] == 1:
			break
		count+=1
	for i in range(h - y - 1):
		if s[y + i + 1][x] == 1:
			break
		count+=1
	return count

h, w = map(int, input().split())
s = []
for i in range(h):
	s2 = input()
	s3 = []
	for j in range(len(s2)):
		s3.append(1 if s2[j] == "#" else 0)
	s.append(s3)

max = 0
for i in range(h):
	for j in range(w):
		tmp = culc(s, h, w, j, i)
		if max < tmp:
			max = tmp

print(max)

Fixed submission:
from functools import reduce
import sys
import numpy as np
MOD = 1000000007

buffer = sys.stdin.buffer
H, W = list(map(int,buffer.readline().split()))
S = np.frombuffer(buffer.read(H*(W+1)), dtype="B") == ord(".")
S = S.reshape((H,W+1))[:,:-1]
L = np.empty((H,W), dtype="i4")
R = np.empty((H,W), dtype="i4")
U = np.empty((H,W), dtype="i4")
D = np.empty((H,W), dtype="i4")
 
L[:,0] = S[:,0]
for i in range(1,W):
    L[:,i] = (L[:,i-1] + 1) * S[:,i]
 
R[:,-1] = S[:,-1]
for i in range(1,W):
    R[:,-1-i] = (R[:,-i] + 1) * S[:,-1-i]
 
U[0] = S[0]
for i in range(1,H):
    U[i] = (U[i-1] + 1) * S[i]
 
D[-1] = S[-1]
for i in range(1,H):
    D[-1-i] = (D[-i] + 1) * S[-1-i]
 
score = L + R + U + D - 3
print(int(score.max()))