結果

問題 No.402 最も海から遠い場所
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-09-04 15:13:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 570 bytes
コンパイル時間 85 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 84,224 KB
最終ジャッジ日時 2024-04-29 15:43:20
合計ジャッジ時間 7,331 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
16,256 KB
testcase_01 AC 32 ms
10,752 KB
testcase_02 AC 35 ms
10,880 KB
testcase_03 AC 36 ms
10,624 KB
testcase_04 AC 34 ms
10,880 KB
testcase_05 AC 31 ms
10,624 KB
testcase_06 AC 31 ms
10,752 KB
testcase_07 AC 32 ms
10,624 KB
testcase_08 AC 31 ms
10,752 KB
testcase_09 AC 31 ms
10,752 KB
testcase_10 AC 32 ms
10,880 KB
testcase_11 AC 33 ms
11,008 KB
testcase_12 AC 33 ms
10,624 KB
testcase_13 AC 73 ms
11,648 KB
testcase_14 AC 51 ms
11,008 KB
testcase_15 AC 245 ms
14,336 KB
testcase_16 AC 454 ms
16,128 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

# import pypyjit
# pypyjit.set_param('max_unroll_recursion=-1')
from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

H,W = map(int,input().split())
S = [list(input())[:-1] for _ in range(H)]
for i in range(H):
    for j in range(W):
        S[i][j] = int(S[i][j]=='#')

dp = [S[i][:] for i in range(H)]
for i in range(1,H):
    for j in range(1,W):
        if S[i][j]==1:
            dp[i][j] = min(dp[i][j-1],dp[i-1][j],dp[i-1][j-1])+1

print((max(max(dp[i]) for i in range(H))+1)//2)
0