結果
| 問題 | No.999 てん vs. ほむ |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2020-06-24 22:33:53 |
| 言語 | Python3 (3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 130 ms / 2,000 ms |
| + 164µs | |
| コード長 | 339 bytes |
| 記録 | |
| コンパイル時間 | 58 ms |
| コンパイル使用メモリ | 15,104 KB |
| 実行使用メモリ | 32,904 KB |
| 最終ジャッジ日時 | 2026-10-12 05:08:29 |
| 合計ジャッジ時間 | 3,863 ms |
|
ジャッジサーバーID (参考情報) |
judge4_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
n = int(input())
a = list(map(int, input().split()))
r = [0]
l = [0]
total = 0
for i in range(n):
total += a[2 * i] - a[2 * i + 1]
l.append(total)
total = 0
for i in range(n - 1, -1, -1):
total += a[2 * i + 1] - a[2 * i]
r.append(total)
ans = -10 ** 10
for rr, ll in zip(r, l[::-1]):
ans = max(ans, rr + ll)
print(ans)