HDU 4948 (傻比图论)】的更多相关文章

Kingdom Problem Description Teacher Mai has a kingdom consisting of n cities. He has planned the transportation of the kingdom. Every pair of cities has exactly a one-way road. He wants develop this kingdom from one city to one city. Teacher Mai now…
hdu 4948 Kingdom(推论) 传送门 题意: 题目问从一个城市u到一个新的城市v的必要条件是存在 以下两种路径之一 u --> v u --> w -->v 询问任意一种能够走完整个地图所有点的访问序列 题解: 首先这道题必然有解,因为题目的条件 其次存在一个推论,对于每个子图而言,当前图入度最大的点距离每个点的距离不超过2,例如 u-->w-->t-->v 如果v是入度最大的点,必然存在一条u/w-->v的路径,往更长的路径进行推论也一样,因为结合上…
Bomb Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10    Accepted Submission(s): 3 Problem Description There are N bombs needing exploding.Each bomb has three attributes: exploding radius ri,…
E - charge-station Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Practice HDU 4435 Appoint description: Description There are n cities in M^3's empire. M^3 owns a palace and a car and the palace resides in…
传递 Time Limit: 12000/6000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)     Problem Description 我们称一个有向图G是传递的,当且仅当对任意三个不同的顶点a,,若G中有 一条边从a到b且有一条边从b到c ,则G中同样有一条边从a到c.我们称图G是一个竞赛图,当且仅当它是一个有向图且它的基图是完全图.换句 话说,将完全图每条边定向将得到一个竞赛图.下图展示的是一个有4个顶点…
Kingdom Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 142    Accepted Submission(s): 84Special Judge Problem Description Teacher Mai has a kingdom consisting of n cities. He has planned the tr…
题目大义: 给一张图,任意两点间有单向边,找出一种方案,使得每个新入队的点与队中的点距离<=2. 题解: 贪心,从最后入队点开始反向插入,每次找出最大入度的点入队. 只需证明最大入度点A与所有未入队的点距离<=2 每次加入最大入度点A,设未入队的B集与A距离为1,假设若有未入队的点C与A距离>2,则必有A->C,B->C,则有C入度>A,矛盾! 故恒有解 代码: #include <cstdio> #include <cstring> #incl…
Reward Problem Description Dandelion's uncle is a boss of a factory. As the spring festival is coming , he wants to distribute rewards to his workers. Now he has a trouble about how to distribute the rewards. The workers will compare their rewards ,a…
Description P. T. Tigris is a student currently studying graph theory. One day, when he was studying hard, GS appeared around the corner shyly and came up with a problem: Given a graph with n nodes and m undirected weighted edges, every node having o…
Stock Chase Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1201    Accepted Submission(s): 363 Problem Description I have to admit, the solution I proposed last year for solving the bank cash c…