zoj 1967 Fiber Network/poj 2570】的更多相关文章

题意就是 给你 n个点 m条边 每条边有些公司支持 问 a点到b点的路径有哪些公司可以支持 这里是一条路径中要每段路上都要有该公司支持 才算合格的一个公司// floyd 加 位运算// 将每个字符当成二进制中的一位就好#include <iostream> #include <map> #include <algorithm> #include <queue> #include <math.h> #include <stdio.h>…
题目翻译 一些公司决定搭建一个更快的网络.称为"光纤网". 他们已经在全世界建立了很多网站.这 些网站的作用类似于路由器.不幸的是,这些公司在关于网站之间的接线问题上存在争论,这样"光纤网"项目就被迫终止了,留下的是每一个公司自己在某些网站之间铺设的线路. 如今,Internet 服务供应商.当想从网站 A传送数据到网站 B,就感到困惑了.究竟哪个公司 可以提供必要的连接. 请帮助供应商回答他们的查询.查询全部可以提供从网站 A到站定 B的线 路连接的公司. 输入描…
POJ 1459 Power Network / HIT 1228 Power Network / UVAlive 2760 Power Network / ZOJ 1734 Power Network / FZU 1161 (网络流,最大流) Description A power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A…
Fiber Network Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 3328   Accepted: 1532 Description Several startup companies have decided to build a better Internet, called the "FiberNet". They have already installed many nodes that ac…
ZOJ - 1586 QS Network (Prim) #include<iostream> #include<cstring> using namespace std; +; ;//无穷远 int n; int cost[maxn]; int Edge[maxn][maxn]; int lowcost[maxn]; void Init() { cin>>n; ;i<n;i++) {//读入每个结点的适配器价值 cin>>cost[i]; } ;i&…
A - Wireless Network POJ - 2236 Time Limit: 10000MS   Memory Limit: 65536K Total Submissions: 50348   Accepted: 20619 Description An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with…
E - Cell Phone Network POJ - 3659 题目大意: 给你一棵树,放置灯塔,每一个节点可以覆盖的范围是这个节点的所有子节点和他的父亲节点,问要使得所有的节点被覆盖的最少灯塔数量. 考虑每一个节点要被覆盖应该如何放置灯塔. 如果一个节点被覆盖 1 该节点放了灯塔  2 该点的父亲节点放了灯塔  3 该点的儿子节点放了灯塔. dp[u][0] 表示这个节点的儿子节点放了灯塔 dp[u][1] 表示这个点本身放了灯塔 dp[u][2] 表示这个点的父亲节点放了灯塔 转移方程,…
B - Strategic game POJ - 1463   题目大意:给你一棵树,让你放最少的东西来覆盖所有的边   这个题目之前写过,就是一个简单的树形dp的板题,因为这个每一个节点都需要挺好处理的. 这个树形dp是从底往根部来递推,所以每一个点,都是由它的根节点来递推的. 如果一个根节点的子节点放了东西,那么这个根节点就可以有选择,但是如果没有放东西,那么这个根节点就必须放东西. E - Cell Phone Network POJ - 3659   题目大意:给你一棵树,让你用最小的东…
枚举起点和公司,每次用DFS跑一遍图,预处理出所有的答案.询问的时候很快就能得到答案. #include<cstdio> #include<cmath> #include<cstring> #include<vector> #include<algorithm> using namespace std; ][][]; ][][]; ]; vector<]; int n; int S,T,G; void DFS(int now) { ans[…
Description Several startup companies have decided to build a better Internet, called the "FiberNet". They have already installed many nodes that act as routers all around the world. Unfortunately, they started to quarrel about the connecting li…