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

#入力部
H, W = [int(i) for i in input().split()]
#mapの入力
mymap = [] #mapの配列
for i in range(H):
    mymap.append(list(input()))
Lmap = list(list(-1 for a in range(W)) for b in range(H)) #列探索配列
Rmap = list(list(-1 for a in range(W)) for b in range(H)) #列探索配列（逆順）
Umap = list(list(-1 for a in range(W)) for b in range(H)) #行探索配列
Dmap = list(list(-1 for a in range(W)) for b in range(H)) #行探索配列（逆順）

#Lmap
for i in range(H):
  mycnt = 1
  for j in range(W):
    if mymap[i][j] == '#':
      Lmap[i][j] = 0
      mycnt = 1
    else: 
      Lmap[i][j] = mycnt
      mycnt += 1
      
#Rmap
for i in range(H):
  mycnt = 1
  for j in reversed(range(W)):
    if mymap[i][j] == '#':
      Rmap[i][j] = 0
      mycnt = 1
    else: 
      Rmap[i][j] = mycnt
      mycnt += 1

#Dmap & 最大値の探索
for i in range(W):
  mycnt = 1
  for j in reversed(range(H)):
    if mymap[j][i] == '#':
      Dmap[j][i] = 0
      mycnt = 1
    else: 
      Dmap[j][i] = mycnt
      mycnt += 1

#Umap
for i in range(W):
  mycnt = 1
  for j in range(H):
    if mymap[j][i] == '#':
      Umap[j][i] = 0
      mycnt = 1
    else: 
      Umap[j][i] = mycnt
      mycnt += 1
#なぜか最後だけnparray       
print(np.max(np.array(Lmap)+np.array(Rmap)+np.array(Umap)+np.array(Dmap)) -3)



Fixed submission:
import numpy as np
 
H, W = map(int, input().split())
#mapの入力
mymap = [] 
for i in range(H):
    mymap.append(list(input()))

#探索可能性をブーリアン表記
mymap = (np.array(mymap) == ".")
  
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) #下側から探索した場合の配列

#列ごとに左から
for j in range(W):
  if j == 0: #左端
    L[:, j] = mymap[:, j] #true = 1, false = 0
  else:
    L[:, j] = (L[:, j - 1] + 1) * mymap[:, j] #trueの場合は1つ左の列の値を加算しながら

#列ごとに右から
for j in range(W - 1, -1, -1): #(引数：開始数，終了数，加算数）
  if j >= W - 1: #右端
    R[:, j] = mymap[:, j]
  else:
    R[:, j] = (R[:, j + 1] + 1) * mymap[:, j] 

#行ごとに上から
for i in range(H):
  if i <= 0: #上端
    U[i, :] = mymap[i, :]
  else:
    U[i, :] = (U[i - 1, :] + 1) * mymap[i, :]

#行ごとに下から
for i in range(H - 1, -1, -1):
  if i >= H - 1: #下端
    D[i, :] = mymap[i, :]
  else:
    D[i, :] = (D[i + 1, :] + 1) * mymap[i, :]

#総和から重複分(=3)の差をとって，最大値を出力
print(np.max(L + R + U + D - 3))

Buggy python submission (verdict: Time Limit Exceeded):
#入力部
H, W = [int(i) for i in input().split()]
#mapの入力
mymap = [] #mapの配列
for i in range(H):
    mymap.append(list(input()))
Lmap = list(list(-1 for a in range(W)) for b in range(H)) #列探索配列
Rmap = list(list(-1 for a in range(W)) for b in range(H)) #列探索配列（逆順）
Umap = list(list(-1 for a in range(W)) for b in range(H)) #行探索配列
Dmap = list(list(-1 for a in range(W)) for b in range(H)) #行探索配列（逆順）

#Lmap
for i in range(H):
  mycnt = 1
  for j in range(W):
    if mymap[i][j] == '#':
      Lmap[i][j] = 0
      mycnt = 1
    else: 
      Lmap[i][j] = mycnt
      mycnt += 1

