結果

問題 No.2095 High Rise
ユーザー titiatitia
提出日時 2022-10-07 22:33:26
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 400 bytes
コンパイル時間 973 ms
コンパイル使用メモリ 10,692 KB
実行使用メモリ 48,544 KB
最終ジャッジ日時 2023-09-03 13:51:01
合計ジャッジ時間 8,903 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,808 KB
testcase_01 AC 16 ms
7,752 KB
testcase_02 WA -
testcase_03 AC 15 ms
7,776 KB
testcase_04 AC 16 ms
7,896 KB
testcase_05 AC 16 ms
7,860 KB
testcase_06 AC 16 ms
7,856 KB
testcase_07 AC 16 ms
7,776 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 16 ms
7,864 KB
testcase_11 AC 16 ms
7,884 KB
testcase_12 AC 20 ms
8,248 KB
testcase_13 AC 19 ms
8,116 KB
testcase_14 AC 24 ms
8,252 KB
testcase_15 AC 20 ms
8,164 KB
testcase_16 AC 18 ms
7,800 KB
testcase_17 AC 148 ms
12,540 KB
testcase_18 AC 101 ms
10,900 KB
testcase_19 AC 36 ms
8,752 KB
testcase_20 AC 160 ms
13,088 KB
testcase_21 AC 291 ms
17,732 KB
testcase_22 AC 1,209 ms
48,544 KB
testcase_23 AC 1,226 ms
48,456 KB
testcase_24 AC 1,163 ms
48,516 KB
testcase_25 AC 1,169 ms
48,372 KB
testcase_26 AC 1,200 ms
48,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N,M=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N)]

if N==0:
    print(0)
    exit()

DP=[0]*M
for i in range(M):
    DP[i]=A[0][i]

for i in range(1,N):
    MIN=1<<62
    for j in range(M):
        MIN=min(MIN,DP[j]+A[i][j])

    NDP=[0]*M

    for j in range(M):
        NDP[j]=min(DP[j],MIN)+A[i][j]

    DP=NDP

print(min(DP))
0