結果

問題 No.2095 High Rise
ユーザー 👑 rin204rin204
提出日時 2022-10-07 21:29:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 224 ms / 2,000 ms
コード長 293 bytes
コンパイル時間 1,076 ms
コンパイル使用メモリ 86,496 KB
実行使用メモリ 78,848 KB
最終ジャッジ日時 2023-09-03 00:15:47
合計ジャッジ時間 5,665 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
70,936 KB
testcase_01 AC 72 ms
71,080 KB
testcase_02 AC 72 ms
71,092 KB
testcase_03 AC 73 ms
70,900 KB
testcase_04 AC 75 ms
71,300 KB
testcase_05 AC 74 ms
71,240 KB
testcase_06 AC 72 ms
71,220 KB
testcase_07 AC 74 ms
71,348 KB
testcase_08 AC 73 ms
70,860 KB
testcase_09 AC 72 ms
71,296 KB
testcase_10 AC 72 ms
71,100 KB
testcase_11 AC 73 ms
71,392 KB
testcase_12 AC 102 ms
76,076 KB
testcase_13 AC 82 ms
76,208 KB
testcase_14 AC 84 ms
76,484 KB
testcase_15 AC 83 ms
76,392 KB
testcase_16 AC 79 ms
76,376 KB
testcase_17 AC 112 ms
77,392 KB
testcase_18 AC 105 ms
77,660 KB
testcase_19 AC 87 ms
76,620 KB
testcase_20 AC 104 ms
76,800 KB
testcase_21 AC 126 ms
77,960 KB
testcase_22 AC 224 ms
78,524 KB
testcase_23 AC 223 ms
78,820 KB
testcase_24 AC 222 ms
78,848 KB
testcase_25 AC 220 ms
78,588 KB
testcase_26 AC 222 ms
78,688 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
if n == 1:
    print(0)
    exit()
dp = list(map(int, input().split()))
for _ in range(n - 1):
    A = list(map(int, input().split()))
    mi = min(a + d for a, d in zip(A, dp))
    for i in range(m):
        dp[i] = min(dp[i] + A[i], mi + A[i])
print(min(dp))
0