#Rmap
for i in range(H):
  mycnt = 1
  for j in reversed(range(W)):
    if mymap[i][j] == '#':
      Rmap[i][j] = 0
      mycnt = 1
    else: 
      Rmap[i][j] = mycnt
      mycnt += 1

#Dmap & 最大値の探索
for i in range(W):
  mycnt = 1
  for j in reversed(range(H)):
    if mymap[j][i] == '#':
      Dmap[j][i] = 0
      mycnt = 1
    else: 
      Dmap[j][i] = mycnt
      mycnt += 1

#Umap
for i in range(W):
  mycnt = 1
  for j in range(H):
    if mymap[j][i] == '#':
      Umap[j][i] = 0
      mycnt = 1
    else: 
      Umap[j][i] = mycnt
      mycnt += 1

      
#Lmap  & 最大値の検索
mymax = -99
for i in range(H):
  mycnt = 1
  for j in range(W):
    if mymap[i][j] == '#':
      Lmap[i][j] = 0
      mycnt = 1
    else: 
      Lmap[i][j] = mycnt
      mycnt += 1
      #最大値の検索
      if Lmap[i][j]+ Rmap[i][j]+ Umap[i][j]+ Dmap[i][j] > mymax:
        mymax = Lmap[i][j]+ Rmap[i][j]+ Umap[i][j]+ Dmap[i][j] 
        
print(mymax-3)

Fixed submission:
import numpy as np
 
H, W = map(int, input().split())
#mapの入力
mymap = [] 
for i in range(H):
    mymap.append(list(input()))

#探索可能性をブーリアン表記
mymap = (np.array(mymap) == ".")
  
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) #下側から探索した場合の配列

#列ごとに左から
for j in range(W):
  if j == 0: #左端
    L[:, j] = mymap[:, j] #true = 1, false = 0
  else:
    L[:, j] = (L[:, j - 1] + 1) * mymap[:, j] #trueの場合は1つ左の列の値を加算しながら

#列ごとに右から
for j in range(W - 1, -1, -1): #(引数：開始数，終了数，加算数）
  if j >= W - 1: #右端
    R[:, j] = mymap[:, j]
  else:
    R[:, j] = (R[:, j + 1] + 1) * mymap[:, j] 

#行ごとに上から
for i in range(H):
  if i <= 0: #上端
    U[i, :] = mymap[i, :]
  else:
    U[i, :] = (U[i - 1, :] + 1) * mymap[i, :]

#行ごとに下から
for i in range(H - 1, -1, -1):
  if i >= H - 1: #下端
    D[i, :] = mymap[i, :]
  else:
    D[i, :] = (D[i + 1, :] + 1) * mymap[i, :]

#総和から重複分(=3)の差をとって，最大値を出力
print(np.max(L + R + U + D - 3))

Buggy python submission (verdict: Time Limit Exceeded):
#入力部
H, W = [int(i) for i in input().split()]
#mapの入力
mymap = [] #mapの配列
for i in range(H):
    mymap.append(list(input()))
Lmap = list(list(-1 for a in range(W)) for b in range(H)) #列探索配列
Rmap = list(list(-1 for a in range(W)) for b in range(H)) #列探索配列（逆順）
Umap = list(list(-1 for a in range(W)) for b in range(H)) #行探索配列
Dmap = list(list(-1 for a in range(W)) for b in range(H)) #行探索配列（逆順）

#Lmap
for i in range(H):
  mycnt = 1
  for j in range(W):
    if mymap[i][j] == '#':
      Lmap[i][j] = 0
      mycnt = 1
    else: 
      Lmap[i][j] = mycnt
      mycnt += 1

#Rmap
for i in range(H):
  mycnt = 1
  for j in reversed(range(W)):
    if mymap[i][j] == '#':
      Rmap[i][j] = 0
      mycnt = 1
    else: 
      Rmap[i][j] = mycnt
      mycnt += 1

