Poj 3020 Algorithm for maximum matching of a general image with flowers and treesPoj 3020 Algorithm for maximum matching of a general image with flowers and treesQuestion:Given an h * w graph, each vertex is 'O' or '*'. The minimum number of 1*2 rectangles is used to overwrite all '*' in the graph.Restrictions:1 Ideas:Minimum edge coverage = | V |-maximum matchingMax matching of general images and algorithm
Label: style blog HTTP Io color OS AR for SP Poj 3020 antenna placement
Question Link
Question: Given a map, the place of '*' should be covered. Each time we can use a rectangle of 1X2 to cover the map, we can use at least a few to cover the map.
Idea: bipartite graph matching to find the Maximum Independent Set, adjacent * edge, and then find the maximum independent set.Depending on the data range, you can also use the outline DP.
Code:
#in
"POJ 3020" antenna PlacementThe maximal independent set problem of binary graphs' O ' means that the break point requires that all * connections be connected to one or two consecutive lines per route *The maximum match can satisfy only the longest path that can be formed by only two consecutive connections, and the points that are not connected need to be circled separately.i.e. N (total * number)-m (maximum match) +m (maximum match)/2(due to the fact
Recent research on installing MacOS High Sierra in Dell 3020 has encountered many problems in the middle,1, try to download clover original image installation, so that the problem will be less;2, to learn to use Clover Configurator tools to modify the configuration config.plist, commonly known as DSDT, configuration suitable for their own hardware guidancePreparatory work1, a Windows computer (also can be a virtual machine)2, 8G above the U disk, the
] =0; the } the } -memset (G,0,sizeofG); -VN =UN; the for(intI=0; i) the { the for(intj=0; jif(Map[i][j]) the { - intU =Map[i][j]; the for(intp=0;p 4;p + +) the { the intNX = I+dx[p],ny = j+Dy[p];94 if(NX >=0 NX 0 NY M) the { the if(intv =Map[nx][ny]) the {98
Sweden, where an entry of a eithe R is a point of interest, which must are covered by at least one antenna, or empty space. Antennas can only is positioned at the entry in A. When an antenna was placed at row R and column C, this entry was considered covered, but also one of the neighbouring Entrie S (c+1,r), (c,r+1), (C-1,r), or (C,R-1), is covered depending on the type chosen for this particular antenna. What's the least number of antennas for which there exists a placement in a such so all p
The main problem: There are N cities, to establish a radio station in these n cities, each radio station can only cover 2 neighboring cities, ask at least how many wireless power stations need to buildProblem-Solving ideas: English topic good pit, looked at half a day.This problem is similar to POJ-2446 chessboard.All cities can be divided into two point sets, then the connection between the radio station to represent the coverage of the relationship.Because all cities have to be covered, so acc
matrix describing the surface of Sweden, where an entry of a eithe R is a point of interest, which must are covered by at least one antenna, or empty space. Antennas can only is positioned at the entry in A. When an antenna was placed at row R and column C, this entry was considered covered, but also one of the neighbouring Entrie S (c+1,r), (c,r+1), (C-1,r), or (C,R-1), is covered depending on the type chosen for this particular antenna. What's the least number of antennas for which there exis
][j] = ='*') {A[i][j]= k;//A[i][j] Represents the number of the city with coordinates of (I,J)k++; } } }//count the number of cities and number themK-=1; for(i =1; I ) { for(j =1; J ) { if(A[i][j])//every city that is found is based on the composition of its surroundings .Build (i, j); } } intAns =0; memset (Used,0,sizeof(used)); for(i =1; I ) {memset (Vis,0,sizeof(VIS)); if(Find (i)) ans++; } printf ("%d\n", K-ans/2)
POJ 3020 Antenna Placement (bipartite graph creation training + minimum path coverage)
Antenna Placement
Time Limit:1000 MS
Memory Limit:65536 K
Total Submissions:6692
Accepted:3325
DescriptionThe Global Aerial Research Centre has been allotted the task of building the maximum th generation of mobile phone nets in Sweden. the most striking reason why they got the job, is their discovery of a new, highly noise
, no direction = bidirectional)"Split (I think copy more accurate)" to each vertex of the original graph G is 2 points, which belong to the two vertex sets of the binary graph to be constructed.So in the same vein you can get the example of the non-binary graph:Then, through the V1 binary graph, the elements of the row,v2 as the elements of Col, to construct the matrix stored to the computer1 ' 2 ' 3 ' 4 ' 5 '1 F T F f f2 T F t f F3 f t f t t4 F F T f F5 F F T f FThe next step is to ask for the
Question link:Http://poj.org/problem? Id = 3020
Antenna placement
Time limit:1000 ms
Memory limit:65536 K
Total submissions:6692
Accepted:3325
DescriptionThe global aerial research centre has been allotted the task of building the maximum th generation of mobile phone nets in Sweden. the most striking reason why they got the job, is their discovery of a new, highly noise resistant, antenna. it is called 4 dair,
Question link: http://poj.org/problem? Id = 3020
First of all, ignore the one that may mislead others (maybe I have poor understanding, or I am misled by a little bit ).
An H * w graph is provided. "*" indicates point of interest, and "O" ignores it. You can draw a circle on "*" (assuming that the coordinate of this "*" is (I, j, each circle can only enclose a point around it (or above (I-1, j) or below (I + 1, J) or left (I, J-1) or (I, j + 1), that
/* The minimum path of poj 3020 overwrites the question and does not understand the idea at the beginning. Refer to the online code, this is the problem of least path coverage. O indicates that the antenna does not need to be overwritten. * It indicates that the antenna needs to be overwritten. One antenna can benefit two adjacent * points, ask the minimum number of antennas required to cover all * points with the minimum path overwrite of the undirec
"POJ 3020" antenna Placement
The maximal independent set problem of binary graphs' O ' means that the break point requires that all * connections be connected to one or two consecutive lines per route *The maximum match can satisfy only the longest path that can be formed by only two consecutive connections, and the points that are not connected need to be circled separately.i.e. N (total * number)-m (maximum match) +m (maximum match)/2(due to the fac
H-antenna Placement
Time Limit:1000MS
Memory Limit:65536KB
64bit IO Format:%lld %llu Submit Status Practice POJ 3020
Description The Global aerial Centre has been allotted the task of building the fifth generation of mobile phone Nets in Sweden. The most striking reason so they got the job, is their discovery of a new, highly noise resistant, antenna. It's called 4DAir, and comes in four types. Each type can is transmit and receive signals in a direct
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.