結果
| 問題 |
No.2854 -1 Subsequence
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-25 14:59:44 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 170 bytes |
| コンパイル時間 | 218 ms |
| コンパイル使用メモリ | 82,220 KB |
| 実行使用メモリ | 104,572 KB |
| 最終ジャッジ日時 | 2024-08-25 14:59:49 |
| 合計ジャッジ時間 | 4,721 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 WA * 10 |
ソースコード
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))