随笔分类 - 图论
摘要:DescriptionSergey and Denis closely followed the Chinese Football Championship, which has just come to an end. They supported theKatrapsandKomolotivteams, but, unfortunately, these teams tied for last place in the championship. Sergey was so disappointed that he suggested Denis that they change to h
阅读全文
摘要:DescriptionHave you ever thought about comparing the weight of fruits? That’s what you should do in this problem! Given a series of fruit weight comparisons, you should anticipate the result of another comparison. In this problem, all fruits of the same kind are identical and have the same weights.
阅读全文
摘要:DescriptionSuppose that G is an undirected graph, and the value ofstabis defined as follows:Among the expression,G-i, -jis the remainder after removing node i, node j and all edges that are directly relevant to the previous two nodes.cntCompentis the number of connected components of X independently
阅读全文
摘要:You live in a small town withRbidirectional roads connectingCcrossings and you want to go from crossing 1 to crossingCas soon as possible. You can visit other crossings before arriving at crossingC, but it's not mandatory.You have exactly one chance to ask your friend to repair exactly one exist
阅读全文
摘要:Problem Description Bob gets tired of playing games, leaves Alice, and travels to Changsha alone. Yuelu Mountain, Orange Island, Window of the World, the Provincial Museum etc...are scenic spots Bob wants to visit. However, his time is very limited, he can’t visit them all. Assuming that there are..
阅读全文
摘要:Problem Description One day, a hunter named James went to a mysterious area to find the treasures. James wanted to research the area and brought all treasures that he could. The area can be represented as a N*M rectangle. Any points of the rectangle is a number means the cost of research it,-1 mea..
阅读全文
摘要:DescriptionAn oligarch Vovan, as many other oligarchs, transports oil from West Cuckooland to East Cuckooland. He owns a huge oil-producing station in West Cuckooland, an equally huge oil-refining station in East Cuckooland and a system of oil pipelines to move oil from one country to another. Vovan
阅读全文
摘要:一、二分图1、最大匹配数=最大流=最小割=最小点集覆盖=总点数-最大独立集2、KM算法(最佳完美匹配) 1 int mat[MAXN][MAXN], slack[MAXN], Lx[MAXN], Ly[MAXN], left[MAXN]; 2 bool S[MAXN], T[MAXN]; ...
阅读全文
摘要:DescriptionOn the evening of 3 August 1492, Christopher Columbus departed from Palos de la Frontera with a few ships, starting a serious of voyages of...
阅读全文
摘要:一、代码: 1、求逆元(原理貌似就是拓展欧几里得,要求MOD是素数): 2、底层优化(正确性未验证): 3、扩栈,这玩意儿在OJ上用能防爆? 4、神速读入fread 二、神牛blog matrix67 ZKW watashi 三、专题 动态规划系列: 数位dp模板 字符串系列: 【专辑】AC自动机
阅读全文
摘要:DescriptionFor a tree, which nodes and edges are all weighted, the ratio of it is calculated according to the following equation.Given a complete grap...
阅读全文
摘要:Description176. Flow constructiontime limit per test: 1 sec.memory limit per test: 4096 KBinput: standardoutput: standardYou have given the net consisting of nodes and pipes; pipes connect the nodes. Some substance can flow by pipes, and flow speed in any pipe doesn't exceed capacity of this pip
阅读全文
摘要:DescriptionGensokyois a world which exists quietly beside ours, separated by a mystical border. It is a utopia where humans and other beings such as fairies,youkai(phantoms), and gods live peacefully together. Shameimaru Aya is a crow tengu with the ability to manipulate wind who has been inGensokyo
阅读全文
摘要:DescriptionThe terrorist group leaded by a well known international terrorist Ben Bladen is buliding a nuclear reactor to produce plutonium for the nuclear bomb they are planning to create. Being the wicked computer genius of this group, you are responsible for developing the cooling system for the
阅读全文
摘要:Description给你一个m*n的格子的棋盘,每个格子里面有一个非负数。 从中取出若干个数,使得任意的两个数所在的格子没有公共边,就是说所取数所在的2个格子不能相邻,并且取出的数的和最大。Input包括多个测试实例,每个测试实例包括2整数m,n和m*n个非负数(m 2 #include 3 #include 4 #include 5 using namespace std; 6 7 const int MAXN = 3000; 8 const int MAXE = 30010; 9 const int INF = 0x3fff3fff; 10 11 struct ...
阅读全文
摘要:DescriptionIt is year 2500 A.D. and there is a terrible war between the forces of the Earth and the Mars. Recently, the commanders of the Earth are informed by their spies that the invaders of Mars want to land some paratroopers in them×ngrid yard of one their main weapon factories in order to
阅读全文
摘要:DescriptionYou’ve finally got mad at “the world’s most stupid” employees of yours and decided to do some firings. You’re now simply too mad to give response to questions like “Don’t you think it is an even more stupid decision to have signed them?”, yet calm enough to consider the potential profit a
阅读全文
摘要:DescriptionIn modern society, each person has his own friends. Since all the people are very busy, they communicate with each other only by phone. You can assume that people A can keep in touch with people B, only if 1. A knows B's phone number, or 2. A knows people C's phone number and C ca
阅读全文
摘要:DescriptionYou are the lead programmer for the Securitron 9042, the latest and greatest in home security software from Jellern Inc. (Motto: We secure your stuff so YOU can't even get to it). The software is designed to "secure" a room; it does this by determining the minimum number of
阅读全文
摘要:DescriptionCIA headquarter collects data from across the country through its classified network. They have been using optical fibres long before it's been deployed on any civilian projects. However they are still under a lot pressure recently because the data are growing rapidly. As a result the
阅读全文

浙公网安备 33010602011771号