#Umap
for i in range(W):
  mycnt = 1
  for j in range(H):
    if mymap[j][i] == '#':
      Umap[j][i] = 0
      mycnt = 1
    else: 
      Umap[j][i] = mycnt
      mycnt += 1

#Dmap
for i in range(W):
  mycnt = 1
  for j in reversed(range(H)):
    if mymap[j][i] == '#':
      Dmap[j][i] = 0
      mycnt = 1
    else: 
      Dmap[j][i] = mycnt
      mycnt += 1

      #最大値の検索
mymax = -99
for i in range(H):
  for j in range(W):
    if Lmap[i][j]+ Rmap[i][j]+ Umap[i][j]+ Dmap[i][j] > mymax:
      mymax = Lmap[i][j]+ Rmap[i][j]+ Umap[i][j]+ Dmap[i][j] 
      
print(mymax-3)

Fixed submission:
import numpy as np
 
H, W = map(int, input().split())
#mapの入力
mymap = [] 
for i in range(H):
    mymap.append(list(input()))

#探索可能性をブーリアン表記
mymap = (np.array(mymap) == ".")
  
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) #下側から探索した場合の配列

#列ごとに左から
for j in range(W):
  if j == 0: #左端
    L[:, j] = mymap[:, j] #true = 1, false = 0
  else:
    L[:, j] = (L[:, j - 1] + 1) * mymap[:, j] #trueの場合は1つ左の列の値を加算しながら

#列ごとに右から
for j in range(W - 1, -1, -1): #(引数：開始数，終了数，加算数）
  if j >= W - 1: #右端
    R[:, j] = mymap[:, j]
  else:
    R[:, j] = (R[:, j + 1] + 1) * mymap[:, j] 

#行ごとに上から
for i in range(H):
  if i <= 0: #上端
    U[i, :] = mymap[i, :]
  else:
    U[i, :] = (U[i - 1, :] + 1) * mymap[i, :]

#行ごとに下から
for i in range(H - 1, -1, -1):
  if i >= H - 1: #下端
    D[i, :] = mymap[i, :]
  else:
    D[i, :] = (D[i + 1, :] + 1) * mymap[i, :]

#総和から重複分(=3)の差をとって，最大値を出力
print(np.max(L + R + U + D - 3))

Buggy python submission (verdict: Time Limit Exceeded):
#入力部
H, W = [int(i) for i in input().split()]

mymap = [] #mapの配列
myansmap = list(list(-1 for a in range(W)) for b in range(H)) #列方向を探索配列
myansmap2 = list(list(-1 for a in range(W)) for b in range(H)) #行方向を探索配列

#入力しながら，列方向を探索する
for i in range(H):
  myinput =  input()
  for j in range(W):
    if myinput[j] == '#':
      myansmap[i][j] = 0
    elif myinput[j] == '.':
      if myansmap [i][j] == -1 :
        mycnt = 0
        for m in range(j,W):
          if myinput[m] == '#':
            break
          mycnt += 1
      for k in range(j, m+1):
        myansmap[i][k] = mycnt
  mymap.append(myinput)

mymax = -99 #出力用変数

#行方向を探索する
for i in range(H):
  for j in range(W):
    #探索していない箇所について
    if myansmap2 [i][j] == -1:
      mycnt = 0
      for m in range(i,H):
        if myansmap[m][j] == 0:
          break
        mycnt += 1
      for k in range(i, m+1):
        if i > 0 and i < H or  j > 0 and i < W:
          myansmap2[k][j] = mycnt
        else: 
          myansmap2[k][j] = mycnt
    if myansmap[i][j] == 0:
      myansmap2[i][j] = 0

      
    if mymax < myansmap[i][j] + myansmap2[i][j]:
      mymax=myansmap[i][j] + myansmap2[i][j]

print(mymax-1)

Fixed submission:
import numpy as np
 
H, W = map(int, input().split())
#mapの入力
mymap = [] 
for i in range(H):
    mymap.append(list(input()))

#探索可能性をブーリアン表記
mymap = (np.array(mymap) == ".")
  
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) #下側から探索した場合の配列

