HDU5000 (DP + rule) not completed

Source: Internet
Author: User

Test instructions: Give an example to say, tell you 4 numbers, 8,6,4,2 four numbers, make up a four-digit number, if two numbers are 1111,2222, 2222 will 1111 kill, is composed of four digits can not each bit less than or equal to a number, and then let you find the maximum can survive the number.

Analysis: The field on the time oneself has been pushing the formula, find the law, thought is four numbers increment and decrement the law of alternating, unexpectedly is and absolute force is certain law, namely NUM/2, and certainly that is DP;

PS: I am actually very afraid of DP, but for teammates, at least to the DP to get started! Feel the law after the problem is quite simple!

Originally I have a fixed view, that is greedy can do the problem, DP can do, but DP can do, greed may not do, also feel DP, greedy, find the law, three contact very close, sometimes can not find the law or greedy not go to find DP.

HDU5000 (DP + rule) not completed

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.