[NOIP] [Pressure DP] Noip2016day2 Angry Birds

Source: Internet
Author: User

Topic Portal
See the problem is a little afraid, noip2014day1t3 flying bird that dp ...
Later, look at the storm can, but hung up ... Seemingly card accuracy.
Parabolic. What the heck......
See n N Max is 18 18, each dozen pigs is not necessarily, so consider the pressure DP. Binary status record pigs that have been beaten.
Because the given parabolic is very special, constant over (0,0) (0,0) point, so there are up to N2 n^2 parabolic line, calculated these parabolic line, if a≥0 A\ge 0 to abandon, feasible can be binary record the two pigs viable state. In order to minimize the use of birds, you can enumerate again, will be able to use the same parabola to fix the pig added to the same feasible state, the last time the pressure can be.
There is a sense of using the parabolic shrinkage point ...
The M-m function is to reduce the search status, which can be used in the BFS process.
Don't forget to clear the array ...
Time Complexity O (t (n3+2nn2)) O (t (n^3+2^nn^2))
Code
NOIP2016 full AC reached.

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.