码迷,mamicode.com
首页 >  
搜索关键字:jungle roads    ( 729个结果
POJ2631 Roads in the North
题解: 树的最长路径,根据树的最长路径的性质,从任一一点bfs得到最远的点的位置,然后再从该点重新bfs一次就可以得到树的直径了 数学证明http://www.cnblogs.com/wuyiqi/archive/2012/04/08/2437424.html 代码: ...
分类:其他好文   时间:2016-09-03 20:59:41    阅读次数:117
CodeForces 711D Directed Roads (DFS判环+计数)
题意:给定一个有向图,然后你可能改变某一些边的方向,然后就形成一种新图,让你求最多有多少种无环图。 析:假设这个图中没有环,那么有多少种呢?也就是说每一边都有两种放法,一共有2^x种,x是边数,那么如果有环呢?假设x是这个连通块的边数, y是这个环的边数,那么就一共有2^x * (2 ^ y - 2 ...
分类:其他好文   时间:2016-08-31 02:03:44    阅读次数:154
Codeforces 711 D. Directed Roads (DFS判环)
题目链接:http://codeforces.com/problemset/problem/711/D 给你一个n个节点n条边的有向图,可以把一条边反向,现在问有多少种方式可以使这个图没有环。 每个连通量必然有一个环,dfs的时候算出连通量中点的个数y,算出连通量的环中点的个数x,所以这个连通量不成 ...
分类:其他好文   时间:2016-08-30 19:35:31    阅读次数:195
Codeforces Round #369 (Div. 2) D. Directed Roads dfs求某个联通块的在环上的点的数量
D. Directed Roads D. Directed Roads ZS the Coder and Chris the Baboon has explored Udayland for quite some time. They realize that it consists of n to ...
分类:移动开发   时间:2016-08-30 18:02:01    阅读次数:456
[CF711D]Directed Roads(强联通分量,计数)
题目链接:http://codeforces.com/contest/711/problem/D 熄灯了明天填坑… ...
分类:移动开发   时间:2016-08-30 00:06:59    阅读次数:312
NBUT 1635 Explosion(最小顶点覆盖)
[1635] Explosion 时间限制: 10000 ms 内存限制: 65535 K 问题描述 there is a country which contains n cities connected by n - 1 roads(just like a tree). If you place ...
分类:其他好文   时间:2016-08-28 16:24:44    阅读次数:219
HDU 1102 最小生成树裸题,kruskal,prim
1、HDU 1102 Constructing Roads 最小生成树 2、总结: 题意:修路,裸题 (1)kruskal //kruskal #include<iostream> #include<cstring> #include<cmath> #include<queue> #include< ...
分类:其他好文   时间:2016-08-28 01:13:18    阅读次数:253
codeforces707B:Bakery
Description Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of ...
分类:其他好文   时间:2016-08-22 00:17:21    阅读次数:221
Codeforces Round #368 (Div. 2) B
Description Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of ...
分类:其他好文   时间:2016-08-21 13:42:40    阅读次数:223
Codeforces Round #368 (Div. 2) Bakery
Bakery Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of whose ...
分类:其他好文   时间:2016-08-21 00:50:05    阅读次数:164
729条   上一页 1 ... 31 32 33 34 35 ... 73 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!