結果

問題 No.2095 High Rise
ユーザー a aa a
提出日時 2022-10-13 08:20:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 216 ms
コンパイル使用メモリ 10,984 KB
実行使用メモリ 103,100 KB
最終ジャッジ日時 2023-09-08 18:50:54
合計ジャッジ時間 7,272 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,868 KB
testcase_01 WA -
testcase_02 AC 15 ms
7,856 KB
testcase_03 AC 15 ms
7,848 KB
testcase_04 WA -
testcase_05 AC 15 ms
7,812 KB
testcase_06 AC 15 ms
7,908 KB
testcase_07 AC 15 ms
7,892 KB
testcase_08 AC 15 ms
7,860 KB
testcase_09 AC 15 ms
7,864 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=list(map(int,input().split()))
a=[]
for _ in range(n):
    a.append(list(map(int,input().split())))
dp=[[0]*(m) for _ in range(n)]
mi=[0]*(n)
for i in range(n-1):
    for j in range(m):
        if dp[i][j]==mi[i] and i!=0:
            dp[i+1][j]=dp[i][j]+a[i+1][j]
        else:
            dp[i+1][j]=mi[i]+a[i+1][j]+a[i][j]
    mi[i+1]=min(dp[i+1])
print(mi[-1])
0