結果

問題 No.1199 お菓子配り-2
ユーザー tpynerivertpyneriver
提出日時 2020-08-28 21:52:53
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 147 ms / 1,000 ms
コード長 266 bytes
コンパイル時間 355 ms
コンパイル使用メモリ 82,296 KB
実行使用メモリ 76,624 KB
最終ジャッジ日時 2024-04-26 14:46:00
合計ジャッジ時間 8,900 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,224 KB
testcase_01 AC 38 ms
51,840 KB
testcase_02 AC 34 ms
51,880 KB
testcase_03 AC 69 ms
75,248 KB
testcase_04 AC 105 ms
75,076 KB
testcase_05 AC 39 ms
62,080 KB
testcase_06 AC 42 ms
65,280 KB
testcase_07 AC 75 ms
75,264 KB
testcase_08 AC 86 ms
75,392 KB
testcase_09 AC 71 ms
75,248 KB
testcase_10 AC 48 ms
71,552 KB
testcase_11 AC 65 ms
75,032 KB
testcase_12 AC 63 ms
75,264 KB
testcase_13 AC 47 ms
72,064 KB
testcase_14 AC 45 ms
70,016 KB
testcase_15 AC 44 ms
67,456 KB
testcase_16 AC 83 ms
75,648 KB
testcase_17 AC 64 ms
75,236 KB
testcase_18 AC 87 ms
75,136 KB
testcase_19 AC 56 ms
75,408 KB
testcase_20 AC 116 ms
75,696 KB
testcase_21 AC 94 ms
75,392 KB
testcase_22 AC 70 ms
75,008 KB
testcase_23 AC 81 ms
75,220 KB
testcase_24 AC 95 ms
75,252 KB
testcase_25 AC 52 ms
73,472 KB
testcase_26 AC 98 ms
75,520 KB
testcase_27 AC 85 ms
75,264 KB
testcase_28 AC 138 ms
76,260 KB
testcase_29 AC 138 ms
75,916 KB
testcase_30 AC 139 ms
75,888 KB
testcase_31 AC 142 ms
76,624 KB
testcase_32 AC 146 ms
76,200 KB
testcase_33 AC 143 ms
75,816 KB
testcase_34 AC 141 ms
76,260 KB
testcase_35 AC 135 ms
75,904 KB
testcase_36 AC 142 ms
75,740 KB
testcase_37 AC 138 ms
76,068 KB
testcase_38 AC 141 ms
75,776 KB
testcase_39 AC 141 ms
75,868 KB
testcase_40 AC 141 ms
76,032 KB
testcase_41 AC 140 ms
76,032 KB
testcase_42 AC 138 ms
75,904 KB
testcase_43 AC 141 ms
76,252 KB
testcase_44 AC 143 ms
75,908 KB
testcase_45 AC 138 ms
76,144 KB
testcase_46 AC 147 ms
76,184 KB
testcase_47 AC 140 ms
76,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
readline = sys.stdin.readline

N, M = map(int, readline().split())

A = [sum(list(map(int, readline().split()))) for _ in range(N)]

INF = 10**18

even = 0
odd = -INF

for a in A:
    even, odd = max(even, odd - a), max(odd, even+a)

print(max(even, odd))
0