need to achieve this. If it is impossible to make one complete map, just output-1.
Sample Input
35 5 10 0 5 55 5 20 0 3 52 0 5 530 30 50 0 30 100 10 30 200 20 30 300 0 15 3015 0 30 30
Sample output
1-12
Hint
For sample 1, the only piece is a complete map.
For sample 2, the two pieces may overlap with each other, so you can not make a complete treasure map.
For s
ZOJ 3209 Treasure Map (precise DLX coverage)
Your boss once had got extends copies of a treasure map. unfortunately, all the copies are now broken to your rectangular pieces, and what make it worse, he has lost some of the pieces. luckily, it is possible to figure out the position of each piece in the original map. now
ZOJ 3209 Treasure Map (precise DLX coverage), zojdlx
Your boss once had got extends copies of a treasure map. unfortunately, all the copies are now broken to your rectangular pieces, and what make it worse, he has lost some of the pieces. luckily, it is possible to figure out the position of each piece in the original map
The main idea: in an n * n grid, there are m obstacles, and now you have a weapon, this weapon can eliminate any line or a row of obstacles, now requires all obstacles to eliminate, ask at least how many times the use of this weaponProblem-solving ideas: Think of long time how to solve the problems of row and column ... How to represent two point setsFinally suddenly thought, since do not know how to deal with the ranks, the ranks are divided into two points, the point on behalf of the relations
A rectangle of N * m is given. The coordinates are (0, 0 )~ (N, m ). Then we will give you a small P rectangle with the coordinates (x1, Y1 )~ (X2, Y2), you can select the smallest rectangle so that these rectangles can overwrite the entire rectangle without overlap. (N, m
Idea: precise coverage of dancing links.
We divide the N * m rectangle into N * m small squares, so we only need to ensure that each small square is overwritten and only once.
The
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.