結果

問題 No.1199 お菓子配り-2
ユーザー chielochielo
提出日時 2020-08-28 21:45:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 156 ms / 1,000 ms
コード長 346 bytes
コンパイル時間 244 ms
コンパイル使用メモリ 82,280 KB
実行使用メモリ 76,884 KB
最終ジャッジ日時 2024-04-26 14:39:40
合計ジャッジ時間 9,309 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
53,316 KB
testcase_01 AC 33 ms
52,760 KB
testcase_02 AC 36 ms
51,824 KB
testcase_03 AC 76 ms
75,756 KB
testcase_04 AC 118 ms
75,980 KB
testcase_05 AC 43 ms
62,192 KB
testcase_06 AC 43 ms
64,188 KB
testcase_07 AC 78 ms
75,216 KB
testcase_08 AC 88 ms
75,100 KB
testcase_09 AC 67 ms
75,296 KB
testcase_10 AC 47 ms
70,132 KB
testcase_11 AC 64 ms
74,912 KB
testcase_12 AC 62 ms
75,220 KB
testcase_13 AC 46 ms
70,408 KB
testcase_14 AC 47 ms
68,804 KB
testcase_15 AC 46 ms
65,996 KB
testcase_16 AC 85 ms
75,388 KB
testcase_17 AC 67 ms
74,888 KB
testcase_18 AC 98 ms
75,864 KB
testcase_19 AC 62 ms
75,164 KB
testcase_20 AC 120 ms
75,996 KB
testcase_21 AC 99 ms
76,008 KB
testcase_22 AC 80 ms
75,984 KB
testcase_23 AC 91 ms
75,860 KB
testcase_24 AC 98 ms
75,800 KB
testcase_25 AC 49 ms
71,756 KB
testcase_26 AC 99 ms
75,904 KB
testcase_27 AC 89 ms
75,104 KB
testcase_28 AC 148 ms
76,884 KB
testcase_29 AC 144 ms
76,252 KB
testcase_30 AC 145 ms
76,800 KB
testcase_31 AC 145 ms
76,432 KB
testcase_32 AC 140 ms
76,496 KB
testcase_33 AC 146 ms
76,392 KB
testcase_34 AC 146 ms
76,244 KB
testcase_35 AC 146 ms
76,064 KB
testcase_36 AC 147 ms
76,868 KB
testcase_37 AC 151 ms
76,360 KB
testcase_38 AC 156 ms
76,044 KB
testcase_39 AC 152 ms
76,528 KB
testcase_40 AC 147 ms
76,528 KB
testcase_41 AC 151 ms
76,652 KB
testcase_42 AC 149 ms
76,316 KB
testcase_43 AC 146 ms
76,660 KB
testcase_44 AC 148 ms
76,384 KB
testcase_45 AC 156 ms
76,368 KB
testcase_46 AC 141 ms
76,464 KB
testcase_47 AC 143 ms
76,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
a = [sum(map(int, input().split())) for _ in range(n)]
b = [[-10 ** 31] * 2 for _ in range(n)]
mx = [-10 ** 31] * 2
for i in range(n):
    b[i][0] = a[i]
    if i:
        b[i][0] = max(b[i][0], mx[1] + a[i])
        b[i][1] = mx[0] - a[i]
    for j in range(2):
        mx[j] = max(b[i][j], mx[j])
print(max(mx))
0