結果

問題 No.2657 Falling Block Game
ユーザー ゼット
提出日時 2024-03-01 22:39:12
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 457 bytes
コンパイル時間 287 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 80,192 KB
最終ジャッジ日時 2024-09-29 14:36:27
合計ジャッジ時間 4,308 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 2 TLE * 1 -- * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

H,W=map(int,input().split())
A=[input() for i in range(H)]
dp=[0]*W
for i in range(H-2,-1,-1):
  dp2=[10**10]*W
  for j in range(W):
    if A[i][j]=='#':
      continue
    for k in range(j,W):
      if A[i][k]=='#':
        break
      score=max(k-j,dp[k])
      dp2[j]=min(dp2[j],score)
    for k in range(j-1,-1,-1):
      if A[i][k]=='#':
        break
      score=max(j-k,dp[k])
      dp2[j]=min(dp2[j],score)
  dp=dp2
for i in range(W):
  print(dp[i])
0