結果
| 問題 | No.2854 -1 Subsequence |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2024-08-25 14:59:44 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 170 bytes |
| 記録 | |
| コンパイル時間 | 289 ms |
| コンパイル使用メモリ | 95,980 KB |
| 実行使用メモリ | 117,504 KB |
| 最終ジャッジ日時 | 2026-08-25 06:57:00 |
| 合計ジャッジ時間 | 6,590 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 WA * 11 |
ソースコード
n = int(input())
A = list(map(int, input().split()))
x = 0
y = -(1 << 60)
for a in A:
nx = max(x, y + a)
ny = max(y, x - a)
x, y = nx, ny
print(max(x, y))