码迷,mamicode.com
首页 >  
搜索关键字:jungle roads    ( 729个结果
1123: [POI2008]BLO
1123: [POI2008]BLO Description Byteotia城市有n个 towns m条双向roads. 每条 road 连接 两个不同的 towns ,没有重复的road. 所有towns连通。 Byteotia城市有n个 towns m条双向roads. 每条 road 连接 ...
分类:其他好文   时间:2018-05-12 18:26:41    阅读次数:157
GYM - 101620 J.Justified Jungle
题意: 给出一棵树,删掉其中一些边,要求生成的每个子树节点数一样。输出所有可以删掉的边数。 题解: 以节点1为根,预处理每个子树的大小。对于每个n的因数x,还需满足子树为他倍数的点够n/x个,那么删的边数就为n/x-1。 #include <bits/stdc++.h> using namespac ...
分类:其他好文   时间:2018-05-12 18:20:56    阅读次数:205
POJ-2421-Constructing Roads(最小生成树 普利姆)
Description There are N villages, which are numbered from 1 to N, and you should build some roads such that every two villages can connect to each oth ...
分类:其他好文   时间:2018-05-05 12:41:03    阅读次数:180
Jungle Roads(Kruskal)
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9216 Accepted Submission(s): 6805 Problem Descrip ...
分类:其他好文   时间:2018-05-05 12:38:50    阅读次数:147
HDU2586---How far away ?(lca算法)
Problem Description There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How ...
分类:编程语言   时间:2018-04-30 18:03:26    阅读次数:183
ROADS POJ - 1724 约束最短路 暴搜 加剪枝
http://poj.org/problem?id=1724 题意:最短路的模板,不过每条边加上一个费用,要求总费用不超过k 题解:不能用dijkstra ,直接暴力,dfs维护len和cost。 普通的剪枝:如果当前的cost大于k直接跳出,如果当前的len大于minlen(目前的最优解),跳出。 ...
分类:其他好文   时间:2018-04-30 13:38:33    阅读次数:156
bzoj 1621: [Usaco2008 Open]Roads Around The Farm分岔路口【dfs】
模拟就行……讲道理这个时间复杂度为啥是对的??? cpp include include using namespace std; int k,n; int dfs(int v) { if(v ...
分类:其他好文   时间:2018-04-27 17:52:18    阅读次数:137
bzoj 1626: [Usaco2007 Dec]Building Roads 修建道路【最小生成树】
先把已有的边并查集了,然后MST即可 记得开double cpp include include include include using namespace std; const int N=1005; int n,m,f[N],con,tot; double x[N],y[N],ans; st ...
分类:其他好文   时间:2018-04-27 15:55:36    阅读次数:106
Rescue
Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and ...
分类:其他好文   时间:2018-04-24 21:54:53    阅读次数:179
Light oj 1379 -- 最短路
In Dhaka there are too many vehicles. So, the result is well known, yes, traffic jam. So, mostly people have to spend quite a time in the roads to go ...
分类:其他好文   时间:2018-04-11 16:15:05    阅读次数:152
729条   上一页 1 ... 12 13 14 15 16 ... 73 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!