結果

問題 No.2095 High Rise
ユーザー KudeKude
提出日時 2022-10-07 22:20:57
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 221 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 87,288 KB
実行使用メモリ 78,076 KB
最終ジャッジ日時 2023-09-03 13:18:52
合計ジャッジ時間 5,069 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,364 KB
testcase_01 AC 74 ms
71,224 KB
testcase_02 AC 74 ms
71,420 KB
testcase_03 AC 74 ms
71,560 KB
testcase_04 AC 74 ms
71,204 KB
testcase_05 AC 74 ms
71,476 KB
testcase_06 AC 73 ms
71,636 KB
testcase_07 AC 73 ms
71,416 KB
testcase_08 AC 74 ms
71,748 KB
testcase_09 AC 73 ms
71,504 KB
testcase_10 AC 73 ms
71,508 KB
testcase_11 AC 73 ms
71,476 KB
testcase_12 AC 83 ms
76,340 KB
testcase_13 AC 81 ms
76,216 KB
testcase_14 AC 83 ms
76,460 KB
testcase_15 AC 81 ms
76,452 KB
testcase_16 AC 81 ms
76,404 KB
testcase_17 AC 104 ms
76,732 KB
testcase_18 AC 99 ms
76,964 KB
testcase_19 AC 87 ms
76,228 KB
testcase_20 AC 101 ms
76,868 KB
testcase_21 AC 118 ms
77,124 KB
testcase_22 AC 220 ms
77,936 KB
testcase_23 AC 221 ms
77,736 KB
testcase_24 AC 219 ms
77,752 KB
testcase_25 AC 218 ms
78,076 KB
testcase_26 AC 220 ms
77,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
dp = list(map(int, input().split()))
pa = dp[:]
if n == 1:
    print(0)
    exit()
for _ in range(n - 1):
    a = list(map(int, input().split()))
    mn = min(dp)
    dp = [min(dp[j] + a[j], mn + pa[j] + a[j]) for j in range(m)]
    pa = a
print(min(dp))
0