結果
| 問題 | No.999 てん vs. ほむ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-15 00:59:22 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 302 bytes |
| 記録 | |
| コンパイル時間 | 401 ms |
| コンパイル使用メモリ | 85,168 KB |
| 実行使用メモリ | 125,160 KB |
| 最終ジャッジ日時 | 2026-04-08 13:39:48 |
| 合計ジャッジ時間 | 2,516 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 WA * 2 |
ソースコード
from itertools import accumulate
N = int(input())
A = list(map(int,input().split()))
if N == 1:
print(max(A)-min(A))
exit()
B = []
for i in range(0,2*N-1,2):
B.append(A[i]-A[i+1])
BC = list(accumulate(B))
ans = 0
for i in range(len(BC)):
ans = max(ans,BC[i]-(BC[-1]-BC[i]))
print(ans)