If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
Bài này em có thể dùng QHĐ để tính, ĐPT chỉ khoảng O(N) :
- Gọi F[i] là giá trị nhỏ nhất trong các dãy a[i], a[i] + a[i+1], .. , a[i] + a[i+1] + a[i+2] + .... a[n] + a[1] + a[2] + ... + a[i-1].
- Công thức QHĐ : F[i] = Min(A[i], F[i + 1] + A[i]), i = n-1 -> 1.
Điều kiện để i là 1 vị trí tốt là A[i] > 0 và F[i] > 0
Dạ e cảm ơn, mà dạo này học quân sự lại hk có lap nên khó luyện quá
Comment