Submission #8508376


Source Code Expand

Copy
H, W = map(int, input().split())
S = ["#"*(W+2)] + ["#"+input()+"#" for _ in range(H)] + ["#"*(W+2)]

T = [[[0]*4 for _ in range(W+2)] for _ in range(H+2)]
for y in range(H+2):
  for x in range(W+2):
    if S[y][x]==".":
      T[y][x][0] = T[y][x-1][0]+1
      T[y][x][1] = T[y-1][x][1]+1
for y in range(H+2)[::-1]:
  for x in range(W+2)[::-1]:
    if S[y][x]==".":
      T[y][x][2] = T[y][x+1][2]+1
      T[y][x][3] = T[y+1][x][3]+1

ans = 0
for y in range(H+2):
  for x in range(W+2):
    ans = max(ans, sum(T[y][x])-3)
print(ans)

Submission Info

Submission Time
Task I - Lamp
User kusano
Language Python3 (3.4.3)
Score 0
Code Size 553 Byte
Status
Exec Time 2132 ms
Memory 442100 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 01.txt, 02.txt
All 0 / 400 01.txt, 02.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, 23.txt, 24.txt, 25.txt
Case Name Status Exec Time Memory
01.txt 18 ms 3064 KB
02.txt 18 ms 3064 KB
11.txt 2131 ms 441972 KB
12.txt 2132 ms 441972 KB
13.txt 2131 ms 442100 KB
14.txt 2132 ms 441972 KB
15.txt 2132 ms 441716 KB
16.txt 2131 ms 442100 KB
17.txt 2132 ms 441972 KB
18.txt 2132 ms 441972 KB
19.txt 2131 ms 428404 KB
20.txt 38 ms 4340 KB
21.txt 18 ms 3064 KB
22.txt 64 ms 7924 KB
23.txt 2131 ms 442100 KB
24.txt 27 ms 3700 KB
25.txt 33 ms 4084 KB