题目链接求对应区间最大值与最小值的差;#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)