結果

問題 No.402 最も海から遠い場所
ユーザー はむ吉🐹はむ吉🐹
提出日時 2016-07-26 14:05:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 358 ms / 3,000 ms
コード長 556 bytes
コンパイル時間 219 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 147,712 KB
最終ジャッジ日時 2024-04-24 09:33:22
合計ジャッジ時間 3,870 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,480 KB
testcase_01 AC 40 ms
51,840 KB
testcase_02 AC 43 ms
59,136 KB
testcase_03 AC 38 ms
51,840 KB
testcase_04 AC 35 ms
51,968 KB
testcase_05 AC 36 ms
52,224 KB
testcase_06 AC 36 ms
51,968 KB
testcase_07 AC 36 ms
51,968 KB
testcase_08 AC 36 ms
51,968 KB
testcase_09 AC 34 ms
52,480 KB
testcase_10 AC 35 ms
51,968 KB
testcase_11 AC 45 ms
59,648 KB
testcase_12 AC 36 ms
52,864 KB
testcase_13 AC 55 ms
63,104 KB
testcase_14 AC 62 ms
67,584 KB
testcase_15 AC 70 ms
70,784 KB
testcase_16 AC 79 ms
73,728 KB
testcase_17 AC 229 ms
110,976 KB
testcase_18 AC 333 ms
147,712 KB
testcase_19 AC 226 ms
146,944 KB
testcase_20 AC 358 ms
146,944 KB
testcase_21 AC 348 ms
147,072 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