The main idea: to give a bad point of the grid diagram, each time moving pieces to the adjacent lattice, the request lattice can not be repeated, ask if there is a winning strategy, if there is, output all the pieces can be placed on the initial position.Idea: A very classic two-figure game model, will be black and white dyeing, it becomes a two-minute map. After the maximum match, if it is on the side of the match, each time the initiator from the le
viable.
The light does so will T, which needs to be optimized, and the upper bound of the binary U is the smallest u (because C is growing, and F is more likely to be better only if u is reduced), and the lower bound is sum/n, which means at least the average amount of each sewage treatment plant.
Add a second to optimize the current enumeration of C and the lower bound l The calculated function F has exceeded the f of the optimal value of the break
Question link: http://acm.hdu.edu.cn/showproblem.php? PID = 1, 5090
Problem descriptiontom and Jerry are playing a game with tubes and pearls. The rule of the game is:
1) Tom and Jerry come up together with a number K.
2) Tom provides n tubes. Within each tube, there are several pearls. The number of pearls in each tube is at least 1 and at most N.
3) Jerry puts some more pearls into each tube. the numb
Simple two-part graph matching:Each position can be edged to these numbers and can even beGame with PearlsTime limit:2000/1000 MS (java/others) Memory limit:65536/65536 K (java/others)Total submission (s): 122 Accepted Submission (s): 85Problem Descriptiontom and Jerry is playing a game with tubes and pearls. The rule of the game is:1) Tom and Jerry come up together with a number K.2) Tom provides N tubes
] [Discuss]
DESCRIPTIONLXHGWW has recently been fascinated by a game in which he has a lot of equipment, each with 2 attributes, the values of which are expressed in numbers between [1,10000]. When he uses some kind of equipment, he can only use one of the properties of the equipment. And each device can be used at most once. At the end of the game, LXHGWW encountered the ultimate boss, the ultimate bos
A Math GameTime limit:2000/1000ms (java/others) Memory limit:256000/128000kb (java/others) Submit statistic Next Problemproblem descriptionrecently, Losanto find an interesting Math game. The rule is Simple:tell you a numberH, and you can choose some numbers from a set {a[1],a[2],......, a[n]}. If the sum of the number you choose isH, then you win. Losanto just want to know whether he can win the game. Inpu
Analysis: The problem can be used to match the x-coordinate of the y-coordinate, the match is a successful one can put a piece of points, the last to find the best binary matching is the maximum number of pieces can be put. The maximum match of the binary graph is using the Hungarian algorithm. After the deletion of an edge to determine whether a point is a key point, if the deletion, the maximum number of
;Set the last number to X, operate the T-time, each operation must be a black lattice a white latticeCb*x=sb+tCw*x=sw=tSolution to X= (SB-SW)/(CB=CW)Category discussion:1.CB!=CW get x, Judge the Law (X>=MX) on the line2.CB==CW (this time must be n,m are even), X is not sure(1) SB!=SW no solution(2) SB==SW two x is how much, find the smallest legal xHow to judge an X to be legal:Black-and-white dyeing is a two-part pictures--and X Difference---black lattice--inf--> white lattice--and X difference
been accessed at { -VIS[V] =1;///if v does not match, or V is already matched, but from march[v] you can find an augmented path - if(March[v] = =-1|| DFS (March[v]))///Note If the previous condition is true, it will not be called recursively - { -MARCH[V] = u;///match v to u - return 1;///find an augmented path in } - } to } + return 0;///If there is no augmented path starting from U - } the * voidMaxmatch ()///Hungari
Question:
Give you a graph. When each vertex is overwritten, the adjacent vertex is also overwritten.
Minimum number to overwrite all vertices
Ideas:
I did this question when I learned the tree-like DP, which is definitely faster than the Binary Graph ..
Click the bipartite graph. n = 1500. Use Hungary and HK to calculate it.
Go to Hungary first .. 624 Ms
/* ***********************************************Author :devilCreated Time :2016/5/17 11
equipment next n lines, is a description of the n equipment, 2 numbers per line, representing the 2 attribute values of the equipment of the first I output a row, including 1 numbers, indicating the maximum number of consecutive attacks Lxhgww. Sample Input31 23 24 5Sample Output2HINT"Data Range"For 30% of data, ensure n For 100% of data, ensure n SourceDay1
[Submit] [Status] [Discuss]
Solving : The maximum matching of a binary graph.Sinc
Test instructions: Jerry, Tom play games, give you out of n boxes, a[i] for the initial, the number of small balls in the first. Jerry can then add a 0 or K-fold ball to each box, and after that, Jerry will rearrange the boxes, and if I have a small ball in the box I, Jerry will win, output "Jerry" or Output "Tom".Analysis: First count each number of balls have how many boxes, then from small to Oita past, the rest of the box to i+k position, so scan the array, if more than one and more than a n
input data set, print one, integer number in a, gives the result (the minimum number of sold iers).Sample INPUT40: (1) 11: (2) 2 32: (0) 3: (0) 53: (3) 1 4 21: (1) 02: (0) 0: (0) 4: (0)Sample Output12 Test instructions: Given a tree, select as few points as possible so that each unselected node is adjacent to at least one of the selected nodes. Outputs the minimum number of nodes to select. Idea: The classic two-dimensional minimum vertex overlay, is also the classic tree-shaped DP. minim
]) { - for(intj=1; j){ A if(!T[j]) { +A = min (A,lx[i]+ly[j]-w[i][j]); the } - } $ } the } the the for(intI=1; i){ the if(S[i]) lx[i]-=A; - if(T[i]) ly[i] + =A; in } the } the About intKM () the { the for(intI=1; i){ theLeft[i] = Lx[i] = Ly[i] =0; + for(intj=1; j) -lx[i]=Max (lx[i],w[i][j]); the }Bayi the for(intI=1; i){ the for(;;) { - for(intj=1
{ the if(map[i][j]==1) the { -Memset (OK,0,sizeof(OK)); in intkk=0; themap[i][j]=0; the for(intk=1; k) About { thememset (Vis,0,sizeof(Vis)); the if(Find (k) = =true) the { +kk++; - } the }Bayi if(kkans) thesum++; themap[i][j]=1; - } - } the } th
number in a, gives the result (the minimum number of sold Iers). An example are given in the following table:Sample Input40: (1) 11: (2) 2 32: (0) 3: (0) 53: (3) 1 4 21: (1) 02: (0) 0: (0) 4: (0)Sample Output1 2Test instructions: Give you a tree, each node needs to be guarded by soldiers, a soldier can watch his node and node adjacent to the node, asked how many soldiers to see all the nodesAnalysis: The minimum point overlay of a binary graph is the
Topic Links:http://acdream.info/problem?pid=1726Test instructionsGiven the number of N, and a number, judge whether K can be composed of any number of them.Analysis:Since n Max is 40, the brute force enumerates all the case complexity for 2^40 sure tle, and then comes to think of the binary enumerationDivided into two halves, first to deal with the combination of the first N/2 number of cases, the results hash, and then enumerate the second halfAnd th
Title: http://www.lydsy.com:808/JudgeOnline/problem.php?id=1854Analysis: Very naked a two-figure match right, but in Hzwer's blog to see the magic and check set practice!In fact, this problem and bzoj1191 amazing similarity!Take the weight as a point, equipment as a side, since a device can only choose a property, that is, you want to be directed to the side, the arrow points to the point that you choose the properties of this equipment.And then it's like bzoj1191.If a point in a collection is a
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.