Submission #7597587


Source Code Expand

Copy
t,*l=open(0)
h,w=map(int,t.split())
grid = [[c=="."for c in C]for C in l]
L,R,U,D = eval("[[0]*(w+2) for _ in range(h+2)],"*4)
for y in range(h):
	for x in range(w):
		L[y+1][x+1] = (L[y+1][x]+1)*grid[y][x]
		R[y+1][w-x] = (R[y+1][w-x+1]+1)*grid[y][w-x-1]
for x in range(w):
	for y in range(h):
		U[y+1][x+1] = (U[y][x+1]+1)*grid[y][x]
		D[h-y][x+1] = (D[h-y+1][x+1]+1)*grid[h-y-1][x]
print(max(L[y][x] + R[y][x] + U[y][x] + D[y][x] -3 for y in range(1,h+1) for x in range(1,w+1)))

Submission Info

Submission Time
Task D - Lamp
User KouCuriosity
Language PyPy3 (2.4.0)
Score 400
Code Size 493 Byte
Status
Exec Time 1849 ms
Memory 211336 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 01.txt, 02.txt
All 400 / 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 171 ms 38256 KB
02.txt 171 ms 38256 KB
11.txt 1770 ms 211336 KB
12.txt 1729 ms 209416 KB
13.txt 1779 ms 209160 KB
14.txt 1737 ms 209416 KB
15.txt 1658 ms 201224 KB
16.txt 1849 ms 208904 KB
17.txt 1827 ms 209544 KB
18.txt 1779 ms 209544 KB
19.txt 1562 ms 189832 KB
20.txt 195 ms 40944 KB
21.txt 172 ms 38256 KB
22.txt 204 ms 41712 KB
23.txt 1762 ms 209416 KB
24.txt 188 ms 40176 KB
25.txt 201 ms 42352 KB