結果
| 問題 |
No.402 最も海から遠い場所
|
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2016-07-26 13:58:59 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,973 ms / 3,000 ms |
| コード長 | 730 bytes |
| コンパイル時間 | 241 ms |
| コンパイル使用メモリ | 82,256 KB |
| 実行使用メモリ | 165,988 KB |
| 最終ジャッジ日時 | 2024-11-06 16:58:04 |
| 合計ジャッジ時間 | 8,671 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 |
ソースコード
#!/usr/bin/env pypy3
import array
import itertools
def compute(height, width, is_sea):
square_size = 0
dp = [array.array("L", (0 for _ in range(width + 2)))
for _ in range(height + 2)]
for r, c in itertools.product(range(1, height + 1), range(1, width + 1)):
if not is_sea[r - 1][c - 1]:
dp[r][c] = min(dp[r - 1][c - 1], dp[r - 1][c], dp[r][c - 1]) + 1
square_size = max(square_size, dp[r][c])
return (square_size + 1) // 2
def main():
height, width = map(int, input().split())
is_sea = [array.array("B", map(lambda x: x == ".", input()))
for _ in range(height)]
print(compute(height, width, is_sea))
if __name__ == '__main__':
main()
はむ吉🐹