結果

問題 No.999 てん vs. ほむ
ユーザー chinchillachinchilla
提出日時 2020-02-28 22:41:34
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 176 bytes
コンパイル時間 143 ms
コンパイル使用メモリ 10,512 KB
実行使用メモリ 30,016 KB
最終ジャッジ日時 2023-08-03 21:24:37
合計ジャッジ時間 2,871 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,124 KB
testcase_01 AC 17 ms
8,040 KB
testcase_02 AC 17 ms
8,044 KB
testcase_03 AC 18 ms
8,048 KB
testcase_04 AC 16 ms
8,044 KB
testcase_05 AC 16 ms
8,104 KB
testcase_06 AC 16 ms
8,092 KB
testcase_07 AC 16 ms
8,056 KB
testcase_08 AC 18 ms
8,844 KB
testcase_09 AC 89 ms
28,204 KB
testcase_10 AC 38 ms
14,112 KB
testcase_11 AC 31 ms
12,196 KB
testcase_12 AC 48 ms
16,980 KB
testcase_13 AC 97 ms
29,900 KB
testcase_14 AC 97 ms
30,016 KB
testcase_15 AC 98 ms
29,820 KB
testcase_16 AC 98 ms
29,916 KB
testcase_17 AC 85 ms
29,236 KB
testcase_18 AC 85 ms
28,924 KB
testcase_19 AC 86 ms
29,264 KB
testcase_20 AC 87 ms
29,360 KB
testcase_21 AC 87 ms
29,756 KB
testcase_22 AC 89 ms
29,800 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate
n = int(input())
a = list(map(int, input().split()))
d = [x-y for x, y in zip(a[::2], a[1::2])]
print(max(accumulate(d, initial=0))*2 - sum(d))
0