Editorial for BALLOON
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
Author:
Nguồn: Free Contest
Gọi là tổng điểm số lớn nhất có thể đạt được ở
lượt ném đầu tiên và quả bong bóng được chọn trong lượt ném cuối cùng là
. Ta có công thức quy hoạch động sau:
=
\(∀j - M \le k < j\)
Việc tính nhanh công thức quy hoạch động trên tương đương bài toán tìm giá trị lớn nhất trong đoạn tịnh tiến.
Độ phức tạp:
Comments