上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 41 下一页
题目链接求对应区间最大值与最小值的差;#include#include#include#include#define INF 0xfffffff#define N 50010using namespace std;#define Lson r>1; }}a[N*4];int MIN,MAX;v... Read More
posted @ 2015-07-31 21:24 西瓜不懂柠檬的酸 Views(146) Comments(0) Diggs(0)
题目链接题意:求每种颜色有几段线段;模拟数组:#include#include#include#includeusing namespace std;#define N 8006int cnt[N],a[N];int main(){ int n, p, q, c; while(scanf... Read More
posted @ 2015-07-31 17:42 西瓜不懂柠檬的酸 Views(201) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1251node *head=(node*)malloc(sizeof(node));for(int i=0; inext[i] = NULL; head->sum = 0;}可以改成node *hea... Read More
posted @ 2015-07-31 09:38 西瓜不懂柠檬的酸 Views(145) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=2528 题意:有n张海报要贴,每张需要用的区间为L到R,后面的可以贴在之前的上面,就是吧之前的挡住,求最后我们能看到几张海报; 我们可以倒着处理,因为最后贴的我们是能看到的;如果区间被贴过了result不加,没有贴过就+1并标记一下; Read More
posted @ 2015-07-31 08:41 西瓜不懂柠檬的酸 Views(135) Comments(0) Diggs(0)
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1754和上一题一样是模板题,就是那道题求得是和,这道求得是最大值:#include#include#include#include#include#include#includeusing namespace... Read More
posted @ 2015-07-30 19:38 西瓜不懂柠檬的酸 Views(155) Comments(0) Diggs(0)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1166线段树中对某一点的值进行改变;#include#include#include#includeusing namespace std;#define N 50010#define Lson r>1;... Read More
posted @ 2015-07-30 18:27 西瓜不懂柠檬的酸 Views(172) Comments(0) Diggs(0)
http://poj.org/problem?id=3468 题意:有一个比较长的区间可能是100000.长度, 每个点都有一个值(值还比较大), 现在有一些操作: C a b c, 把区间a--b内全部加上c Q a b,求区间ab的值和。 线段树 改变整个区间的数 这题不能直接更新到树的叶子节点 Read More
posted @ 2015-07-30 17:03 西瓜不懂柠檬的酸 Views(154) Comments(0) Diggs(0)
http://poj.org/problem?id=2251有一个三维的牢房地图 求从S点走E点的最小时间;#include#include#include#include#include#include#includeusing namespace std;#define N 50#define ... Read More
posted @ 2015-07-29 09:15 西瓜不懂柠檬的酸 Views(162) Comments(0) Diggs(0)
http://poj.org/problem?id=1321由于搜索是原来写的,而集训的时候没来所以只能现在补补咯-_-简单的深搜#include#include#include#include#define N 10#define INF 0xfffffff#include#includeusin... Read More
posted @ 2015-07-29 08:11 西瓜不懂柠檬的酸 Views(132) Comments(0) Diggs(0)
题目链接:http://poj.org/problem?id=3026题意:可以理解为给你一个地图上面有S和A的表示一个一个的点,#表示墙,所以需要我们用bfs来计算各点之间的距离;b[i][j] = p;代表map[i][j]的位置的点的编号为p;D[i][j] 代表编号为i和j的距离;#incl... Read More
posted @ 2015-07-28 21:02 西瓜不懂柠檬的酸 Views(602) Comments(0) Diggs(0)
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 41 下一页
levels of contents