HBC231133斐波那契,数学,递推,思维Harmony in Harmony题解

痛心疾首 算法基础篇 53 0
想要检验自己的编程水平?来试试全网最全C++题库,让您在挑战中不断进步。
Haha is a humorous god of harmony. Why do I say that?In fact, Haha is forgetful, but Haha thinks that he has an excellent memory. Haha is responsible for balancing the power of various elements in the world. The power is derived from harmony fruits which grow in Hahiland. There are nnn tribes in Hahiland, each takes charge of one element, such as fire, water, etc. There is a fertile field in Hahiland, where the soil is suitable for growing the harmony fruits. Every spring, Haha will divide the field into nnn parts, and each part is of the same total area. Then every tribe will choose one part to be their territory, then sow the harmony seeds on it, and give some element power to the seeds. Although the element power helps the plants to grow well, when the fruits are ripe, they could only be harvested by the one who has the same kind of element power. ``My memory is very good. I don't need to record my divide plan at all!

Haha is a humorous god of harmony. Why do I say that? In fact, Haha is forgetful, but Haha thinks that he has an excellent memory. Haha is responsible for balancing the power of various elements in the world. The power is derived from harmony fruits which grow in Hahiland. There are nnn tribes in Hahiland, each takes charge of one element, such as fire, water, etc. There is a fertile field in Hahiland, where the soil is suitable for growing the harmony fruits. Every spring, Haha will divide the field into nnn parts, and each part is of the same total area. Then every tribe will choose one part to be their territory, then sow the harmony seeds on it, and give some element power to the seeds. Although the element power helps the plants to grow well, when the fruits are ripe, they could only be harvested by the one who has the same kind of element power. ``My memory is very good. I don't need to record my divide plan at all! These are all in my brain clearly!'' Haha said with full confidence. As autumn comes, Haha divides the field into nnn parts again from his memory. But it's actually not the same as last time. People are afraid to tell the harmony god that he is wrong. So they discuss how to allot the nnn parts in order to guarantee the minimum area of plants each tribe could harvest to be as large as possible. The members of Hahiland are wondering how large the minimum area of plants each tribe could harvest could be guaranteed no matter how Haha divides the field, for their future generations. Please calculate it with your wisdom, so that they will be not so anxious. In short, given nnn, determine: min⁡S,A{max⁡p{min⁡i=1n{∣Si∩Api∣}}}minlimits_{S, A}{maxlimits_{p}{minlimits_{i=1}^{n}{|S_icap A_{p_i}| }}}S,Amin​{pmax​{i=1minn​{∣Si​∩Api​​∣}}} , where S,AS, AS,A denote the field parts(the whole field and the parts can be denoted by some areas in 2D plane) divided in spring and autumn respectively(so ∣S1∣=∣S2∣=⋯=∣Sn∣=∣A1∣=∣A2∣=⋯=∣An∣|S_1| = |S_2| = cdots = |S_n| = |A_1| = |A_2| = cdots = |A_n|∣S1​∣=∣S2​∣=⋯=∣Sn​∣=∣A1​∣=∣A2​∣=⋯=∣An​∣ holds), ppp denotes a permutation of {1,2,⋯ ,n}{1,2,cdots,n}{1,2,⋯,n}(so {p1,p2,⋯ ,pn}={1,2,⋯ ,n}{p_1, p_2, cdots, p_n} = {1, 2, cdots, n}{p1​,p2​,⋯,pn​}={1,2,⋯,n} holds). Moreover, assume the total area of the whole field is 1 and the shape of the whole field doesn't count in this problem as can be seen.

HBC231133斐波那契,数学,递推,思维Harmony in Harmony题解
-第1张图片-东莞河马信息技术
(图片来源网络,侵删)
想要在职场中立于不败之地?那就来试试全网最全C++题库,让您在练习中快速提升技能。

标签: HBC231133斐波那契 数学 递推 思维Harmony in Harmony题解