码迷,mamicode.com
首页 >  
搜索关键字:btrfs btree cow    ( 2269个结果
Codeforces 283B Cow Program
题意:给你a[2] - a[n], 一个初始x = 1,初始y = 0 ,执行下面步骤1) x +=a[x] ,y += a[x]2) x -= a[x] ,y += a[x]3)重复1-2步骤。只要中间x n 就跳出。输出y的值问你a[1] 从 [1,n-1]分别的值为多少。解题思路:dfs 求....
分类:其他好文   时间:2015-03-12 20:45:45    阅读次数:183
POJ2456 Aggressive cows 二分
DescriptionFarmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,…,xN (0 <= xi <= 1,000,000,000).His C (2 <= C <= N) cow...
分类:其他好文   时间:2015-03-12 19:20:32    阅读次数:243
POJ 2375 Cow Ski Area (强连通分量)
题目地址:POJ 2375 对每个点向与之相邻并h小于该点的点加有向边。然后强连通缩点。问题就转化成了最少加几条边使得图为强连通图,取入度为0和出度为0的点数的较大者即可。注意,当强连通分量只有一个的时候,答案是0,而不是1. 代码如下: #include #include #include #include #include #include #include #includ...
分类:其他好文   时间:2015-03-12 19:15:06    阅读次数:197
POJ 2376
连接点应该是只需连接而不必覆盖。按开始时间排序。假设当前最远为t,则按序枚举在t+1范围内开始的cow即可,再求出最远点。注意break条件。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define ...
分类:其他好文   时间:2015-03-09 22:23:00    阅读次数:218
POJ 3278 Catch That Cow _BFS
1 #include 2 #include 3 #include 4 #include 5 #define CL(x, y) memset(x,y,sizeof(x)) 6 using namespace std; 7 const int MAX = 200005;//100005太小了?...
分类:其他好文   时间:2015-03-09 14:13:27    阅读次数:166
【BZOJ3885】【Usaco2015 Jan】Cow Rectangles 某奇怪的最大子矩形
题意: 坐标系上给出n个点,分”H”和”G”,一个整点坐标上至多一个点。 现在求一个不包含”G”的包含尽量多”H”的子矩形,然后在保证”H”最多的情况下还要问最小面积。 输出”H”的最大数量,和保证”H”最多时的最小矩形面积。 题解: 我们发现因为坐标有限制[0,1000] (注意有”0”!!!),所以它是一个矩形。 第一问: 首先我们可以参照极大子矩形的做法算出所有的极大子矩形,然...
分类:其他好文   时间:2015-03-06 09:46:28    阅读次数:251
【BZOJ3889】【Usaco2015 Jan】Cow Routing 双键值最短路
题意: 从样例讲起。 第一行 s,t,m表示:起点,终点,m条航线。 然后m组,每组第一行len,n表示这条航线的代价, 这类似于公交车,只要用了就花这些钱,但是用多少都这些钱。 注意是单向边。 举例: 2333 4 3 2 1 4 就是3->2、3->1、3->4、2->1、2->4、1->4都花2333元。 这个花销是第一键值。 第二键值是经过几站。 比如3->2->...
分类:其他好文   时间:2015-03-04 21:12:24    阅读次数:127
Bookshelf 2
Farmer John recently bought another bookshelf for the cow library, but the shelf is getting filled up quite quickly, and now the only available space ...
分类:其他好文   时间:2015-03-04 14:28:43    阅读次数:166
poj Popular Cows(tarjan +缩点)
Language: Default Popular Cows Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 24384   Accepted: 10007 Description Every cow's dream is to become the mos...
分类:其他好文   时间:2015-03-03 09:57:41    阅读次数:142
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!