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.