【POJ】【3164】Commond Network】的更多相关文章

Word Puzzles Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 10782 Accepted: 4076 Special Judge Description Word puzzles are usually simple and very entertaining for all ages. They are so entertaining that Pizza-Hut company started using t…
Time Limit: 3000MSMemory Limit: 65536K Total Submissions: 27109Accepted: 7527 Description David the Great has just become the king of a desert country. To win the respect of his people, he decided to build channels all over his country to bring water…
Time Limit: 1000MSMemory Limit: 65536K Total Submissions: 13849Accepted: 4851 Description In a certain course, you take n tests. If you get ai out of bi questions correct on test i, your cumulative average is defined to be . Given your test scores an…
Time Limit: 1000MSMemory Limit: 65536K Total Submissions: 19026Accepted: 8466 Description The Genographic Project is a research partnership between IBM and The National Geographic Society that is analyzing DNA from hundreds of thousands of contributo…
1.POJ1258 水水的prim……不过poj上硬是没过,wikioi上的原题却过了 #include<cstring> #include<algorithm> #include<cstdio> using namespace std; ,inf=1e8; ],g[maxn+][maxn+],ans=,n; ]; int main() { scanf("%d",&n); ;i<=n;++i) ;j<=n;++j) { scanf…
流星雨撞击地球(平面直角坐标第一象限),问到达安全地带的最少时间. 对于每颗流星雨i,在ti时刻撞击(xi,yi)点,同时导致(xi,yi)和上下左右相邻的点在ti以后的时刻(包括t)不能再经过(被封锁).安全地带为永远不会被封锁的点. 简单bfs,开始WA在把平面空间上限当成300*300,但根据题目,这只是有流星雨撞击的范围.实际可走的空间理论上没上限,但分析可得,离原点最近的安全地带一定在(302,302)范围内,所以应可把数组至少开为303*303. 后来WA在把G[0][0]==1的情…
题目大意:给n个数,一个长度为k(k<n)的闭区间从0滑动到n,求滑动中区间的最大值序列和最小值序列. 最大值和最小值是类似的,在此以最大值为例分析. 数据结构要求:能保存最多k个元素,快速取得最大值,更新时删去“过期”元素和“不再有希望”的元素,安放新元素. 单调队列的基本概念百度百科讲得比较清楚了:http://baike.baidu.com/view/3771451.htm 我的大致思路是: 1. 每个元素存储为结构体,包含它的秩和值.维护最大长度为k的单调队列,保证所有元素的秩都在区间内…
Time Limit: 3000MSMemory Limit: 65536K Description Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of concatenation as multiplication…
[POJ 3694] Network(割边+LCA) Network Time Limit: 5000MS   Memory Limit: 65536K Total Submissions: 7971   Accepted: 2902 Description A network administrator manages a large network. The network consists of N computers and M links between pairs of comput…
题意:有N个方块,M个操作{"C x":查询方块x上的方块数:"M x y":移动方块x所在的整个方块堆到方块y所在的整个方块堆之上}.输出相应的答案. 解法:带权并查集.每堆方块作为一个集合,维护3个数组:fa[x]表示x方块所在堆的最顶部的方块:d[x]表示x方块所在堆的最底部的方块:f[x]表示x方块方块x上的方块数. 注意--一般画树理解,这个图用方块理解好一点,例子:[bzoj 1202][HNOI2005] 狡猾的商人(图论--带权并查集+前缀和) .要…