#列ごとに左から
for j in range(W):
  if j == 0: #左端
    L[:, j] = mymap[:, j] #true = 1, false = 0
  else:
    L[:, j] = (L[:, j - 1] + 1) * mymap[:, j] #trueの場合は1つ左の列の値を加算しながら

#列ごとに右から
for j in range(W - 1, -1, -1): #(引数：開始数，終了数，加算数）
  if j >= W - 1: #右端
    R[:, j] = mymap[:, j]
  else:
    R[:, j] = (R[:, j + 1] + 1) * mymap[:, j] 

#行ごとに上から
for i in range(H):
  if i <= 0: #上端
    U[i, :] = mymap[i, :]
  else:
    U[i, :] = (U[i - 1, :] + 1) * mymap[i, :]

#行ごとに下から
for i in range(H - 1, -1, -1):
  if i >= H - 1: #下端
    D[i, :] = mymap[i, :]
  else:
    D[i, :] = (D[i + 1, :] + 1) * mymap[i, :]

#総和から重複分(=3)の差をとって，最大値を出力
print(np.max(L + R + U + D - 3))

Buggy python submission (verdict: Runtime Error):
#入力部
H, W = [int(i) for i in input().split()]

mymap = [] 　#mapの配列
myansmap = list(list(-1 for a in range(W)) for b in range(H))　#列方向を探索配列
myansmap2 = list(list(-1 for a in range(W)) for b in range(H))　#行方向を探索配列

#入力しながら，列方向を探索する
for i in range(H):
  myinput =  input()
  for j in range(W):
    if myinput[j] == '#':
      myansmap[i][j] = 0
    elif myinput[j] == '.':
      if myansmap [i][j] == -1 :
        mycnt = 0
        for m in range(j,W):
          if myinput[m] == '#':
            break
          mycnt += 1
      for k in range(j, m+1):
        myansmap[i][k] = mycnt
  mymap.append(myinput)

mymax = -99　#出力用変数

#行方向を探索する
for i in range(H):
  for j in range(W):
    #探索していない箇所について
    if myansmap2 [i][j] == -1:
      mycnt = 0
      for m in range(i,H):
        if myansmap[m][j] == 0:
          break
        mycnt += 1
      for k in range(i, m+1):
        if i > 0 and i < H or  j > 0 and i < W:
          myansmap2[k][j] = mycnt
        else: 
          myansmap2[k][j] = mycnt
    if myansmap[i][j] == 0:
      myansmap2[i][j] = 0

      
    if mymax < myansmap[i][j] + myansmap2[i][j]:
      mymax=myansmap[i][j] + myansmap2[i][j]

print(mymax-1) 



Fixed submission:
import numpy as np
 
H, W = map(int, input().split())
#mapの入力
mymap = [] 
for i in range(H):
    mymap.append(list(input()))

#探索可能性をブーリアン表記
mymap = (np.array(mymap) == ".")
  
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) #下側から探索した場合の配列

#列ごとに左から
for j in range(W):
  if j == 0: #左端
    L[:, j] = mymap[:, j] #true = 1, false = 0
  else:
    L[:, j] = (L[:, j - 1] + 1) * mymap[:, j] #trueの場合は1つ左の列の値を加算しながら

#列ごとに右から
for j in range(W - 1, -1, -1): #(引数：開始数，終了数，加算数）
  if j >= W - 1: #右端
    R[:, j] = mymap[:, j]
  else:
    R[:, j] = (R[:, j + 1] + 1) * mymap[:, j] 

#行ごとに上から
for i in range(H):
  if i <= 0: #上端
    U[i, :] = mymap[i, :]
  else:
    U[i, :] = (U[i - 1, :] + 1) * mymap[i, :]

#行ごとに下から
for i in range(H - 1, -1, -1):
  if i >= H - 1: #下端
    D[i, :] = mymap[i, :]
  else:
    D[i, :] = (D[i + 1, :] + 1) * mymap[i, :]

#総和から重複分(=3)の差をとって，最大値を出力
print(np.max(L + R + U + D - 3))