![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
线段树
horihori_
这个作者很懒,什么都没留下…
展开
-
HDU - 1542 Atlantis(线段树扫描线基础)
#include <bits/stdc++.h>using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn =5000;double sum[maxn<<2],key[maxn<<2];int lazy[maxn<<2];struct line{ double l,r,y原创 2016-11-29 10:06:29 · 295 阅读 · 0 评论 -
poj 2528 - 线段树 - 离散化的小技巧
转自:http://www.notonlysuccess.com/index.php/segment-tree-complete/题意:在墙上贴海报,海报可以互相覆盖,问最后可以看见几张海报 思路:这题数据范围很大,直接搞超时+超内存,需要离散化: 离散化简单的来说就是只取我们需要的值来用,比如说区间[1000,2000],[1990,2012] 我们用不到[-∞,999][1001,1989]转载 2016-11-22 12:23:19 · 215 阅读 · 0 评论 -
POJ -2892 Tunnel Warfare - 线段树区间合并
LINK:http://poj.org/problem?id=2892//#include<bits/stdc++.h>#include<iostream>#include<cstdio>#include<stack>using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1const int maxn=500原创 2016-11-24 15:12:24 · 254 阅读 · 0 评论 -
HDU - 4578 -Transformation(线段树)
有地方写残了一直wa#include <iostream>#include <cstdio>#include <cstdlib>#include <cstring>#include <algorithm>#include <cmath>using namespace std;#define lson l,m,rt<<1#define rson m+1,r,rt<<1|1#defin原创 2016-11-25 22:36:59 · 426 阅读 · 0 评论