結果

問題 No.999 てん vs. ほむ
ユーザー Navier_BoltzmannNavier_Boltzmann
提出日時 2022-02-13 18:52:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 292 bytes
コンパイル時間 268 ms
コンパイル使用メモリ 10,704 KB
実行使用メモリ 31,448 KB
最終ジャッジ日時 2023-09-11 15:38:38
合計ジャッジ時間 4,145 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,128 KB
testcase_01 AC 15 ms
8,128 KB
testcase_02 AC 15 ms
8,132 KB
testcase_03 AC 15 ms
8,148 KB
testcase_04 AC 15 ms
8,112 KB
testcase_05 WA -
testcase_06 AC 15 ms
8,180 KB
testcase_07 AC 15 ms
8,164 KB
testcase_08 AC 19 ms
8,924 KB
testcase_09 AC 126 ms
28,936 KB
testcase_10 AC 48 ms
14,204 KB
testcase_11 AC 37 ms
12,688 KB
testcase_12 AC 64 ms
17,144 KB
testcase_13 AC 138 ms
30,804 KB
testcase_14 AC 138 ms
30,924 KB
testcase_15 AC 139 ms
30,888 KB
testcase_16 AC 138 ms
30,832 KB
testcase_17 AC 121 ms
30,416 KB
testcase_18 WA -
testcase_19 AC 120 ms
30,316 KB
testcase_20 WA -
testcase_21 AC 117 ms
31,448 KB
testcase_22 AC 117 ms
29,768 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int,input().split()))
from itertools import accumulate
L = list(accumulate([A[i] - A[i+1] for i in range(0,2*N,2) ], initial = 0))
R = list(accumulate([A[-1-i] - A[-2-i] for i in range(0,2*N,2)], initial = 0))
ans = max(L[i]+R[-1-i] for i in range(N))
print(ans)
0