結果

問題 No.402 最も海から遠い場所
ユーザー mkawa2mkawa2
提出日時 2020-04-18 16:28:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 387 ms / 3,000 ms
コード長 1,198 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 82,460 KB
実行使用メモリ 156,252 KB
最終ジャッジ日時 2024-04-14 20:59:41
合計ジャッジ時間 3,884 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 48 ms
54,808 KB
testcase_01 AC 43 ms
54,792 KB
testcase_02 AC 47 ms
62,004 KB
testcase_03 AC 45 ms
55,704 KB
testcase_04 AC 44 ms
55,316 KB
testcase_05 AC 41 ms
55,688 KB
testcase_06 AC 41 ms
54,992 KB
testcase_07 AC 41 ms
55,164 KB
testcase_08 AC 41 ms
55,168 KB
testcase_09 AC 42 ms
55,384 KB
testcase_10 AC 43 ms
55,056 KB
testcase_11 AC 48 ms
62,324 KB
testcase_12 AC 42 ms
55,576 KB
testcase_13 AC 56 ms
65,844 KB
testcase_14 AC 57 ms
66,716 KB
testcase_15 AC 67 ms
71,116 KB
testcase_16 AC 72 ms
73,404 KB
testcase_17 AC 236 ms
111,416 KB
testcase_18 AC 385 ms
153,664 KB
testcase_19 AC 222 ms
153,552 KB
testcase_20 AC 387 ms
156,252 KB
testcase_21 AC 337 ms
153,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
import sys

sys.setrecursionlimit(10 ** 6)
from bisect import *
from collections import *
from heapq import *

def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def SI(): return sys.stdin.readline()[:-1]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
int1 = lambda x: int(x) - 1
def MI1(): return map(int1, sys.stdin.readline().split())
def LI1(): return list(map(int1, sys.stdin.readline().split()))
p2D = lambda x: print(*x, sep="\n")
dij = [(1, 0), (0, 1), (-1, 0), (0, -1)]

def main():
    h,w=MI()
    ss=[SI() for _ in range(h)]
    # 陸地に出来る最大正方形を見つける
    # 参考https://qiita.com/gushwell/items/4ab87b52f6511f11f58d
    # そのマスを右下とする正方形がとれる、最大の辺の長さ
    qq=[[0]*w for _ in range(h)]
    for i in range(h):
        for j in range(w):
            if ss[i][j]=="#":
                if i*j:qq[i][j]=min(qq[i-1][j-1],qq[i-1][j],qq[i][j-1])+1
                else:qq[i][j]=1
    #p2D(qq)
    mx=max(max(row) for row in qq)
    print((mx+1)//2)

main()
0