Buggy python submission (verdict: Time Limit Exceeded):
import copy
h,w = map(int,input().split())
s = [list(input()) for _ in range(h)]
l,r,u,d,S = [[0]*w for _ in range(h)],[[0]*w for _ in range(h)],[[0]*w for _ in range(h)],[[0]*w for _ in range(h)],[[0]*w for _ in range(h)]
for i in range(h):
  if s[i][0] == ".":
    l[i][0] = 1
  for j in range(1,w):
    if s[i][j] == ".":
      l[i][j] = l[i][j-1] + 1
#print(l)
for i in range(h):
  if s[i][w-1] == ".":
    r[i][w-1] = 1
  for j in range(w-2,-1,-1):
    if s[i][j] == ".":
      r[i][j] = r[i][j+1] + 1
#print(r)
for i in range(w):
  if s[0][i] == ".":
    u[0][i] = 1
  for j in range(1,h):
    if s[j][i] == ".":
      u[j][i] = u[j-1][i] + 1
#print(u)
for i in range(w):
  if s[h-1][i] == ".":
    d[h-1][i] = 1
  for j in range(h-2,-1,-1):
    if s[j][i] == ".":
      d[j][i] = d[j+1][i] + 1
m = 0
for i in range(h):
  for j in range(w):
    m = max(m,l[i][j]+r[i][j]+u[i][j]+d[i][j]-3)
print(m)

Fixed submission:
import numpy as np
h,w = map(int,input().split())
s = np.array([[1 if i == "." else 0 for i in input()] for j in range(h)])
l,r,u,d = np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w))
for i in range(h):
  u[i] = (u[i-1]+1)*s[i]
  d[-i-1] = (d[-i]+1)*s[-i-1]
for i in range(w):
  l[:,i] = (l[:,i-1]+1)*s[:,i]
  r[:,-i-1] = (r[:,-i]+1)*s[:,-i-1]
print(int(np.max(l+r+u+d))-3)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
import numpy as np
h,w = map(int,input().split())
s = [list(input()) for _ in range(h)]
l,r,u,d,S = [[0]*w for _ in range(h)],[[0]*w for _ in range(h)],[[0]*w for _ in range(h)],[[0]*w for _ in range(h)],[[0]*w for _ in range(h)]
for i in range(h):
  if s[i][0] == ".":
    l[i][0] = 1
  for j in range(1,w):
    if s[i][j] == ".":
      l[i][j] = l[i][j-1] + 1
#print(l)
for i in range(h):
  if s[i][w-1] == ".":
    r[i][w-1] = 1
  for j in range(w-2,-1,-1):
    if s[i][j] == ".":
      r[i][j] = r[i][j+1] + 1
#print(r)
for i in range(w):
  if s[0][i] == ".":
    u[0][i] = 1
  for j in range(1,h):
    if s[j][i] == ".":
      u[j][i] = u[j-1][i] + 1
#print(u)
for i in range(w):
  if s[h-1][i] == ".":
    d[h-1][i] = 1
  for j in range(h-2,-1,-1):
    if s[j][i] == ".":
      d[j][i] = d[j+1][i] + 1

for i in range(h):
  for j in range(w):
    S[i][j] = max(0,l[i][j]+r[i][j]+u[i][j]+d[i][j]-3)

print(np.amax(S))

Fixed submission:
import numpy as np
h,w = map(int,input().split())
s = np.array([[1 if i == "." else 0 for i in input()] for j in range(h)])
l,r,u,d = np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w))
for i in range(h):
  u[i] = (u[i-1]+1)*s[i]
  d[-i-1] = (d[-i]+1)*s[-i-1]
for i in range(w):
  l[:,i] = (l[:,i-1]+1)*s[:,i]
  r[:,-i-1] = (r[:,-i]+1)*s[:,-i-1]
print(int(np.max(l+r+u+d))-3)

Buggy python submission (verdict: Runtime Error):
import numpy
h,w=map(int,input().split())
a = []
for i in range(h):
  l = input()
  l = list(l)
  a.append(l)

L = []
R = []
for i in range(h):
  l = []
  r = []
  k = 0
  m = 0
  for j in range(w):
    if a[i][w-j-1] == ".":
      k += 1
    else:
      k = 0
    if a[i][j] == ".":
      m += 1
    else:
      m = 0
    r.insert(0,k)
    l.append(m)
  R.append(r)
  L.append(l)

