結果

問題 No.402 最も海から遠い場所
ユーザー H3PO4H3PO4
提出日時 2020-07-20 17:23:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 440 bytes
コンパイル時間 1,064 ms
コンパイル使用メモリ 87,016 KB
実行使用メモリ 148,992 KB
最終ジャッジ日時 2023-08-25 18:08:59
合計ジャッジ時間 5,951 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,232 KB
testcase_01 AC 68 ms
71,228 KB
testcase_02 AC 76 ms
76,332 KB
testcase_03 WA -
testcase_04 AC 69 ms
71,388 KB
testcase_05 AC 69 ms
71,260 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 69 ms
71,088 KB
testcase_09 AC 71 ms
71,584 KB
testcase_10 AC 71 ms
71,120 KB
testcase_11 AC 79 ms
76,544 KB
testcase_12 AC 69 ms
71,376 KB
testcase_13 AC 84 ms
76,080 KB
testcase_14 AC 84 ms
76,448 KB
testcase_15 AC 94 ms
76,400 KB
testcase_16 AC 98 ms
76,664 KB
testcase_17 AC 264 ms
106,800 KB
testcase_18 AC 408 ms
148,604 KB
testcase_19 AC 268 ms
148,992 KB
testcase_20 AC 400 ms
148,856 KB
testcase_21 AC 323 ms
148,852 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W = map(int, input().split())
S = [input() for _ in range(H)]

dp = [[0] * W for _ in range(H)]
for h in range(H):
    if S[h][0] == '#':
        dp[h][0] = 1
for w in range(1, W):
    if S[0][w] == '#':
        dp[0][w] = 1

M = 0
for h in range(1, H):
    for w in range(1, W):
        if S[h][w] == '#':
            dp[h][w] = min(dp[h - 1][w], dp[h][w - 1], dp[h - 1][w - 1]) + 1
            M = max(M, dp[h][w])
print((M + 1) // 2)
0