結果

問題 No.999 てん vs. ほむ
ユーザー yomo3yomo3
提出日時 2020-03-07 03:45:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 226 bytes
コンパイル時間 97 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 32,772 KB
最終ジャッジ日時 2024-04-22 11:47:39
合計ジャッジ時間 3,016 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
10,880 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 31 ms
10,624 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 30 ms
10,880 KB
testcase_07 AC 30 ms
10,752 KB
testcase_08 AC 34 ms
11,520 KB
testcase_09 AC 132 ms
30,484 KB
testcase_10 AC 58 ms
16,664 KB
testcase_11 AC 49 ms
14,736 KB
testcase_12 AC 71 ms
19,408 KB
testcase_13 AC 138 ms
32,640 KB
testcase_14 AC 138 ms
32,772 KB
testcase_15 AC 138 ms
32,640 KB
testcase_16 AC 138 ms
32,592 KB
testcase_17 WA -
testcase_18 AC 122 ms
28,928 KB
testcase_19 WA -
testcase_20 AC 123 ms
29,264 KB
testcase_21 AC 130 ms
32,124 KB
testcase_22 AC 130 ms
31,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import accumulate

N = int(input())
A = list(map(int, input().split()))

ae = list(accumulate(A[0::2]))
ao = list(accumulate(A[1::2]))

ans = ao[-1] - ae[-1] + 2 * max(ae[i] - ao[i] for i in range(N))
print(ans)
0