DescriptionOn a grid map there are n little men
and n houses. In each unit time, every little man can move one unit step, either
horizontally, or vert...
分类:
其他好文 时间:
2014-07-22 23:15:37
阅读次数:
331
1 #include 2 #include 3 #include 4 using namespace
std; 5 int n,C[50005]; 6 //-------------------------- 7 int lowbit(int x){ 8
return x&-x; 9 }1...
分类:
其他好文 时间:
2014-07-22 23:12:33
阅读次数:
311
1 /* 2
题意:给出n个地点,每个地点的油价为pi每单位,给出m条边,每条长度为d,行走d距离的路需 3
要d单位的油;给出一辆车的油箱容量以及起始点:s,e;问s到e最少要耗费多少钱 4 5 题解:BFS+优先队列 6
这个搜索方式比较巧妙:状态为对于当前点是走还是油+1,这样...
分类:
其他好文 时间:
2014-07-22 23:10:56
阅读次数:
281
题目:http://poj.org/problem?id=3044题意:以坐标的形式给出一张图,表示一些楼房的正视图,求出楼房的最少个数。分析:和小学常做的立方体问题很像,很容易想到一个贪心方法,那就是尽量把矮的楼房放在高的楼房的前面,即连续的等高的一些"X"我们把它视为一座楼房。
具体的做法...
分类:
其他好文 时间:
2014-07-22 23:09:12
阅读次数:
373
A + B Problem IITime Limit: 2000/1000 MS
(Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s):
199099Accepted Submission(s): 3809...
分类:
其他好文 时间:
2014-07-22 23:08:54
阅读次数:
260
半平面交模板const double pi= acos(-1.0);#define
arc(x) (x / 180 * pi)const double EPS = 1e-8;const int Max_N = 105;struct Point{
double x,y; Point(){}...
分类:
其他好文 时间:
2014-04-30 17:00:01
阅读次数:
621
Stone Game, Why are you always there?Time Limit:
2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total
Submission(s): 393Accepted S...
分类:
其他好文 时间:
2014-04-29 17:23:45
阅读次数:
444
DescriptionFarmer John completed his new barn
just last week, complete with all the latest milking technology. Unfortunately,
due to engineering probl...
分类:
其他好文 时间:
2014-04-29 16:46:46
阅读次数:
371
Open the LockTime Limit: 2000/1000 MS
(Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s):
3847Accepted Submission(s): 1661Probl...
分类:
其他好文 时间:
2014-04-29 16:35:47
阅读次数:
450
poj 1279 求半平面交的
面积题目来源:http://poj.org/problem?id=1279分析: 求半平面交的 面积代码如下:const double EPS =
1e-8;const int Max_N = 1505;struct Point{ double x,y; ...
分类:
其他好文 时间:
2014-04-29 16:35:46
阅读次数:
499