結果

問題 No.402 最も海から遠い場所
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-09-04 15:20:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 337 ms / 3,000 ms
コード長 546 bytes
コンパイル時間 209 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 81,664 KB
最終ジャッジ日時 2024-04-29 15:49:03
合計ジャッジ時間 4,013 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
55,552 KB
testcase_01 AC 46 ms
55,680 KB
testcase_02 AC 56 ms
63,872 KB
testcase_03 AC 46 ms
54,912 KB
testcase_04 AC 43 ms
55,552 KB
testcase_05 AC 43 ms
55,168 KB
testcase_06 AC 43 ms
55,168 KB
testcase_07 AC 43 ms
55,296 KB
testcase_08 AC 43 ms
55,808 KB
testcase_09 AC 42 ms
55,680 KB
testcase_10 AC 42 ms
55,680 KB
testcase_11 AC 50 ms
65,408 KB
testcase_12 AC 42 ms
56,164 KB
testcase_13 AC 57 ms
70,508 KB
testcase_14 AC 61 ms
69,120 KB
testcase_15 AC 76 ms
76,928 KB
testcase_16 AC 79 ms
77,312 KB
testcase_17 AC 264 ms
78,336 KB
testcase_18 AC 320 ms
81,536 KB
testcase_19 AC 240 ms
81,664 KB
testcase_20 AC 337 ms
81,664 KB
testcase_21 AC 327 ms
81,532 KB
権限があれば一括ダウンロードができます

ソースコード

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())
M = 1
dp0 = list(input())[:-1]
dp0 = [int(i=='#') for i in dp0]
for _ in range(H-1):
    dp1 = list(input())[:-1]
    dp1 = [int(i=='#') for i in dp1]
    for j in range(1,W):
        if dp1[j]==1:
            dp1[j] = min(dp1[j-1],dp0[j],dp0[j-1])+1
            M = max(M,dp1[j])
    dp0 = dp1[:]
print((M+1)//2)
0