結果

問題 No.999 てん vs. ほむ
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-04-05 21:51:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 98 ms / 2,000 ms
コード長 203 bytes
コンパイル時間 418 ms
コンパイル使用メモリ 82,212 KB
実行使用メモリ 108,188 KB
最終ジャッジ日時 2024-11-27 06:16:08
合計ジャッジ時間 3,751 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
A = list(map(int,input().split()))
count = sum(A[::2])-sum(A[1::2])
ans = count
for i in range(n)[::-1]:
    count -= A[2*i]*2
    count += A[2*i+1]*2
    ans = max(ans,count)
print(ans)
0