D = []
U = []
for i in range(h):
  D.append([])
  U.append([])
for i in range(w):
  k = 0
  m = 0
  for j in range(h):
    if a[j][i] == ".":
      k += 1
    else:
      k = 0
    if a[h-j-1][i] == ".":
      m += 1
    else:
      m = 0
    U[j].append(k)
    D[h-j-1].append(m)
A = numpy.array(L)+numpy.array(R)+numpy.array(U)+numpy.array(D)
print(max(numpy.amax(A-3),0))

Fixed submission:
import numpy as np
h,w = map(int,input().split())
s = np.array([[1 if i == "." else 0 for i in input()] for j in range(h)])
l,r,u,d = np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w))
for i in range(h):
  u[i] = (u[i-1]+1)*s[i]
  d[-i-1] = (d[-i]+1)*s[-i-1]
for i in range(w):
  l[:,i] = (l[:,i-1]+1)*s[:,i]
  r[:,-i-1] = (r[:,-i]+1)*s[:,-i-1]
print(int(np.max(l+r+u+d))-3)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy
h,w=map(int,input().split())
a = []
for i in range(h):
  l = input()
  l = list(l)
  a.append(l)

L = []
R = []
for i in range(h):
  l = []
  r = []
  k = 0
  m = 0
  for j in range(w):
    if a[i][w-j-1] == ".":
      k += 1
    else:
      k = 0
    if a[i][j] == ".":
      m += 1
    else:
      m = 0
    r.insert(0,k)
    l.append(m)
  R.append(r)
  L.append(l)

D = []
U = []
for i in range(h):
  D.append([])
  U.append([])
for i in range(w):
  k = 0
  m = 0
  for j in range(h):
    if a[j][i] == ".":
      k += 1
    else:
      k = 0
    if a[h-j-1][i] == ".":
      m += 1
    else:
      m = 0
    U[j].append(k)
    D[h-j-1].append(m)
A = numpy.array(L)+numpy.array(R)+numpy.array(U)+numpy.array(D)
print(max(numpy.amax(A-3),0))

Fixed submission:
import numpy as np
h,w = map(int,input().split())
s = np.array([[1 if i == "." else 0 for i in input()] for j in range(h)])
l,r,u,d = np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w))
for i in range(h):
  u[i] = (u[i-1]+1)*s[i]
  d[-i-1] = (d[-i]+1)*s[-i-1]
for i in range(w):
  l[:,i] = (l[:,i-1]+1)*s[:,i]
  r[:,-i-1] = (r[:,-i]+1)*s[:,-i-1]
print(int(np.max(l+r+u+d))-3)

Buggy python submission (verdict: Time Limit Exceeded):
h,w=map(int,input().split())
a = []
for i in range(h):
  l = input()
  l = list(l)
  a.append(l)
arrh = []
arrw = []
for i in range(w):
  arr = []
  c = 0
  k = 0
  while k < h:
    if a[k][i] == "#":
      for j in range(c):
        arr.append(c)
      arr.append(0)
      c = 0
    elif a[k][i] == "." and k == h - 1:
      for j in range(c+1):
        arr.append(c+1)
    elif a[k][i] == ".":
      c += 1
    k += 1
  arrh.append(arr)
for i in range(h):
  arr = []
  c = 0
  k = 0
  while k < w:
    if a[i][k] == "#":
      for j in range(c):
        arr.append(c)
      arr.append(0)
      c = 0
    elif a[i][k] == "." and k == w - 1:
      for j in range(c+1):
        arr.append(c+1)
    elif a[i][k] == ".":
      c += 1
    k += 1
  arrw.append(arr)
arrf = []
for i in range(h):
  for j in range(w):
    arrf.append(arrh[j][i] + arrw[i][j] - 1)
print(max(arrf))

Fixed submission:
import numpy as np
h,w = map(int,input().split())
s = np.array([[1 if i == "." else 0 for i in input()] for j in range(h)])
l,r,u,d = np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w)),np.zeros((h,w))
for i in range(h):
  u[i] = (u[i-1]+1)*s[i]
  d[-i-1] = (d[-i]+1)*s[-i-1]
for i in range(w):
  l[:,i] = (l[:,i-1]+1)*s[:,i]
  r[:,-i-1] = (r[:,-i]+1)*s[:,-i-1]
print(int(np.max(l+r+u+d))-3)