結果

問題 No.1199 お菓子配り-2
ユーザー 👑 rin204rin204
提出日時 2020-09-29 13:13:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 234 ms / 1,000 ms
コード長 320 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 10,652 KB
実行使用メモリ 8,516 KB
最終ジャッジ日時 2023-09-16 19:56:35
合計ジャッジ時間 12,369 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,900 KB
testcase_01 AC 16 ms
7,904 KB
testcase_02 AC 16 ms
7,844 KB
testcase_03 AC 71 ms
8,240 KB
testcase_04 AC 154 ms
8,192 KB
testcase_05 AC 21 ms
7,772 KB
testcase_06 AC 23 ms
7,896 KB
testcase_07 AC 82 ms
8,172 KB
testcase_08 AC 107 ms
8,208 KB
testcase_09 AC 71 ms
8,180 KB
testcase_10 AC 30 ms
8,176 KB
testcase_11 AC 57 ms
8,176 KB
testcase_12 AC 57 ms
8,276 KB
testcase_13 AC 31 ms
8,212 KB
testcase_14 AC 28 ms
7,776 KB
testcase_15 AC 27 ms
7,828 KB
testcase_16 AC 104 ms
8,212 KB
testcase_17 AC 59 ms
8,256 KB
testcase_18 AC 111 ms
8,260 KB
testcase_19 AC 41 ms
7,936 KB
testcase_20 AC 181 ms
8,164 KB
testcase_21 AC 120 ms
8,200 KB
testcase_22 AC 71 ms
8,208 KB
testcase_23 AC 94 ms
8,248 KB
testcase_24 AC 121 ms
8,196 KB
testcase_25 AC 32 ms
8,204 KB
testcase_26 AC 133 ms
8,308 KB
testcase_27 AC 111 ms
8,272 KB
testcase_28 AC 233 ms
8,476 KB
testcase_29 AC 231 ms
8,440 KB
testcase_30 AC 234 ms
8,492 KB
testcase_31 AC 232 ms
8,240 KB
testcase_32 AC 234 ms
8,200 KB
testcase_33 AC 233 ms
8,336 KB
testcase_34 AC 234 ms
8,516 KB
testcase_35 AC 233 ms
8,400 KB
testcase_36 AC 233 ms
8,244 KB
testcase_37 AC 232 ms
8,412 KB
testcase_38 AC 233 ms
8,412 KB
testcase_39 AC 232 ms
8,220 KB
testcase_40 AC 233 ms
8,220 KB
testcase_41 AC 234 ms
8,192 KB
testcase_42 AC 233 ms
8,332 KB
testcase_43 AC 229 ms
8,380 KB
testcase_44 AC 234 ms
8,340 KB
testcase_45 AC 233 ms
8,472 KB
testcase_46 AC 231 ms
8,328 KB
testcase_47 AC 232 ms
8,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = map(int, input().split())
happy = [0] + [sum(map(int, input().split())) for _ in range(n)] + [0]
ans = 0
for i in range(1, n + 1):
    if happy[i - 1] < happy[i] and happy[i] >= happy[i + 1]:
        ans += happy[i]
    elif happy[i - 1] > happy[i] and happy[i] <= happy[i + 1]:
        ans -= happy[i]
print(ans)
0