結果

問題 No.999 てん vs. ほむ
ユーザー Ohnuma
提出日時 2020-04-07 14:56:49
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 287 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 64,352 KB
最終ジャッジ日時 2024-07-07 13:13:26
合計ジャッジ時間 17,482 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

import numpy as np
n = int(input())
A = list(map(int,input().split()))
L = [a for a in A[::2]]
R = [a for a in A[1::2]]
cumL = np.cumsum(L)
cumR = np.cumsum(R)
sumA = sum(A)
ans = 0
for i in range(n):
    h = cumL[i] + cumR[-1]-cumR[i]
    t = sumA - h
    ans = max(ans, h-t)
print(ans)
0