結果

問題 No.402 最も海から遠い場所
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-07-26 14:05:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 368 ms / 3,000 ms
コード長 556 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 147,464 KB
最終ジャッジ日時 2024-11-06 16:58:16
合計ジャッジ時間 3,770 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
52,500 KB
testcase_01 AC 40 ms
52,272 KB
testcase_02 AC 47 ms
59,600 KB
testcase_03 AC 38 ms
53,344 KB
testcase_04 AC 39 ms
52,792 KB
testcase_05 AC 38 ms
53,360 KB
testcase_06 AC 39 ms
52,604 KB
testcase_07 AC 39 ms
53,348 KB
testcase_08 AC 39 ms
52,200 KB
testcase_09 AC 39 ms
52,156 KB
testcase_10 AC 40 ms
53,384 KB
testcase_11 AC 46 ms
61,176 KB
testcase_12 AC 40 ms
52,944 KB
testcase_13 AC 56 ms
64,548 KB
testcase_14 AC 65 ms
67,452 KB
testcase_15 AC 71 ms
71,676 KB
testcase_16 AC 78 ms
73,816 KB
testcase_17 AC 240 ms
110,788 KB
testcase_18 AC 348 ms
147,464 KB
testcase_19 AC 232 ms
147,088 KB
testcase_20 AC 338 ms
147,300 KB
testcase_21 AC 368 ms
147,228 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env pypy3


def main():
    height, width = map(int, input().split())
    square_size = 0
    dp = [[0 for _ in range(width + 2)] for _ in range(height + 2)]
    for r in range(1, height + 1):
        row = input()
        for c in range(1, width + 1):
            if row[c - 1] == "#":
                dp[r][c] = min(dp[r - 1][c - 1], dp[r - 1][c], dp[r][c - 1])
                dp[r][c] += 1
                square_size = max(square_size, dp[r][c])
    answer = (square_size + 1) // 2
    print(answer)


if __name__ == '__main__':
    main()
0