結果

問題 No.402 最も海から遠い場所
ユーザー lloyzlloyz
提出日時 2023-01-26 20:17:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 422 bytes
コンパイル時間 706 ms
コンパイル使用メモリ 10,888 KB
実行使用メモリ 84,692 KB
最終ジャッジ日時 2023-09-09 19:12:00
合計ジャッジ時間 6,919 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
12,544 KB
testcase_01 AC 15 ms
7,884 KB
testcase_02 AC 17 ms
7,800 KB
testcase_03 AC 15 ms
7,856 KB
testcase_04 AC 15 ms
7,812 KB
testcase_05 AC 15 ms
7,816 KB
testcase_06 AC 15 ms
7,824 KB
testcase_07 AC 15 ms
7,904 KB
testcase_08 AC 15 ms
7,876 KB
testcase_09 AC 15 ms
7,924 KB
testcase_10 AC 15 ms
7,796 KB
testcase_11 AC 17 ms
7,948 KB
testcase_12 AC 16 ms
7,848 KB
testcase_13 AC 53 ms
8,936 KB
testcase_14 AC 35 ms
8,308 KB
testcase_15 AC 232 ms
12,152 KB
testcase_16 AC 463 ms
13,792 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
権限があれば一括ダウンロードができます

ソースコード

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