[Codevs1403] New Three Kingdoms hegemony (MST+DP)

Source: Internet
Author: User

Title: http://codevs.cn/problem/1403/

Analysis:

It is easy to think of a certain day, that is, to find the smallest spanning tree, and because the data range is very small, it can be violent. But the point is that if the two-day plan is different, pay more. The problem is much like bzoj1003.

Consider DP

Set W[I][J] represents the minimum cost of i~j days without a change, f[i] represents the total minimum cost for the first I day, and then enumerates the changes to the scheme on which day

F[I]=Min(f[i],f[j +k+w [j+1][i]* v* (i -j)

[Codevs1403] New Three Kingdoms hegemony (MST+DP)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.