随笔分类 - 图论
摘要:DescriptionGabiluso is one of the greatest spies in his country. Now he’s trying to complete an “impossible” mission ----- to make it slow for the arm...
阅读全文
摘要:DescriptionSomewhere near the south pole, a number of penguins are standing on a number of ice floes. Being social animals, the penguins would like to get together, all on the same floe. The penguins do not want to get wet, so they have use their limited jump distance to get together by jumping from
阅读全文
摘要:DescriptionA group ofMtourists are walking along the Karlutka river. They want to cross the river, but they couldn't find a bridge. Fortunately, there are some piles of rubbish floating in the water, and thetourists have decided to try to cross the river by jumping from one pile to another.Atour
阅读全文
摘要:DescriptionBreaking news! A Russian billionaire has bought a yet undisclosed NBA team. He's planning to invest huge effort and money into making that team the best. And in fact he's been very specific about the expected result: the first place.Being his advisor, you need to determine whether
阅读全文
摘要:DescriptionGiven a weighted directed graph, we define the shortest path as the path who has the smallest length among all the path connecting the source vertex to the target vertex. And if two path is said to be non-overlapping, it means that the two path has no common edge. So, given a weighted dir
阅读全文
摘要:DescriptionFarmer John is constructing a new milking machine and wishes to keep it secret as long as possible. He has hidden in it deep within his farm and needs to be able to get to the machine without being detected. He must make a total of T (1 #include #include using namespace std;const int MAXN
阅读全文
摘要:DescriptionThe Contortion Brothers are a famous set of circus clowns, known worldwide for their incredible ability to cram an unlimited number of them...
阅读全文
摘要:DescriptionGiven a connected undirected graph, tell if its minimum spanning tree is unique.Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph of G, say T = (V', E'), with the following properties:1. V' = V.2. T is connected
阅读全文
摘要:Description"Good man never makes girls wait or breaks an appointment!" said the mandarin duck father. Softly touching his little ducks' head, he told them a story."Prince Remmarguts lives in his kingdom UDF – United Delta of Freedom. One day their neighboring country sent them Pri
阅读全文
摘要:Problem DescriptionOpen Source Tools help earthquake researchers stay a step ahead. Many geological research facilities around the world use or are in...
阅读全文
摘要:Petya loves volleyball very much. One day he was running late for a volleyball match. Petya hasn't bought his own car yet, that's why he had to take a taxi. The city hasnjunctions, some of which are connected by two-way roads. The length of each road is defined by some positive integer numbe
阅读全文
摘要:DescriptionThe stable marriage problem consists of matching members of two different sets according to the member’s preferences for the other set’s members. The input for our problem consists of:a set M of n males;a set F of n females;for each male and female we have a list of all the members of the
阅读全文
摘要:DescriptionJohn is the only priest in his town. September 1st is the John's busiest day in a year because there is an old legend in the town that the ...
阅读全文
摘要:Problem DescriptionConflicts are everywhere in the world, from the young to the elderly, from families to countries. Conflicts cause quarrels, fights or even wars. How wonderful the world will be if all conflicts can be eliminated.Edward contributes his lifetime to invent a 'Conflict Resolution
阅读全文
摘要:DescriptionKatu Puzzle is presented as a directed graphG(V,E) with each edgee(a,b) labeled by a boolean operatorop(one of AND, OR, XOR) and an integerc(0 ≤c≤ 1). One Katu is solvable if one can find each vertexVia valueXi(0 ≤Xi≤ 1) such that for each edgee(a,b) labeled byopandc, the following formul
阅读全文
摘要:Problem Description有n对夫妻被邀请参加一个聚会,因为场地的问题,每对夫妻中只有1人可以列席。在2n 个人中,某些人之间有着很大的矛盾(当然夫妻之间是没有矛盾的),有矛盾的2个人是不会同时出现在聚会上的。有没有可能会有n 个人同时列席?Inputn: 表示有n对夫妻被邀请 (n 2 #include 3 using namespace std; 4 5 const int MAXN = 4010; 6 const int MAXM = 1010*1010*3; 7 8 struct TwoSAT{ 9 int n, ecnt;10 bool mark[M...
阅读全文
摘要:Emuskald considers himself a master of flow algorithms. Now he has completed his most ingenious program yet — it calculates the maximum flow in an undirected graph. The graph consists ofnvertices andmedges. Vertices are numbered from 1 ton. Vertices1andnbeing the source and the sink respectively.How
阅读全文
摘要:Smart Beaver is careful about his appearance and pays special attention to shoes so he has a huge number of pairs of shoes from the most famous brands of the forest. He's trying to handle his shoes carefully so that each pair stood side by side. But by the end of the week because of his very act
阅读全文
摘要:DescriptionAliceandBobmeetagain.ThistimetheyplayagamenamedMATRIXTRANSFORMER.Theygotann*nboard.Everygridhastwopositions,UPandDOWN.Inthisgameyoucanpushsomeamazingbuttonstoexchangeanytworowsoranytwocolumns.AlicewillwinifshegotthegridsinthemaindiagonallineallUP.ButAlicefindsthatforsomeboard,nomatterhowm
阅读全文
摘要:ProblemDescription传说在遥远的地方有一个非常富裕的村落,有一天,村长决定进行制度改革:重新分配房子。这可是一件大事,关系到人民的住房问题啊。村里共有n间房间,刚好有n家老百姓,考虑到每家都要有房住(如果有老百姓没房子住的话,容易引起不安定因素),每家必须分配到一间房子且只能得到一间房子另一方面,村长和另外的村领导希望得到最大的效益,这样村里的机构才会有钱.由于老百姓都比较富裕,他们都能对每一间房子在他们的经济范围内出一定的价格,比如有3间房子,一家老百姓可以对第一间出10万,对第2间出2万,对第3间出20万.(当然是在他们的经济范围内).现在这个问题就是村领导怎样分配房子才能
阅读全文

浙公网安备 33010602011771号