結果
| 問題 |
No.999 てん vs. ほむ
|
| コンテスト | |
| ユーザー |
convexineq
|
| 提出日時 | 2021-02-13 20:39:27 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 108 ms / 2,000 ms |
| コード長 | 247 bytes |
| コンパイル時間 | 190 ms |
| コンパイル使用メモリ | 82,368 KB |
| 実行使用メモリ | 107,264 KB |
| 最終ジャッジ日時 | 2024-07-21 00:28:51 |
| 合計ジャッジ時間 | 3,611 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 |
ソースコード
n = int(input())
*a, = map(int,input().split())
res = [0]*(n+1)
for i in range(n):
res[i] = a[2*i]-a[2*i+1]
t = sum(res)
for i in range(n)[::-1]:
res[i] += res[i+1]
ans = -1<<31
for i in range(n+1):
ans = max(ans,t-2*res[i])
print(ans)
convexineq