結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,224 KB
testcase_01 AC 37 ms
52,096 KB
testcase_02 AC 48 ms
61,568 KB
testcase_03 AC 38 ms
52,352 KB
testcase_04 AC 39 ms
52,224 KB
testcase_05 AC 36 ms
52,608 KB
testcase_06 AC 36 ms
52,224 KB
testcase_07 AC 36 ms
52,608 KB
testcase_08 AC 38 ms
52,224 KB
testcase_09 AC 37 ms
52,352 KB
testcase_10 AC 37 ms
52,480 KB
testcase_11 AC 46 ms
61,440 KB
testcase_12 AC 37 ms
53,632 KB
testcase_13 AC 71 ms
76,288 KB
testcase_14 AC 80 ms
76,672 KB
testcase_15 AC 101 ms
78,592 KB
testcase_16 AC 140 ms
79,488 KB
testcase_17 AC 497 ms
111,488 KB
testcase_18 AC 1,827 ms
158,464 KB
testcase_19 AC 317 ms
155,648 KB
testcase_20 AC 1,807 ms
158,720 KB
testcase_21 AC 864 ms
156,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env pypy3

import array
import itertools


def main():
    height, width = map(int, input().split())
    square_size = 0
    dp = [array.array("L", (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