結果

問題 No.402 最も海から遠い場所
ユーザー lloyzlloyz
提出日時 2023-01-26 20:17:17
言語 PyPy3
(7.3.15)
結果
MLE  
実行時間 -
コード長 422 bytes
コンパイル時間 438 ms
コンパイル使用メモリ 86,740 KB
実行使用メモリ 707,728 KB
最終ジャッジ日時 2023-09-09 19:11:45
合計ジャッジ時間 12,124 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,228 KB
testcase_01 AC 67 ms
71,056 KB
testcase_02 AC 82 ms
76,020 KB
testcase_03 AC 69 ms
71,408 KB
testcase_04 AC 69 ms
71,392 KB
testcase_05 AC 68 ms
71,044 KB
testcase_06 AC 68 ms
71,084 KB
testcase_07 AC 68 ms
71,212 KB
testcase_08 AC 68 ms
71,232 KB
testcase_09 AC 67 ms
70,980 KB
testcase_10 AC 69 ms
71,232 KB
testcase_11 AC 81 ms
76,460 KB
testcase_12 AC 70 ms
71,212 KB
testcase_13 AC 106 ms
79,288 KB
testcase_14 AC 104 ms
78,156 KB
testcase_15 AC 136 ms
87,432 KB
testcase_16 AC 151 ms
93,616 KB
testcase_17 AC 796 ms
330,884 KB
testcase_18 MLE -
testcase_19 MLE -
testcase_20 MLE -
testcase_21 MLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

h, w = map(int, input().split())
S = [list(input()) for _ in range(h)]

ans = 1
DP = [[0 for _ in range(w)] for _ in range(h)]
for i in range(h):
    for j in range(w):
        DP[i][j] = S[i][j] == '#'
for i in range(h - 1):
    for j in range(1, w):
        if DP[i + 1][j] == 1:
            DP[i + 1][j] = min(DP[i + 1][j - 1], DP[i][j], DP[i][j - 1]) + 1
            ans = max(ans, DP[i + 1][j])
print((ans + 1) // 2)
0