Editorial for SMARTCOMP - Lựa chọn cấu hình


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.

Sử dụng phương pháp quy hoạch động kết hợp với chặt nhị phân: Sắp xếp dãy giảm dần theo điểm đánh giá, xây dựng một mảng ~max~ để chứa giá trị lớn nhất đến vị trí thứ ~i~.

Kết quả bài toán là ~k+max[g]~, trong đó ~k~ là giá trị ~(v[i] + q[j], i, j = 1 → n)~.


Comments

Please read the guidelines before commenting.


There are no comments at the moment.