結果

問題 No.2095 High Rise
ユーザー 👑 H20H20
提出日時 2022-10-07 22:51:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 226 ms / 2,000 ms
コード長 332 bytes
コンパイル時間 300 ms
コンパイル使用メモリ 86,868 KB
実行使用メモリ 87,008 KB
最終ジャッジ日時 2023-09-03 14:36:11
合計ジャッジ時間 5,177 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,160 KB
testcase_01 AC 73 ms
71,184 KB
testcase_02 AC 72 ms
71,312 KB
testcase_03 AC 72 ms
71,260 KB
testcase_04 AC 71 ms
71,348 KB
testcase_05 AC 70 ms
71,408 KB
testcase_06 AC 75 ms
70,940 KB
testcase_07 AC 72 ms
71,336 KB
testcase_08 AC 72 ms
71,328 KB
testcase_09 AC 71 ms
71,160 KB
testcase_10 AC 71 ms
71,344 KB
testcase_11 AC 73 ms
71,404 KB
testcase_12 AC 81 ms
76,216 KB
testcase_13 AC 79 ms
76,412 KB
testcase_14 AC 81 ms
76,336 KB
testcase_15 AC 78 ms
76,496 KB
testcase_16 AC 80 ms
76,340 KB
testcase_17 AC 105 ms
77,464 KB
testcase_18 AC 99 ms
77,744 KB
testcase_19 AC 84 ms
76,592 KB
testcase_20 AC 103 ms
77,444 KB
testcase_21 AC 118 ms
79,064 KB
testcase_22 AC 222 ms
86,744 KB
testcase_23 AC 223 ms
87,008 KB
testcase_24 AC 217 ms
87,000 KB
testcase_25 AC 226 ms
86,464 KB
testcase_26 AC 223 ms
86,748 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,M = map(int, input().split())
if N==1:
    print(0)
    exit()
A = []
for _ in range(N):
    A.append(list(map(int, input().split())))
DP = list(A[0])
for i in range(1,N):
    mi = 10**18
    for j in range(M):
        mi = min(DP[j]+A[i][j],mi)
    for j in range(M):
        DP[j] = min(DP[j]+A[i][j],mi+A[i][j])

print(min(DP))
0